best way to copy data across 2 zookeeper cluster?

依然范特西╮ 提交于 2019-12-01 21:16:46

问题


I have some zookeeper clusters on running, my goal is to combine data on these zk clusters onto one single zookeeper cluster.

So copy the whole data and log dir of one zk cluster to another zk cluster is not a possible approaching for me. And also, I might need to rebase one entire dir's path, for example, I might need to copy data for /service1 on zk cluster1 onto /c1/service1 on zk cluster 2

currently, I am doing this work by write some zk client code to read the entire dir tree with data and ACL info on zk cluster 1 and write it to zk cluster 2.

However, there are some issues remain with this approaching:

  1. Hard to determine which node is updated during the copy process.
  2. sequential node might be a problem, I can only write it as a normal non-sequential node, while for further creation of sequential node on the new cluster, since sequential node's sequence number is created according to parent node's Cversion info ( the code looks like this, but seems if some delete operation is done, the value will shift some ) , since I could not control the parent node's Cversion ( Can I ? ). If the Cversion is less than existing sequential node's sequence number ( this could happen since we do copy data onto new cluster and ignore the history operation ) the further creating of sequential node might lead to node.exist error.

So is there any better way to achieve my goal?


回答1:


You can use zkcopy to copy data between two zookeeper clusters.



来源:https://stackoverflow.com/questions/29617733/best-way-to-copy-data-across-2-zookeeper-cluster

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!