GitHub - dobbbb/tool: 用go实现的实用工具集
同集群不同索引全量对比:
./tool compare \
-a http://127.0.0.1:9200 -u username -p password -i index \
-I index1 \
-s 4000 \
-S 8
不同集群索引全量对比,对比过程中自动reindex不一致数据:
./tool compare \
-a http://127.0.0.1:9200 -u username -p password -i index \
-H http://0.0.0.0:9200 -U username1 -P password1 -I index1 \
-s 4000 \
-S 8 \
-r true
对比指定条件数据:
./tool compare \
-a http://127.0.0.1:9200 -u username -p password -i index \
-H http://0.0.0.0:9200 -U username1 -P password1 -I index1 \
-s 4000 \
-q '{"query":{"terms":{"id":["1715478400352693852"]}}}'
根据order_time分10段并发对比:
./tool compare \
-a http://127.0.0.1:9200 -u username -p password -i index \
-H http://0.0.0.0:9200 -U username1 -P password1 -I index1 \
-s 4000 \
-f order_time \
-c 10
tool compare -h 查看帮助
Flags:
-a, --srcHost string Source ES host: http//ip:port
-i, --srcIndex string Source ES index
-p, --srcPassword string Source ES password
-u, --srcUserName string Source ES userName
-A, --dstHost string Destination ES host: http//ip:port, default same as srcHost.
-I, --dstIndex string Destination ES index, It should be different from srcIndex when dstHost is same as srcHost.
-P, --dstPassword string Destination ES password, default same as srcPassword.
-U, --dstUserName string Destination ES userName, default same as srcUserName.
-s, --size int Batch size (default 1000)
-S, --slices int Scroll slices, suggest to use the same number of shards (default 1)
-f, --field string Custom concurrency field (default "order_time")
-c, --concurNum int Number of custom concurrency queries (default 1)
-q, --query string Query body
-r, --repair Auto repair
-h, --help help for compare