Elasticsearch:3.数据迁移

环境

[root@elasticsearch_cluster_test_01 ~]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)

elasticsearch-6.6.0.rpm

+ [email protected]

方法1:Elasticearch-Dump

https://github.com/taskrabbit/elasticsearch-dump

1.安装

npm install elasticdump -g
elasticdump

2.使用

1.同步tomcat-train_192.168.1.139-2019.05.01

#!/bin/bash
elasticdump \
  --input=http://192.168.50.13:9200/tomcat-train_192.168.1.139-2019.05.01 \
  --output=http://192.168.30.41:9200/tomcat-train_192.168.1.139-2019.05.01 \
  --type=analyzer
elasticdump \
  --input=http://192.168.50.13:9200/tomcat-train_192.168.1.139-2019.05.01 \
  --output=http://192.168.30.41:9200/tomcat-train_192.168.1.139-2019.05.01 \
  --type=mapping
elasticdump \
  --input=http://192.168.50.13:9200/tomcat-train_192.168.1.139-2019.05.01 \
  --output=http://192.168.30.41:9200/tomcat-train_192.168.1.139-2019.05.01 \
  --type=data

2.同步所有

#!/bin/bash
elasticdump \
  --input=http://192.168.50.13:9200/ \
  --output=http://192.168.30.41:9200/ \
  --all=true

你可能感兴趣的:(Elasticsearch:3.数据迁移)