开源工具地址: https://github.com/taskrabbit/elasticsearch-dump

查看所有index
线上 curl ‘10.0.12.100:6335/_cat/indices?v’

同步mytestindex从线上环境到测试环境

导出map
elasticdump \
--input=http://10.0.12.100:9200/mytestindex \
--output=./mytestindex.map \
--type=mapping
导出数据
elasticdump \
--input=http://10.0.12.100:9200/mytestindex \
--output=./mytestindex.json

导入map
elasticdump –input=./mytestindex.map –output=http://10.1.1.246:9200/mytestindex –type=mapping

导入数据
elasticdump \
–input=./mytestindex.json \
–output=http://10.1.1.246:9200/mytestindex –limit 1000