我正在使用Windows 10在Docker上運行Influxdb和grafana.
每次我關閉Docker時,我都會丟失資料庫.
這就是我所知道的:
>我嘗試調整保留策略,但沒有影響結果>我可以關閉并重新啟動容器(docker-compose down),資料庫仍在那里.只有當我關閉Docker for Windows時,我才會丟失資料庫.>當我創建新資料庫(/ data / Influxdb / data /)時,我在映射目錄中看不到任何新檔案夾.只有’_internal’檔案夾仍然存在,我認為這對應于名為’_internal’的持久資料庫
這是我的yml檔案.任何幫助非常感謝.
version: '3'
services:
# Define an InfluxDB service
influxdb:
image: influxdb
volumes:
- ./data/influxdb:/var/lib/influxdb
ports:
- "8086:8086"
- "80:80"
- "8083:8083"
grafana:
image: grafana/grafana
volumes:
- ./data/grafana:/var/lib/grafana
container_name: grafana
ports:
- "3000:3000"
env_file:
- 'env.grafana'
links:
- influxdb
# Define a service for using the influx CLI tool.
# docker-compose run influxdb-cli
influxdb-cli:
image: influxdb
entrypoint:
- influx
- -host
- influxdb
links:
- influxdb
uj5u.com熱心網友回復:
如果你正在使用docker-compose down / up,請記住這不是“重啟”,因為:> docker-compose up創建新的容器和> docker-compose down洗掉它們:
docker-compose up
Builds, (re)creates, starts, and attaches to containers for a service.
docker-compose down
Stops containers and removes containers, networks, volumes, and images created by up.
另一方面,如果你繼續使用:
> docker-compose start> docker-compose stop> docker-compose restart
你處理相同的容器,當你運行docker-compose時創建的容器.
uj5u.com熱心網友回復:
docker ps -adocker restart id
uj5u.com熱心網友回復:
https://blog.csdn.net/hnw13938056090/article/details/105359575轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/71908.html
標籤:其他技術討論專區
上一篇:人臉識別壓力測驗
