elasticsearch數據遷移——elasticsearch-dump使用


先安裝好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來導出數據,成功:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM