Elasticsearch必备技能之索引迁移

将ES中的索引拷贝到其余ES中,是否是很重要呢?node

长话短说,推荐一个工具:git

1、elasticsearch-dump

安装:github

#yum install epel-releasenpm

#yum install nodejsjson

#yum install npm微信

#npm install elasticdump架构

#cd node_modules/elasticdump/bin app

# pwd负载均衡

/home/tp/node_modules/elasticdumpelasticsearch

# ls -al

total 388

drwxr-xr-x 2 root root 4096 Mar 21 15:46 bin

-rw-r--r-- 1 root root 174 Mar 18 2016 Dockerfile

-rw-r--r-- 1 root root 299251 Mar 15 2014 elasticdump.jpg

-rw-r--r-- 1 root root 6172 Feb 2 23:47 elasticdump.js

drwxr-xr-x 2 root root 4096 Jul 13 2016 .github

drwxr-xr-x 3 root root 4096 Mar 21 15:46 lib

-rw-r--r-- 1 root root 11356 May 22 2014 LICENSE.txt

drwxr-xr-x 10 root root 4096 Mar 21 15:46 node_modules

-rw-r--r-- 1 root root 44 May 22 2014 .npmignore

-rw-r--r-- 1 root root 15135 Mar 21 15:46 package.json

-rw-r--r-- 1 root root 13335 Dec 14 06:20 README.md

drwxr-xr-x 3 root root 4096 Mar 21 15:46 test

-rw-r--r-- 1 root root 1150 Dec 2 07:54 .travis.yml

 

使用:

#拷贝analyzer如分词

elasticdump \

  --input=http://production.es.com:9200/old_index \

  --output=http://staging.es.com:9200/new_index \

  --type=analyzer

#拷贝映射

elasticdump \

  --input=http://production.es.com:9200/old_index \

  --output=http://staging.es.com:9200/new_index \

  --type=mapping

#拷贝数据

elasticdump \

  --input=http://production.es.com:9200/lod_index \

  --output=http://staging.es.com:9200/new_index \

  --type=data

 

OK ! 迁移成功。

 

 

推荐阅读:

微信支付开发中几个值得注意的地方

解析:微服务的原则

老王讲架构:负载均衡

支付宝系统架构内部剖析

SaaS技术栈的走势

大数据Spark与Storm技术选型

相关文章
相关标签/搜索