ElasticSearch数据迁移

栏目: 后端 · 发布时间: 7年前

内容简介:使用安装使用参考:

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

安装 nodejs , npm 后使用 npminstallelasticdump - g 安装。

使用参考:

ES=http://search-es-0.search-es.app.svc.cluster.local:9200
ED=http://es-0.es.infra.svc.cluster.local:9200
 
for index in `curl -s -XGET $ES/_cat/indices?h=i`
do
    # settings, analyzer, data, mapping, alias, template
    echo "elasticdump --input=$ES/$index --output=$ED/$index"
    elasticdump --input=$ES/$index --output=$ED/$index --limit=10000 --type=settings --searchBody '{"query": { "match_all": {} }, "stored_fields": ["*"], "_source": true }'
    elasticdump --input=$ES/$index --output=$ED/$index --limit=10000 --type=analyzer --searchBody '{"query": { "match_all": {} }, "stored_fields": ["*"], "_source": true }'
    elasticdump --input=$ES/$index --output=$ED/$index --limit=10000 --type=alias --searchBody '{"query": { "match_all": {} }, "stored_fields": ["*"], "_source": true }'
    elasticdump --input=$ES/$index --output=$ED/$index --limit=10000 --type=template --searchBody '{"query": { "match_all": {} }, "stored_fields": ["*"], "_source": true }'
    elasticdump --input=$ES/$index --output=$ED/$index --limit=10000 --type=mapping --searchBody '{"query": { "match_all": {} }, "stored_fields": ["*"], "_source": true }'
    elasticdump --input=$ES/$index --output=$ED/$index --limit=10000 --type=data --searchBody '{"query": { "match_all": {} }, "stored_fields": ["*"], "_source": true }'
    echo ""
done

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

互联网+

互联网+

马化腾 / 中信出版社 / 2015-5-1 / CNY 58.00

中国进入新常态,李克强总理制定*“互联网+”行动计划以推动经济进一步发展,并认为站在“互联网+”风口顺势而为,可以使经济飞起来。 《互联网+:国家战略行动路线图》由“互联网+”理念的提出者于扬、*强有力推动者马化腾等创作。书稿从理论层面、实践经验等多个角度,结合当下各产业的现状、发展趋势,全方位进行阐述,以通俗易懂的文字将这一经济发展新引擎呈现出来,并对读者如何抓住新时期的机遇有切实的指导意......一起来看看 《互联网+》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

随机密码生成器
随机密码生成器

多种字符组合密码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换