docker安装influxdb
目录
influxdb的docker-compose如何配置
- 新建数据目录
mkdir data-volumne
- 生成配置文件
docker run --rm influxdb:2.0.8 influxd print-config > config.yml
- docker-compose配置
docker-compose.yaml内容
version: "2"
services:
influxdb:
image: influxdb:2.0.8
volumes:
- ./data-volumne:/var/lib/influxdb2
- ./config.yml:/etc/influxdb2/config.yml
- /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime
ports:
- 8086:8086
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: my-user
DOCKER_INFLUXDB_INIT_PASSWORD: my-password
DOCKER_INFLUXDB_INIT_ORG: my-org
DOCKER_INFLUXDB_INIT_BUCKET: my-bucket
- 启动
docker-compose up
- 目录结构如下
[root@localhost influxdb]# tree
.
├── config.yml
├── data-volumne
│ ├── engine
│ │ └── data
│ └── influxd.bolt
└── docker-compose.yaml
- 注意
上面修改influx时区无效,好像不能修改时区,默认都是UTC