es数据迁移

使用elasticsearch-migration进行数据迁移

elasticsearch-migration支持:多个版本间的数据迁移,使用scroll+bulk的接口原理


安装

elasticsearch-migration支持linux,windows等不同系统,下载解压后可以直接运行

源码地址:https://github.com/medcl/esm 编译好的地址:https://github.com/medcl/elasticsearch-dump/releases


使用

使用示例

./esm -s http://IP:9200 -d http://IP:9200/ -x 索引名称 -w=5 -b=10 -c 10000
主要几个参数:
索引名称可以使用*进行模糊匹配

-w 表示线程数

-b 表示一次bulk请求数据大小,单位MB默认 5M

-c 一次scroll请求数量

如果错误,可查看es日志。内存溢出时,适当调小参数继续尝试一下