微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

迁移ElasticSearch老集群中的数据到新集群

思路:在网上查找迁移方法,发现elasticdump工具可以实现数据迁移,故安装测试。在一台能够同时访问新老集群的Windows电脑中安装elasticdump工具,然后执行命令即可,具体步骤如下:

1、安装npm工具

百度搜索windows安装nodejs,到官网上下载即可,注意按笔记本的系统版本和位数选择下载的版本即可。

http://nodejs.cn/download/

2、安装elasticdump

直接使用命令安装即可

npm install elasticdump -g

3、执行数据迁移

直接在cmd命令行的窗口执行命令。

注意修改新旧集群的ip地址、端口、index名称

先迁移mapping,再迁移数据

迁移Mapping信息 
elasticdump --ignore-errors=true  --scrollTime=120m  --bulk=true --input=http://老集群ip地址:9200/test_ryjbxx   --output=http://新集群ip地址:9200/test_ryjbxx  --type=mapping 
   
迁移数据
elasticdump --ignore-errors=true  --scrollTime=120m  --bulk=true --input=http://老集群ip地址:9200/test_ryjbxx    --output=http://新集群ip地址:9200/test_ryjbxx --type=data 

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐