先安裝好nodejs和nodejs的包管理工具npm。然后安裝elasticsearch-dump:
npm install elasticdump
下面遷移數據:
先在目的地址創建一個index來儲存數據:
curl -X PUT 'localhost:9200/customer?pretty'
執行遷移命令:--input設置導出的源地址,--output設置導出的目的地址
'#拷貝analyzer如分詞 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
這里我們指定--type=data來導出數據,成功:

