zookeeper資料遷移方法
阿新 • • 發佈:2019-02-02
有一個好用的開源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
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
true
to remove nodes that are
present ondestination
but missing onsource