Elasticsearch必备技能之索引迁移
将ES中的索引拷贝到其他ES中,是不是很重要呢?
长话短说,推荐一个工具:
一、elasticsearch-dump
安装:
#yum install epel-release
#yum install nodejs
#yum install npm
#npm install elasticdump
#cd node_modules/elasticdump/bin
# pwd
/home/tp/node_modules/elasticdump
# 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 ! 迁移成功。
推荐阅读:
加微信:wonter 发送:技术Q
医疗微信群:
加微信:wonter 发送:医疗Q
更多文章关注公众号:

【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】