0
我正在寻找将数据从1.x迁移到2.x elasticsearch的工具。请建议是否有任何可用的东西?将索引从elasticsearch 1.x迁移到elasticsearch 2.x的工具
我正在寻找将数据从1.x迁移到2.x elasticsearch的工具。请建议是否有任何可用的东西?将索引从elasticsearch 1.x迁移到elasticsearch 2.x的工具
您有几个选项。您可以以从旧1.x的ES指数复制到新2.X ES使用Logstash:
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]}"
}
}
您还可以使用elasticdump并使用以下命令从old-es:9200
复制source_index
您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
非常感谢@val ..你是惊人的.. :)我没有用elasticdump作为我的两个服务器是不同的网络中,并没有路由,所以我不能使用logstash。随着elasticdumnp我把转储文件,然后将文件转移到新的实例,并把转储在新的服务器。它工作完美..再次感谢 – user1819071
真棒,很高兴它帮助! – Val