ElasticSearch数据迁移

检查集群状态

curl -u elastic:4uEu8qncFUpp http://192.168.2.21:9200/_cat/nodes
192.168.2.23 14 68 0 0.00 0.21 0.17 dm * rke03
192.168.2.21 14 69 0 0.06 0.22 0.16 dm - rke01
192.168.2.22 13 66 0 0.04 0.20 0.15 dm - rke02

查询索引

curl -u elastic:4uEu8qncFUpp http://192.168.2.21:9200/_cat/indices?v
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size dataset.size

导出索引

docker run --net host -v /tmp:/tmp --rm -ti elasticdump/elasticsearch-dump:v6.115.0 --input=http://elastic:pY4dH7hJ6sE8cI7m@172.22.152.6:9200/kb67469eb7a511463d5c300307/  --output=/tmp/kb67469eb7a511463d5c300307_mapping.json --type=mapping

导出数据

docker run --net host -v /tmp:/tmp --rm -ti elasticdump/elasticsearch-dump:v6.115.0 --input=http://elastic:pY4dH7hJ6sE8cI7m@172.22.152.6:9200/kb67469eb7a511463d5c300307/  --output=/tmp/kb67469eb7a511463d5c300307.json --type=data

导入索引

docker run --net host -v /tmp:/tmp --rm -ti elasticdump/elasticsearch-dump:v6.115.0 --output=http://elastic:4uEu8qncFUpp@192.168.2.21:9200/kb67469eb7a511463d5c300307/  --input=/tmp/kb67469eb7a511463d5c300307_mapping.json --type=mapping

导入数据

docker run --net host -v /tmp:/tmp --rm -ti elasticdump/elasticsearch-dump:v6.115.0 --output=http://elastic:4uEu8qncFUpp@192.168.2.21:9200/kb67469eb7a511463d5c300307/  --input=/tmp/kb67469eb7a511463d5c300307.json --type=data

检查迁移的数据

curl -u elastic:4uEu8qncFUpp "http://192.168.2.21:9200/_cat/indices?v&pretty"
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size dataset.size
green open kb67469eb7a511463d5c300307 hirEEBPfSOSRjBOfVRsHuw 1 1 498 0 1.1mb 571.3kb 571.3kb
文章作者: 慕容峻才
文章链接: https://www.acaiblog.top/ElasticSearch数据迁移/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 阿才的博客
微信打赏
支付宝打赏