https://www.cnblogs.com/mojita/p/12011800.html
$ docker pull taskrabbit/elasticsearch-dump
下面還是例子:通過(guò)鏡像導(dǎo)出數(shù)據(jù)到本地
創(chuàng)建一個(gè)文件夾用于保存導(dǎo)出數(shù)據(jù)
$ mkdir -p /root/data
第一種方式:也是本次在線(xiàn)遷移方式
docker run --rm -ti taskrabbit/elasticsearch-dump
--limit=20000
--input=http://192.168.0.3:9200/index_usr
--output=http://188.116.31.49:9200/index_usr
--type=mapping
docker run --rm -ti taskrabbit/elasticsearch-dump
--limit=20000
--input=http://192.168.0.3:9200/index_usr
--output=http://188.116.31.49:9200/index_usr
--type=data
docker run --rm -ti taskrabbit/elasticsearch-dump
--limit=20000
--input=http://192.168.0.3:9200/sjzt_userinfo_index
--output=http://188.116.31.49:9200/sjzt_userinfo_index
--type=mapping
docker run --rm -ti taskrabbit/elasticsearch-dump
--limit=20000
--input=http://192.168.0.3:9200/sjzt_userinfo_index
--output=http://188.116.31.49:9200/sjzt_userinfo_index
--type=data
docker run --rm -ti taskrabbit/elasticsearch-dump
--limit=20000
--input=http://192.168.0.3:9200/index_event_all
--output=http://188.116.31.49:9200/index_event_all
--type=mapping
docker run --rm -ti taskrabbit/elasticsearch-dump
--limit=20000
--input=http://192.168.0.3:9200/index_event_all
--output=http://188.116.31.49:9200/index_event_all
--concurrency=2
--type=data
第二種方式:
也可以先dump成json文件箱叁,再傳到目標(biāo)es上抠璃,再導(dǎo)入
導(dǎo)出mapping
$ docker run --rm -ti -v /data:/tmp taskrabbit/elasticsearch-dump
--input=http://production.es.com:9200/my_index
--output=/tmp/my_index_mapping.json
--type=mapping
導(dǎo)出(data)
$ docker run --rm -ti -v /root/data:/tmp taskrabbit/elasticsearch-dump
--input=http://192.168.56.104:9200/test_index
--output=/tmp/elasticdump_export.json
--type=data
導(dǎo)入目標(biāo)es數(shù)據(jù)
創(chuàng)建索引
$ curl -XPUT http:192.168.56.104:9200/test_index
因?yàn)閷?dǎo)入的是mapping,所以設(shè)置type為mapping
$ docker run --rm -ti -v /data:/tmp taskrabbit/elasticsearch-dump \
--input ./test_index_mapping.json \
--output http://192.168.56.105:9200/ \
--type=mapping
因?yàn)閷?dǎo)入的是data(真實(shí)數(shù)據(jù))所以設(shè)置type為data
$ docker run --rm -ti -v /data:/tmp taskrabbit/elasticsearch-dump \
--input ./test_index.json \
--output http://192.168.56.105:9200/ \
--type=data