Elasticsearch怎么备份和迁移数据

1、我的Elasticsearch集群怎么做数据的备份,因为我想删除不用的索引,之前的冷数据,但是我又希望以后有需求的时候可以用,所以需要做备份的方案?   2、做迁移,我怎么把我一个ES集群的数据迁移到另外一个集群中去?
已邀请:

OpenSkill - OpenSkill官方账号

赞同来自: Ansible henry

关于问题一,做数据备份
做数据备份可以利用ES的快照的方式来做,首先创建一个仓库,然后利用快照放到共享数据仓库里面去。具体可以参考官网:https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html ,https://www.elastic.co/guide/en/elasticsearch/guide/current/_restoring_from_a_snapshot.html
 
关于问题二,做数据迁移:
1、可以利用备份、恢复上面讲的利用快照的方法,仓库一定要是共享存储,然后在恢复到新的集群
 
2、利用开源工具elasticdump,具体参考:http://stackoverflow.com/questions/26547560/how-to-move-elasticsearch-data-from-one-server-to-another 
Use ElasticDump

1) yum install epel-release

2) yum install nodejs

3) yum install npm

4) npm install elasticdump

5) cd node_modules/elasticdump/bin
./elasticdump \

--input=http://192.168.1.1:9200/original \

--output=http://192.168.1.2:9200/newCopy \

--type=data

空心菜 - 心向阳光,茁壮成长

赞同来自: henry

elasticdump \ --input=http://localhost:9700/.kibana \ --output=http://localhost:9700/.kibana_read_only \ --type=mapping 
 
elasticdump \ --input=http://localhost:9700/.kibana \ --output=http://localhost:9700/.kibana_read_only \ --type=data
 

要回复问题请先登录注册