You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -54,9 +54,9 @@ You don't need to do an extra effort of creating all the table manually, because
54
54
> To have a PostgreSQL database up and running in a few seconds, you can use the docker compose file `deploy/docker-compose.yaml`. This file will do automatically all the configurations required transparently.
55
55
> You just need to navigate to the `deploy` folder and execute the command `docker compose up -d`
56
56
57
-
2.**InfluxDB database**
57
+
2.**InfluxDB 3 Core database**
58
58
59
-
Conluz uses InfluxDB as a time series database to store consumption, production and energy prices data gathered from different sources like datadis.es, Shelly meters or Huawei inverters.
59
+
Conluz uses InfluxDB 3 Core as a time series database to store consumption, production and energy prices data gathered from different sources like datadis.es, Shelly meters or Huawei inverters.
If you are running Postgres locally on `localhost:5432` you don't need to provide this environment variable because that is the default configuration.
110
110
111
-
4. Configure InfluxDB database
111
+
4. Configure InfluxDB 3 Core database
112
112
113
-
#### New InfluxDB installation
113
+
#### New InfluxDB 3 Core installation
114
114
115
-
To have an InfluxDB database up and running in a few seconds, you can use the docker compose file `deploy/docker-compose.yaml`. This file will do automatically all the configurations required transparently.
116
-
You just need to execute the command `docker compose up -d influxdb`
115
+
To set up InfluxDB 3 Core, follow these steps:
117
116
118
-
#### Already existing InfluxDB installation
119
-
If you already have an InfluxDB database up and running, you need to execute these commands:
117
+
**Start the container:**
118
+
```bash
119
+
docker compose up -d influxdb3-core
120
+
```
120
121
121
-
```sql
122
-
CREATE DATABASE conluz_db
123
-
CREATE USER luz WITH PASSWORD 'blank'
124
-
GRANT ALL ON conluz_db TO luz
125
-
CREATE RETENTION POLICY one_month ON conluz_db DURATION 30d REPLICATION 1
126
-
CREATE RETENTION POLICY one_year ON conluz_db DURATION 365d REPLICATION 1
Open the `.env` file in the `deploy` folder and paste the token string for the `INFLUXDB_TOKEN` environment variable.
129
+
130
+
**Restart the container:**
131
+
Down and up the container again to make the healthcheck read the previously created token:
132
+
```bash
133
+
docker compose down influxdb3-core && docker compose up -d influxdb3-core
128
134
```
129
-
These commands will:
130
-
- Create a database called "conluz_db".
131
-
- Create a user called "luz".
132
-
- Grant privileges to the user "luz" over the database "conluz_db".
133
-
- Create a set of policies required by the app.
134
135
135
-
By default, the InfluxDB settings are:
136
+
**Verify the installation:**
137
+
Verify that influxdb3-core is up and running by executing a query (replace with your actual token):
138
+
```bash
139
+
docker exec influxdb3-core influxdb3 show databases --token <your_token_here>
136
140
```
137
-
url=http://localhost:8086
138
-
username=luz
139
-
password=blank
140
-
database=conluz_db
141
+
142
+
** Locate volume locally **
143
+
If you want to know where exactly is influxdb3-core service storing the data through the volumne influxdb_data you can run this command to list all the volumes:
144
+
```bash
145
+
docker volume ls
141
146
```
142
147
143
-
If you have your InfluxDB running with a different server, port, user credentials or database name, you would need to update the file `src/main/resources/application.properties` with your values.
148
+
Locate the volume and copy the id of the volume. Then you can run this command to inspect the volume:
If you already have an InfluxDB 3 Core database up and running, you need to:
177
+
- Create a database called `conluz_db`
178
+
- Generate an admin token
179
+
- Configure your application with the appropriate connection settings in `src/main/resources/application.properties`
144
180
145
181
5. Run the application
146
182
@@ -154,6 +190,58 @@ If you have your InfluxDB running with a different server, port, user credential
154
190
155
191
The application will be accessible at https://localhost:8443.
156
192
193
+
**InfluxDB Explorer (UI)**
194
+
195
+
InfluxDB Explorer is a web-based user interface forquerying and visualizing data storedin InfluxDB 3 Core. To run the Explorer and connect it to your influxdb3-core service:
196
+
197
+
>**Note:**
198
+
>
199
+
> You can find official documentation [here](https://docs.influxdata.com/influxdb3/explorer/install/?t=Docker+Compose).
200
+
201
+
**Pre-configure the connection:**
202
+
203
+
Create a `config.json` file in the `deploy/config` directory with the following content:
204
+
205
+
```json
206
+
{
207
+
"connections": [
208
+
{
209
+
"name": "conluz_db",
210
+
"url": "http://influxdb3-core:8181",
211
+
"token": "your_admin_token_here",
212
+
"database": "conluz_db"
213
+
}
214
+
]
215
+
}
216
+
```
217
+
218
+
Replace `your_admin_token_here` with the admin token you created earlier (the same token from `INFLUXDB_TOKEN`in the `.env` file).
219
+
220
+
**Start InfluxDB Explorer:**
221
+
```bash
222
+
docker compose up -d influxdb3-explorer
223
+
```
224
+
225
+
**Access the Explorer:**
226
+
Open your browser and navigate to http://localhost:8888
227
+
228
+
The connection to influxdb3-core will be pre-configured and ready to use. You can now:
229
+
- Run SQL queries against your time-series data
230
+
- Browse databases and tables
231
+
- Visualize data with charts and graphs
232
+
- Explore the schema of your measurements
233
+
234
+
>**Note:**
235
+
>
236
+
> The Explorer container is configured to communicate with influxdb3-core through Docker's internal network using `http://influxdb3-core:8181`. If you need to access InfluxDB from outside the Docker network, use `http://localhost:8181` instead.
237
+
238
+
** Create a new database **
239
+
240
+
Once you have InfluxDB Explorer up and running, you can create a new database by following these steps:
241
+
242
+
- Go to the `Manage Databases` tab and click on the `Create New` button. Craete a databse with the same name as the one you configured in the `config.json` file.
0 commit comments