docker run -d \
-p 8053:8086 \
-e INFLUXDB_DB=prometheus \
-e INFLUXDB_ADMIN_USER=admin -e INFLUXDB_ADMIN_PASSWORD=sa_123 \
-v $PWD:/var/lib/influxdb \
--restart=always \
--name myinfluxdb influxdb:1.8
prometheus.yml
remote_write:
- url: "http://192.168.75.130:8053/api/v1/prom/write?db=prometheus&u=admin&p=sa_123"
remote_read:
- url: "http://192.168.75.130:8053/api/v1/prom/read?db=prometheus&u=admin&p=sa_123"
持久化之后,在master-Prometheus重启的过程时间内数据不会有记录,这段时间内数据出现断层。
如果master-prometheus重启持续的时间比较短,比如重启花费了3分钟,获取指标的间隔是五分钟,此时图线正常。
设置保留策略:https://cloud.tencent.com/developer/article/1546922zi