zookeeper数据迁移方法
有一个好用的开源zkcopy,直接搞定。
git clone https://github.com/kshchepanovskyi/zkcopy.git
介绍:
zkcopy
Tool for fast copying ZooKeeper data between different clusters.
Optimized for copying big volumes of data over WAN.
Build
Requires apache maven 3.
mvn clean install
Usage
java -Dsource="server:port/path" \
-Ddestination="server:port/path" \
-Dthreads=10 \
-DremoveDeprecatedNodes=true \
-jar target/zkcopy-*-jar-with-dependencies.jar
If using docker then:
docker pull kshchepanovskyi/zkcopy
docker run --rm -it kshchepanovskyi/zkcopy \
-Dsource="server:port/path" \
-Ddestination="server:port/path" \
-Dthreads=10 \
-DremoveDeprecatedNodes=true
source
- set source cluster address and root node to be copieddestination
- set target cluster address and root node location where to
copy datathreads
- specify number of parallel workers. If latency is
high, then increasing this number might significantly improve performanceremoveDeprecatedNodes
- set it totrue
to remove nodes that are
present ondestination
but missing onsource
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步