Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Consul persist the Key Value store?

Tags:

I'm evaluating a few distributed key-value stores, and etcd and Consul looks both very promising. I am interested in service discovery, health monitoring and config services.

I like the extra features that Consul gives, but I cannot determine whether it persists the Key-Value store when the service goes down? It seems that etcd offers persistence. Any advice?

like image 867
Pieter Avatar asked Jun 12 '15 11:06

Pieter


People also ask

Is Consul a key value store?

In addition to providing service discovery, integrated health checking, and securing network traffic, Consul includes a key value store, which you can use to dynamically configure applications, coordinate services, manage leader election, or serve as a data backend for Vault, along with a myriad of other uses.

Where is Consul data stored?

The Consul KV datastore is located on the servers, but can be accessed by any agent (client or server). The natively integrated RPC functionality allows clients to forward requests to servers, including key/value reads and writes.

What is Consul key value?

It is a service mesh solution that provides full featured control plane with DNS-based service discovery and distributed key-value storage, segmentation and configuration and can be used individually or together to build a full service mesh. What is consul's KV store ?


2 Answers

Consul agents (cilent & server) persist data into data-dir.

The only case where agent doesn't persist data is where its started in "-dev" mode.

like image 96
Mistriel Avatar answered Oct 15 '22 00:10

Mistriel


I ended up running the progrium/docker-consul image on Docker and adding some key-value pairs. After shutting it down with Ctrl-C, the values were still there when I restarted the container. I also killed Consul from the command line via docker exec, and the data was also persisted.

The progrium/docker-consul image persisted all the data in the /data directory.

like image 20
Pieter Avatar answered Oct 15 '22 01:10

Pieter