10 月 112016
 

参考url:http://manbusky.com/elasticsearch-data-transfer/

最近服务器架构扩展,涉及到 elasticsearch 的数据迁移问题,直接拷贝 {elastic_root}/data/ 目录下的数据显得过于笨拙,或者也不太可行?具体没有尝试!接着发现一个神奇的工具:elasticdump,竟然还是用 node 写的,真是太赞了!!!

elasticdumpGithub上的地址:https://github.com/taskrabbit/elasticsearch-dump

本地全局安装方法:

npm install elasticdump -g  

迁移analyzer

elasticdump \  
  --input=http://production.es.com:9200/index_name \
  --output=http://new_production.es.com:9200/index_name\
  --type=analyzer

迁移mapping

elasticdump \  
  --input=http://production.es.com:9200/index_name \
  --output=http://new_production.es.com:9200/index_name \
  --type=mapping

迁移data

elasticdump \  
  --input=http://production.es.com:9200/index_name \
  --output=http://new_production.es.com:9200/index_name \
  --type=data

支持本地文件的 dump,方便传输;还有带 querydump!赞得稀里糊涂,2 分钟搞定了,把我感动哭了都~~~

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny