influxdb2
环境配置
docker run 部署
docker run -d --name influxdb \
--restart always \
-p 8086:8086 \
-v influxdb2-data:/var/lib/influxdb2 \
-v influxdb2-config:/etc/influxdb2 \
-e DOCKER_INFLUXDB_INIT_MODE=setup \
-e DOCKER_INFLUXDB_INIT_USERNAME=admin \
-e DOCKER_INFLUXDB_INIT_PASSWORD=password \
-e DOCKER_INFLUXDB_INIT_ORG=influx \
-e DOCKER_INFLUXDB_INIT_BUCKET=influx \
-e DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=Eing5yaew6ujoo9ohd3saeH6neeshei3 \
influxdb:2.7docker compose 部署
官方文档:https://docs.influxdata.com/influxdb/v2/install/use-docker-compose/
# vim docker-compose.yaml
services:
influxdb:
image: influxdb:2.7
container_name: influxdb
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: admin
DOCKER_INFLUXDB_INIT_PASSWORD: password
DOCKER_INFLUXDB_INIT_ORG: influx
DOCKER_INFLUXDB_INIT_BUCKET: influx
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: Eing5yaew6ujoo9ohd3saeH6neeshei3
volumes:
- influxdb2-data:/var/lib/influxdb2
- influxdb2-config:/etc/influxdb2
ports:
- 8086:8086
restart: always
volumes:
influxdb2-data:
influxdb2-config:
influxdb 3-core
环境配置
docker run部署
# File system object store with Docker
# Create a mount
# Provide the mount path
docker run -it \
--volume /path/on/host:/path/in/container \
influxdb:3-core influxdb3 serve \
--node-id my_host \
--object-store file \
--data-dir /path/in/containerdocker compose部署
# compose.yaml
services:
influxdb3-core:
image: influxdb:3-core
ports:
- 8181:8181
command:
- influxdb3
- serve
- --node-id=node0
- --object-store=file
- --data-dir=/var/lib/influxdb3/data
- --plugin-dir=/var/lib/influxdb3/plugins
volumes:
- type: bind
# Path to store data on your host system
source: ~/.influxdb3/data
# Path to store data in the container
target: /var/lib/influxdb3/data
- type: bind
# Path to store plugins on your host system
source: ~/.influxdb3/plugins
# Path to store plugins in the container
target: /var/lib/influxdb3/plugins