Elasticdump 备份与恢复es数据

数据备份

导出索引的mapping到本地

[root@test]# elasticdump --input=http://127.0.0.1:9200/test_event  --output=/opt/test_event_mapping.json --type=mapping 

导出索引到另外一个集群

[root@test]# elasticdump --input=http://127.0.0.1:9200/test_event   --output=http://127.0.0.2:9200/test_event --type=mapping\

导出索引数据到本地

[root@test]# elasticdump --input=http://127.0.0.1:9200/test_event  --output=/opt/data.json --type=data

导出索引数据到另外一个集群

[root@test]# elasticdump --input=http://127.0.0.1:9200/test_event   --output=http://127.0.0.2:9200/test_event --type=data

数据恢复

恢复mapping

[root@test]# elasticdump --input=/opt/test_event_mapping.json --output http://127.0.0.1:9200/ --type=mapping

恢复数据

[root@test]# elasticdump --input=/opt/data.json    --output=http://127.0.0.1:9200/test_event    --type=data
posted on 2023-09-19 17:56  每天进步一点点点点点  阅读(190)  评论(0编辑  收藏  举报