Skip to content

Commit 475c4ca

Browse files
committed
chore(Influxdb-v1): Revise database initialization section
1 parent 4427c85 commit 475c4ca

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

influxdb/content.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -573,24 +573,26 @@ Or run the influx client in a separate container:
573573
docker run --rm --link=influxdb -it %%IMAGE%%:1.8 influx -host influxdb
574574
```
575575

576-
Database Initialization
577-
-----------------------
576+
InfluxDB v1 database initialization
577+
-----------------------------------
578578

579-
The InfluxDB image contains some extra functionality for initializing a database. These options are not suggested for production, but are quite useful when running standalone instances for testing.
579+
The InfluxDB Docker Hub image lets you set initialization options when creating an InfluxDB v1 container.
580580

581-
The database initialization script will only be called when running `influxd`. It will not be executed when running any other program.
581+
**WARNING**: We **don't** recommend using these options for production scenarios, but they're useful when running standalone instances for testing.
582582

583-
### Environment Variables
583+
The database initialization script is only called when running `influxd`.
584584

585-
The InfluxDB image uses several environment variables to automatically configure certain parts of the server. They may significantly aid you in using this image.
585+
### Environment variables
586+
587+
During the InfluxDB v1 set up process, the InfluxDB image uses environment variables to automatically configure some server options. You can override the following environment variables to customize set up options.
586588

587589
#### INFLUXDB_DB
588590

589591
Automatically initializes a database with the name of this environment variable.
590592

591593
#### INFLUXDB_HTTP_AUTH_ENABLED
592594

593-
Enables authentication. Either this must be set or `auth-enabled = true` must be set within the configuration file for any authentication related options below to work.
595+
Enables authentication. Either this must be set or `auth-enabled = true` must be set within the configuration file for any authentication-related options below to work.
594596

595597
#### INFLUXDB_ADMIN_USER
596598

@@ -634,11 +636,13 @@ To manually initialize the database and exit, the `/init-influxdb.sh` script can
634636

635637
```console
636638
docker run --rm \
637-
-e INFLUXDB_DB=db0 \
638-
-e INFLUXDB_ADMIN_USER=admin -e INFLUXDB_ADMIN_PASSWORD=supersecretpassword \
639-
-e INFLUXDB_USER=telegraf -e INFLUXDB_USER_PASSWORD=secretpassword \
640-
-v $PWD:/var/lib/influxdb \
641-
%%IMAGE%%:1.8 /init-influxdb.sh
639+
-e INFLUXDB_DB=db0 \
640+
-e INFLUXDB_ADMIN_USER=admin \
641+
-e INFLUXDB_ADMIN_PASSWORD=supersecretpassword \
642+
-e INFLUXDB_USER=telegraf -e \
643+
-e INFLUXDB_USER_PASSWORD=secretpassword \
644+
-v $PWD:/var/lib/influxdb \
645+
%%IMAGE%%:1.8 /init-influxdb.sh
642646
```
643647

644648
The above would create the database `db0`, create an admin user with the password `supersecretpassword`, then create the `telegraf` user with your telegraf's secret password. It would then exit and leave behind any files it created in the volume that you mounted.

0 commit comments

Comments
 (0)