一.首先安装
Installing
(local)
npm install elasticdump
./bin/elasticdump
(global)
npm install elasticdump -g
elasticdump
二.拷贝
Copy an index from production to staging with analyzer and mapping:
elasticdump
–input=http://production.es.com:9200/my_index
–output=http://staging.es.com:9200/my_index
–type=analyzer
elasticdump
–input=http://production.es.com:9200/my_index
–output=http://staging.es.com:9200/my_index
–type=mapping
elasticdump
–input=http://production.es.com:9200/my_index
–output=http://staging.es.com:9200/my_index
–type=data
Backup index data to a file:
elasticdump
–input=http://production.es.com:9200/my_index
–output=/data/my_index_mapping.json
–type=mapping
elasticdump
–input=http://production.es.com:9200/my_index
–output=/data/my_index.json
–type=data
如果报错索引已存在则删除原索引
curl -XDELETE http://production.es.com:9200/my_index