Giter Site home page Giter Site logo

Comments (3)

blake avatar blake commented on June 17, 2024

Hi @mssawant, this is expected behavior. Consul replicate will synchronize the specified KV path from the source to the destination. Keys which exist at the destination but do not exist at the source will be deleted (similar to rsync's --delete flag).

You can exclude specific keys/prefixes from replication (and hence deletion on the dst) by using the -exclude flag at the CLI, or exclude key in the configuration file.

from consul-replicate.

mssawant avatar mssawant commented on June 17, 2024

Okay, I am getting what I want if I specify the absolute key name in exclude but not if I specify just the prefix,

consul kv get -datacenter=dc1 -recurse proc/
proc/1:online
proc/2:online

consul kv get -datacenter=dc2 -recurse proc/
proc/3:online
proc/4:
./consul-replicate -exclude="proc/1" -exclude="proc/2" -prefix "proc/@dc2" -once
consul kv get -recurse proc/
proc/1:online
proc/2:online
proc/3:online
proc/4:online

consul kv delete proc/3
Success! Deleted key: proc/3
consul kv delete proc/4
Success! Deleted key: proc/4
consul kv get -recurse proc/
proc/1:online
proc/2:online
./consul-replicate -exclude="proc/" -prefix "proc/@dc2" -once
consul kv get -recurse proc/
proc/1:online
proc/2:online

But I think the behavior's as expected. Just that I have a hybrid use case where I divide my cluster in multiple datacenters and need certain level of redundancy between the data centers maintaining their local keys.
Good that there's a workaround, thanks @blake.

from consul-replicate.

blake avatar blake commented on June 17, 2024

I'm glad you have a workable solution. Do you mind if I close this issue?

from consul-replicate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.