1.es数据备份、恢复
https://blog.csdn.net/andy_only/article/details/111319175
2.reindex命令
https://codeleading.com/article/40964498185/
添加配置、重启ES
cd bin
sh elasticsearch -d
3.开源工具
https://github.com/elasticsearch-dump/elasticsearch-dump
4.logstash
[work()@tjtxvm176-239-170 config]$ cd ..
[work()@tjtxvm176-239-170 logstash-5.6.16]$ sh ^C
[work()@tjtxvm176-239-170 logstash-5.6.16]$ ./bin/logstash -f config/logstash-es-migrate.conf 注意logstash 跟ES的匹配版本logstash-5.6.16 376,800,历时 3分20秒,1884每秒,3个小时能迁完bin/logstash -f config/logstash-sample.confinput{elasticsearch{# 源端地址hosts => ["http://source:9200"]# 安全集群配置登录用户名密码# user => "xxxx"# password => "xxxx"# 需要迁移的索引列表,以逗号分隔index => "omd_v6"# 以下三项保持默认即可,包含线程数和迁移数据大小和logstash jvm配置相关docinfo=>true# slices => 10# size => 200}
}filter {# 去掉一些logstash自己加的字段mutate {remove_field => ["@timestamp", "@version"]}
}output{elasticsearch{# 目的端es地址hosts => ["http://target:9200"]# 目的端索引名称,以下配置为和源端保持一致# index => "%{[@metadata][_index]}"index => "omd_v4"# 目的端索引type,以下配置为和源端保持一致document_type => "%{[@metadata][_type]}"# 目标端数据的_id,如果不需要保留原_id,可以删除以下这行,删除后性能会更好document_id => "%{[@metadata][_id]}"# ilm_enabled => false# manage_template => false}# 调试信息,正式迁移去掉# stdout { codec => rubydebug { metadata => true }}
}
https://www.elastic.co/guide/en/logstash/6.7/plugins-inputs-elasticsearch.html?spm=a2c4e.10696291.0.0.34dd19a4GGsCSh
https://bbs.huaweicloud.com/blogs/265963
https://www.51cto.com/article/704537.html
5.写程序
自由发挥
logstash效率最高(存在则就更新),elastcidump受限于node环境