ELK elasticsearch数据迁移


因elasticsearch 集群中有需要需迁移,从A集环境迁移到B集群中,数据量不小。

网上搜索找到几种方案,试了下这种。

0.安装nodejs(如果已安装请忽略)
执行

yum install -y nodejs

 

1.升级nodejs
执行

npm install -g n
n latest

 

2.安装elasticdump工具
执行

npm install elasticdump -g

 

3.迁移指定索引的settings,mapping,data
执行索引复制

索引名称
my_video_index

复制到

依次复制 :设置settings,映射mapping,数据data

其中地址信息

http://elastic:elastic@192.168.89.181:9200/my_video_index

http://用户名:密码@IP地址:端口/索引
复制到
http://elastic:elastic@192.168.89.180:9202/my_video_index_dump
elasticdump --input=http://elastic:elastic@192.168.89.181:9200/my_video_index --output=http://elastic:elastic@192.168.89.180:9202/my_video_index_dump --type=settings
elasticdump --input=http://elastic:elastic@192.168.89.181:9200/my_video_index --output=http://elastic:elastic@192.168.89.180:9202/my_video_index_dump --type=mapping
elasticdump --input=http://elastic:elastic@192.168.89.181:9200/my_video_index --output=http://elastic:elastic@192.168.89.180:9202/my_video_index_dump --type=data

执行完成后。

通过kibana查询到_dump的信息

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM