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