问题描述
我们有一个旧的 zookeeper 3-cluster quorum,一些永久路由信息存储在 znodes/data 中.现在我们正在不同的数据中心设置另一个全新的 3 集群仲裁,我们希望将路由信息迁移到它.执行此操作的最佳可靠方法是什么?
We have an old zookeeper 3-cluster quorum, with some permanent routing info stored in znodes/data. Now we are setting up another brand new 3-cluster quorum on a different data center, and we want to migrate the routing info to it. What's the best reliable way to do this?
会简单的复制事务日志吗?还是用快照更好?或者是否有一些工具可以从旧 znode 中提取数据并将创建重播到新 znode 上?
Will simply copy the transaction log do?Or better with snapshot?Or if there are some tools to extract data from old znodes and replay creation onto the new ones?
找到类似问题,但没有回答最佳复制方式跨 2 个 zookeeper 集群的数据?
Similar question found, but not answered best way to copy data across 2 zookeeper cluster?
推荐答案
我知道几种方法,
一个是备份-恢复,即将zookeeper数据目录从一个集群复制到另一个集群,(每个节点的数据目录).事务日志不断被写入,因此这可能取决于您是否可以停止旧集群.备份明智它认为快照是要走的路.如果您的节点的数据在事务日志变大时,快照是时间点副本.我自己备份了epoch文件和快照文件.
One is the backup-restore, i.e. you copy the zookeeper data dir from one cluster to the other, (every nodes data dir). The transaction log is constantly being written to, so that might depend if you can stop your old cluster or not. Backup wise it think the snapshots are the way to go. The snapshots are point in time copies if your node's data when the transaction log grows to large. I myself backup the epoch files and snapshot files.
另一种方法是使用 zkcopy 在两个 zookeeper 集群之间复制数据.
Another way is to use zkcopy to copy data between two zookeeper clusters.
另一种方法是使用 exhibitor,但设置起来可能比其他两个要复杂一些方法.
Another way is to use exhibitor, but it might be a bit more complicated to setup than two other methods.
这篇关于将旧的zookeeper znode/data复制/迁移到新的zookeeper的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!