consul-replicate | Consul cross-DC KV replication daemon | Architecture library
kandi X-RAY | consul-replicate Summary
kandi X-RAY | consul-replicate Summary
This project provides a convenient way to replicate values from one Consul datacenter to another using the consul-replicate daemon. The daemon consul-replicate integrates with Consul to perform cross-data-center K/V replication. This makes it possible to manage application configuration from a central data center, with low-latency asynchronous replication to other data centers, thus avoiding the need for smart clients that would need to write to all data centers and queue writes to handle network failures.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of consul-replicate
consul-replicate Key Features
consul-replicate Examples and Code Snippets
Community Discussions
Trending Discussions on consul-replicate
QUESTION
I am trying to configure disaster recovery for my applications. And we have a stateful Consul, meaning there will be write operations on consul kv, which should be consistent across datacenters. In other words, if I do a write operation in dc1, and a read operation happens on dc2, I must get the latest value of that key. Here's my thought process: I am going to join two datacenters via wan join. Please note each datacenter has 4 servers. And any write operation on dc1 will be replicated to dc2 via consul-replicate tool. I tried ACL replication, but it seems complicated. I also searched online on consul-replicate configs example but could not find anything helpful. Can someone guide me towards the same? Thanks in advance.
...ANSWER
Answered 2021-Jan-15 at 07:28You can use consul-replicate
to keep KV data in sync between Consul data centers, but you'll want to keep a couple of things in mind about the setup.
Consul replicate uses blocking queries to watch for changes under the configured KV prefix. The way blocking queries work today is that if a single key is updated under your watched prefix, the blocking query will return the data for all keys under that prefix – even though only one key was updated – causing Consul replicate to PUT/update all watched keys in the remote DC. Depending on how many keys you are replicating, and how often those keys are updated, you may see higher bandwidth utilization and encounter performance issues.
In order to mitigate the performance concerns, you can run multiple consul-replicate
processes, each one responsible for replicating a specific, scoped prefix from the KV tree (e.g., /env/prod
and /env/dev
) instead of the entire tree. https://github.com/hashicorp/consul/issues/2791 is a feature request to improve the behavior of watch so it only returns data for changed keys instead of all keys being watched.
Also, Consul replicate does not provide the same data guarantees as Raft within a Consul cluster. By that I mean since the replication is external to Consul, when a user/service writes to a KV in DC1, there is no way for Consul to return an error if that KV has not been successfully replicated to DC2. Consul is completely unaware the data is being replicated at all. Replication performed by consul-replicate is async and essentially best effort.
As far as setting this all up, the README for Consul replicate is fairly detailed and provides an explanation of each of the available configuration options. I imagine minimal config for a consul-replicate daemon running in DC2 which is replicating from DC1 would probably look like this.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install consul-replicate
Download a pre-compiled, released version from the Consul Replicate releases page.
Extract the binary using unzip or tar.
Move the binary into $PATH.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page