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
InfluxDB has departed from the pattern established in 2021 whereby
pinning to the `1.8` tag was (effectively) a synonym for
"the latest release of InfluxDB 1".
At some point in the last few months, the `1.11` tag took on this role.
This seems to have happened after a period of experimentation involving
variants of `1.9-xx` and `1.10-xx`. It looks like there never were
plain `1.9` or `1.10` tags so we (IOTstack) really haven't missed much.
The 1.8 (and earlier) containers launched as root. The 1.11 container
launches as root but downgrades its privileges to user ID 1500
(user `influxdb` inside the container). In a clean-slate situation,
`docker-compose` will create the persistent store owned by root.
In an "upgrade 1.8 to 1.11" situation, the persistent store will be
owned by root. Version 1.11 does not appear to contain any self-repair
code for dealing with either of these situations, which means the
container is unable to access its persistent store, crashes, and goes
into a restart loop. Adding a `user: "0"` clause restores the 1.8
behaviour so 1.11 launches properly.
I have been running v1.11 for the last month without issues so I see
no reason not to make this the default for IOTstack.
The InfluxDB documentation web site for v1 which used to include a
`v1.8` path component now uses just `v1`. IOTstack documentation
updated accordingly.
The IOTstack documentation for InfluxDB 2 had numerous references to
"1.8". Updated to refer to version "1".
Signed-off-by: Phill Kelley <[email protected]>
*IOTstack uses the `influxdb:1.8` image. Substituting the `:latest` tag will get you InfluxDB version 2 and *will* create a mess.
21
+
*IOTstack uses the `influxdb:1.x` image. Substituting the `:latest` tag will get you InfluxDB version 2 and *will* create a mess.
22
22
23
23
## Configuration { #configuration }
24
24
25
-
All InfluxDB [settings](https://docs.influxdata.com/influxdb/v1.8/administration/config) can be applied using environment variables. Environment variables override any settings in the [InfluxDB configuration file](#configFile):
25
+
All InfluxDB [settings](https://docs.influxdata.com/influxdb/v1/administration/config) can be applied using environment variables. Environment variables override any settings in the [InfluxDB configuration file](#configFile):
26
26
27
27
* Under "new menu" (master branch), environment variables are stored inline in
28
28
@@ -152,8 +152,8 @@ You can open the `influx` CLI interactive shell by:
Copy file name to clipboardExpand all lines: docs/Containers/InfluxDB2.md
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,23 +13,23 @@
13
13
- DockerHub does not have a 32-bit image for InfluxDB 2 so you can't run this container until you have upgraded.
14
14
- Running full 64-bit is **not** the same as enabling the 64-bit kernel in `/boot/config.txt`. User-mode needs to be 64-bit capable as well. You must start from a [full 64-bit image](https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit).
15
15
16
-
2. Node-RED is your principal mechanism for feeding data to InfluxDB 1.8.
16
+
2. Node-RED is your principal mechanism for feeding data to InfluxDB 1.
17
17
18
-
- You may have other services feeding data to InfluxDB 1.8 (eg Telegraf). The steps documented here will migrate all your existing data but do not discuss how to adapt services other than Node-RED to feed new data to InfluxDB 2.
18
+
- You may have other services feeding data to InfluxDB 1 (eg Telegraf). The steps documented here will migrate all your existing data but do not discuss how to adapt services other than Node-RED to feed new data to InfluxDB 2.
19
19
20
-
3. Grafana is your principle mechanism for creating dashboards based on data stored in InfluxDB 1.8.
20
+
3. Grafana is your principle mechanism for creating dashboards based on data stored in InfluxDB 1.
21
21
22
22
- You may have other visualisation tools. You may gain insights from studying how Grafana needs to be changed to run Flux queries against InfluxDB 2 buckets but this documentation does not explore alternatives.
23
23
24
-
4. Node-RED, InfluxDB 1.8 and Grafana are all running in *non-host* mode on the same Docker instance, and that it is your intention to deploy InfluxDB 2 in *non-host* mode as well.
24
+
4. Node-RED, InfluxDB 1 and Grafana are all running in *non-host* mode on the same Docker instance, and that it is your intention to deploy InfluxDB 2 in *non-host* mode as well.
25
25
26
26
- If you are running any containers in *host* mode or have distributed the services across multiple Docker instances, you will have to adapt appropriately.
27
27
28
28
## terminology: *database* vs *bucket*
29
29
30
-
InfluxDB 1.8 and InfluxDB 2 are both database management systems (DBMS), sometimes referred to as "engines", optimised for storage and retrieval of time-series data. InfluxDB 1.8 uses the term *database* to mean a collection of *measurements*. InfluxDB 2 uses the term *bucket* to mean the same thing.
30
+
InfluxDB 1 and InfluxDB 2 are both database management systems (DBMS), sometimes referred to as "engines", optimised for storage and retrieval of time-series data. InfluxDB 1 uses the term *database* to mean a collection of *measurements*. InfluxDB 2 uses the term *bucket* to mean the same thing.
31
31
32
-
When an InfluxDB 1.8*database* is migrated, it becomes an InfluxDB 2 *bucket*. You will see this change in terminology in various places, such as the InfluxDB-out node in Node-RED. When that node is set to:
32
+
When an InfluxDB 1 *database* is migrated, it becomes an InfluxDB 2 *bucket*. You will see this change in terminology in various places, such as the InfluxDB-out node in Node-RED. When that node is set to:
33
33
34
34
* Version 1.x, the user interface has a "Database" field which travels with the *connection*. For example:
35
35
@@ -175,30 +175,30 @@ To initialise InfluxDB 2:
175
175
$ docker logs influxdb2
176
176
```
177
177
178
-
If you don't need to migrate any data from InfluxDB 1.8 you can go straight to [running InfluxDB 2](#runContainer), otherwise follow the [data-migration procedure](#migrateContainer) instructions below.
178
+
If you don't need to migrate any data from InfluxDB 1 you can go straight to [running InfluxDB 2](#runContainer), otherwise follow the [data-migration procedure](#migrateContainer) instructions below.
Successful migration depends on the following assumptions being true:
183
183
184
184
* The InfluxDB 2 container is running and has just been initialised as per [initialising InfluxDB 2](#initContainer).
185
-
* The InfluxDB 1.8 container is running, and is based on the IOTstack service definition (or reasonable facsimile) at:
185
+
* The InfluxDB 1 container is running, and is based on the IOTstack service definition (or reasonable facsimile) at:
186
186
187
187
```
188
188
~/IOTstack/.templates/influxdb/service.yml
189
189
```
190
190
191
-
To migrate your InfluxDB 1.8 data:
191
+
To migrate your InfluxDB 1 data:
192
192
193
193
1. Be in the correct directory (assumed throughout):
194
194
195
195
```bash
196
196
$ cd ~/IOTstack
197
197
```
198
198
199
-
2. InfluxDB 1.8 runs as root and its persistent store is owned by root but not all files and folders in the persistent store are *group* or *world* readable. InfluxDB 2 runs as user ID 1000 (user "influxdb" inside the container). Because of this, you need to give InfluxDB 2 permission to read the InfluxDB 1.8 persistent store.
199
+
2. InfluxDB 1 runs as root and its persistent store is owned by root but not all files and folders in the persistent store are *group* or *world* readable. InfluxDB 2 runs as user ID 1000 (user "influxdb" inside the container). Because of this, you need to give InfluxDB 2 permission to read the InfluxDB 1 persistent store.
200
200
201
-
It is not a good idea to interfere with a persistent store while a container is running so best practice is to stop InfluxDB 1.8 for long enough to make a copy of its persistent store:
201
+
It is not a good idea to interfere with a persistent store while a container is running so best practice is to stop InfluxDB 1 for long enough to make a copy of its persistent store:
202
202
203
203
```bash
204
204
$ sudo rm -rf ./volumes/influxdb.migrate
@@ -213,10 +213,10 @@ To migrate your InfluxDB 1.8 data:
213
213
In words:
214
214
215
215
1. Ensure any previous attempts at migration are removed. Always be *extremely* careful with any `sudo rm` command. Check your work **before** you press <kbd>return</kbd>.
216
-
2. Stop InfluxDB 1.8.
217
-
3. Make a copy of the InfluxDB 1.8 persistent store.
218
-
4. Start InfluxDB 1.8 again.
219
-
5. Change ownership of the **copy** of the InfluxDB 1.8 persistent store.
216
+
2. Stop InfluxDB 1.
217
+
3. Make a copy of the InfluxDB 1 persistent store.
218
+
4. Start InfluxDB 1 again.
219
+
5. Change ownership of the **copy** of the InfluxDB 1 persistent store.
220
220
221
221
3. Edit your compose file as per the "upgrade" column of [Table 1](#svcDefVars). The changes you need to make are:
222
222
@@ -236,7 +236,7 @@ To migrate your InfluxDB 1.8 data:
236
236
- DOCKER_INFLUXDB_INIT_MODE=upgrade
237
237
```
238
238
239
-
2. Activate the volume mapping to give InfluxDB 2 read-only access to the **copy** of the InfluxDB 1.8 persistent store that you made in step 2:
239
+
2. Activate the volume mapping to give InfluxDB 2 read-only access to the **copy** of the InfluxDB 1 persistent store that you made in step 2:
240
240
241
241
- before editing:
242
242
@@ -270,9 +270,9 @@ To migrate your InfluxDB 1.8 data:
270
270
DOCKER_INFLUXDB_INIT_MODE=upgrade
271
271
```
272
272
273
-
This, combined with the absence of the "bolt" file, starts the migration process. You need to wait until the migration is complete. The simplest way to do that is to watch the size of the persistent store for InfluxDB 2 until it stops increasing. Experience suggests that the InfluxDB 2 persistent store will usually be a bit larger than InfluxDB 1.8. For example:
273
+
This, combined with the absence of the "bolt" file, starts the migration process. You need to wait until the migration is complete. The simplest way to do that is to watch the size of the persistent store for InfluxDB 2 until it stops increasing. Experience suggests that the InfluxDB 2 persistent store will usually be a bit larger than InfluxDB 1. For example:
274
274
275
-
* reference size for an InfluxDB 1.8 installation:
275
+
* reference size for an InfluxDB 1 installation:
276
276
277
277
```bash
278
278
$ sudo du -sh ./volumes/influxdb
@@ -330,7 +330,7 @@ The container now needs to be instructed to run in normal mode.
330
330
331
331
The absence of an active `DOCKER_INFLUXDB_INIT_MODE` variable places InfluxDB 2 into normal run mode.
332
332
333
-
4. If you have just performed a data migration, you can remove the **copy** of the InfluxDB 1.8 persistent store:
333
+
4. If you have just performed a data migration, you can remove the **copy** of the InfluxDB 1 persistent store:
334
334
335
335
```bash
336
336
$ sudo rm -rf ./volumes/influxdb.migrate
@@ -396,14 +396,14 @@ Go to [initialising InfluxDB 2](#initContainer).
396
396
```
397
397
398
398
2. Sign in to the InfluxDB 2 instance using your [«username»](#influxUsername) and [«password»](#influxPassword).
399
-
3. Click on "Explore" in the left-hand tool strip. That is marked [A] in the screen shot. In the area marked [B] you should be able to see a list of the *buckets* that were migrated from InfluxDB 1.8*databases*.
399
+
3. Click on "Explore" in the left-hand tool strip. That is marked [A] in the screen shot. In the area marked [B] you should be able to see a list of the *buckets* that were migrated from InfluxDB 1 *databases*.
400
400
401
401
In the screen shot, I clicked on other fields to create a query:
402
402
403
403
- In area <a name="influxExplorer-B"></a>[B], I selected the "power/autogen" *bucket*;
404
404
- In area <a name="influxExplorer-C"></a>[C], I selected the "hiking2" (electricity meter) *measurement*;
405
405
- In area <a name="influxExplorer-D"></a>[D], I selected the "voltage" *field*;
406
-
- The bucket in this test is a migrated copy of an InfluxDB 1.8 database. It was not ingesting live data so I also needed to change the duration popup menu [E] to a time-span that included the most-recent insertions;
406
+
- The bucket in this test is a migrated copy of an InfluxDB 1 database. It was not ingesting live data so I also needed to change the duration popup menu [E] to a time-span that included the most-recent insertions;
407
407
- Then I clicked the "Submit" button [F]; and
408
408
- The result was the graph in [G].
409
409
@@ -435,7 +435,7 @@ Two important things to note here are:
1. Assume you have an existing flow (eg a fairly standard [3-node flow](https://gist.github.com/Paraphraser/c9db25d131dd4c09848ffb353b69038f)) which is logging to an InfluxDB 1.8 database. Your goal is to modify the flow to log the same data to the recently-migrated InfluxDB 2 bucket.
438
+
1. Assume you have an existing flow (eg a fairly standard [3-node flow](https://gist.github.com/Paraphraser/c9db25d131dd4c09848ffb353b69038f)) which is logging to an InfluxDB 1 database. Your goal is to modify the flow to log the same data to the recently-migrated InfluxDB 2 bucket.
439
439
440
440
2. Start Node-RED if it is not running:
441
441
@@ -447,7 +447,7 @@ Two important things to note here are:
447
447
3. Use a web browser to connect to your Node-RED instance.
448
448
4. Drag a **new** InfluxDB-out node onto the canvas:
449
449
450
-
- This is exactly the same InfluxDB-out node that you have been using to write to your InfluxDB 1.8 databases. There isn't a different node or package for InfluxDB 2.
450
+
- This is exactly the same InfluxDB-out node that you have been using to write to your InfluxDB 1 databases. There isn't a different node or package for InfluxDB 2.
451
451
- Always drag a **new** InfluxDB-out node from the palette onto the canvas. Do not make the mistake of re-using an existing InfluxDB-out node (eg via copy and paste) because that is a very good way of breaking your flows.
452
452
453
453
5. Double-click the InfluxDB-out node to open it:
@@ -552,7 +552,7 @@ Two important things to note here are:
552
552
7. Click the Refresh button.
553
553
8. Click Apply.
554
554
555
-
In the side-by-side screen shots below, observations before the straight-line (missing data) segment were imported from InfluxDB 1.8 while observations after the straight-line segment were inserted by the new InfluxDB-out node in Node-RED.
555
+
In the side-by-side screen shots below, observations before the straight-line (missing data) segment were imported from InfluxDB 1 while observations after the straight-line segment were inserted by the new InfluxDB-out node in Node-RED.
@@ -585,8 +585,8 @@ In the side-by-side screen shots below, observations before the straight-line (m
585
585
586
586
## migration strategy
587
587
588
-
From the fact that both InfluxDB 1.8 and InfluxDB 2 can run in parallel, with Node-RED feeding the same data to both, it should be self-evident that you can repeat the data-migration as often as necessary, simply by starting from [re-initialising InfluxDB 2](#reinitContainer).
588
+
From the fact that both InfluxDB 1 and InfluxDB 2 can run in parallel, with Node-RED feeding the same data to both, it should be self-evident that you can repeat the data-migration as often as necessary, simply by starting from [re-initialising InfluxDB 2](#reinitContainer).
589
589
590
-
This implies that you can concentrate on one database at a time, adjusting Node-RED so that it writes each row of sensor data to both the InfluxDB 1.8 database and corresponding InfluxDB 2 bucket.
590
+
This implies that you can concentrate on one database at a time, adjusting Node-RED so that it writes each row of sensor data to both the InfluxDB 1 database and corresponding InfluxDB 2 bucket.
591
591
592
592
Having the data going to both engines means you can take your time adjusting your Grafana dashboards to be based on Flux queries. You can either retrofit InfluxDB 2 bucket sources and Flux queries to existing dashboards, or build parallel dashboards from the ground up.
0 commit comments