Document using a config file through Docker volume (#2207)
Document using InfluxDB config file with Docker volume Replace quay image with DockerHub Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>pull/2216/head
parent
da1aa5d57e
commit
77ff9d6f65
|
@ -311,7 +311,7 @@ Expose port `8086`, which InfluxDB uses for client-server communication over
|
||||||
the [InfluxDB HTTP API](/influxdb/v2.0/reference/api/).
|
the [InfluxDB HTTP API](/influxdb/v2.0/reference/api/).
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker run --name influxdb -p 8086:8086 quay.io/influxdb/influxdb:v2.0.4
|
docker run --name influxdb -p 8086:8086 influxdb:2.0.4
|
||||||
```
|
```
|
||||||
_To run InfluxDB in [detached mode](https://docs.docker.com/engine/reference/run/#detached-vs-foreground), include the `-d` flag in the `docker run` command._
|
_To run InfluxDB in [detached mode](https://docs.docker.com/engine/reference/run/#detached-vs-foreground), include the `-d` flag in the `docker run` command._
|
||||||
|
|
||||||
|
@ -331,14 +331,40 @@ _To run InfluxDB in [detached mode](https://docs.docker.com/engine/reference/run
|
||||||
--name influxdb \
|
--name influxdb \
|
||||||
-p 8086:8086 \
|
-p 8086:8086 \
|
||||||
--volume $PWD:/root/.influxdbv2 \
|
--volume $PWD:/root/.influxdbv2 \
|
||||||
quay.io/influxdb/influxdb:v2.0.4
|
influxdb:2.0.4
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Configure InfluxDB with Docker
|
||||||
|
|
||||||
|
To mount an InfluxDB configuration file and use it from within Docker:
|
||||||
|
|
||||||
|
1. [Persist data outside the InfluxDB container](#persist-data-outside-the-influxdb-container).
|
||||||
|
|
||||||
|
2. Use the command below to generate the default configuration file on the host file system:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ docker run \
|
||||||
|
--rm influxdb:2.0.4 \
|
||||||
|
influxd print-config > config.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Modify the default configuration, which will now be available under `$PWD`.
|
||||||
|
|
||||||
|
4. Start the InfluxDB container:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ docker run -p 8086:8086 \
|
||||||
|
-v $PWD/config.yml:/etc/influxdb2/config.yml:ro \
|
||||||
|
influxdb:2.0.4
|
||||||
|
```
|
||||||
|
|
||||||
|
(Find more about configuring InfluxDB [here](https://docs.influxdata.com/influxdb/v2.0/reference/config-options/).)
|
||||||
|
|
||||||
### Console into the InfluxDB container
|
### Console into the InfluxDB container
|
||||||
|
|
||||||
To use the `influx` command line interface, console into the `influxdb` Docker container:
|
To use the `influx` command line interface, console into the `influxdb` Docker container:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
docker exec -it influxdb /bin/bash
|
docker exec -it influxdb /bin/bash
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -352,8 +378,8 @@ information about what data is collected and how it is used.
|
||||||
To opt-out of sending telemetry data back to InfluxData, include the
|
To opt-out of sending telemetry data back to InfluxData, include the
|
||||||
`--reporting-disabled` flag when starting the InfluxDB container.
|
`--reporting-disabled` flag when starting the InfluxDB container.
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
docker run -p 8086:8086 quay.io/influxdb/influxdb:v2.0.4 --reporting-disabled
|
docker run -p 8086:8086 influxdb:2.0.4 --reporting-disabled
|
||||||
```
|
```
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue