docker-consul
docker-consul copied to clipboard
Can we have a persistent storage for the key-value store?
I know that with consul we have fault tolerance, but there maybe a possibility where all my consul servers are going down together. Then in that scenario, I will loose all the configuration I have stored in the K/V store.
Does the -v /mnt:/data also gives persistence to the data in my K/V store?
Is there any update for this question.
Mounting a host volume in as the /data
directory will persist the data when consul is restarted in a rolling fashion. The key-value data is persisted in this directory; the details are mentioned in https://groups.google.com/forum/#!msg/consul-tool/QHA_t9DR5LQ/gPitNrlvIwAJ
As you know, consul can get into a broken state when servers are not restarted in a rolling fashion. This is the behavior of consul itself, and not particular to this image, so in performing outage recovery, consult the guide at https://www.consul.io/docs/guides/outage.html
The google groups thread I linked above includes some comments/recommendations on the topic of backing up the K/V store, and when this is relevant/recommended.
In any case, the immediate answer is: yes, your K/V data is persisted in the data directory, so if you would like it to be persistent across several containers, use a shared volume of some sort.
Can this /data volume info be added to a README.md somewhere?