简体   繁体   English

将索引从Elasticsearch 1.x迁移到Elasticsearch 2.x的工具

[英]Tools to migrate index from elasticsearch 1.x to elasticsearch 2.x

I am looking for the tools to migrate data from 1.x to 2.x elasticsearch. 我正在寻找将数据从1.x迁移到2.x elasticsearch的工具。 Please suggest if anything is available? 请建议是否有可用的东西?

You have a few options. 您有几种选择。 You can use Logstash in order to copy indices from your old 1.x ES to your new 2.x ES: 您可以使用Logstash来将索引从旧的1.x ES复制到新的2.x ES:

input {
  elasticsearch {
   hosts => ["old-es:9200"]                     <--- source ES host
   index => "source_index"                      <--- source index to copy
   docinfo => true
  }
}
filter {
 mutate {
  remove_field => [ "@version", "@timestamp" ]  <--- remove added junk
 }
}
output {
 elasticsearch {
   hosts => ["new-es:9200]"                     <--- target ES host
   index => "%{[@metadata][_index]}"
   document_type => "%{[@metadata][_type]}"
   document_id => "%{[@metadata][_id]}"
 }
}

You can also use elasticdump and use the following commands to copy source_index from old-es:9200 to your new-es:9200 host: 您还可以使用elasticdump并使用以下命令将source_indexold-es:9200复制到您的new-es:9200主机:

elasticdump \
  --input=http://old-es:9200/source_index \
  --output=http://new-es:9200/source_index \
  --type=analyzer
elasticdump \
  --input=http://old-es:9200/source_index \
  --output=http://new-es:9200/source_index \
  --type=mapping
elasticdump \
  --input=http://old-es:9200/source_index \
  --output=http://new-es:9200/source_index \
  --type=data

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM