2024年最新Elasticsearch Dump的详细安装和迁移es索引和数据的使用教程(3),2024年最新食堂大妈看完都学会了

img
img

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化资料的朋友,可以戳这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

打开终端或命令行界面, 运行以下命令来全局安装Elasticsearch Dump:

  npm install elasticdump -g

在这里插入图片描述

3. 使用Elasticsearch Dump导出索引结构

Elasticsearch Dump支持导出和导入索引的映射(mapping)和设置(settings)

3.1 导出索引设置(settings)

elasticdump --input=http://localhost:9200/my_index --output=/path/to/exported_settings.json --type=settings

这将导出"my_index"索引的设置,并保存到指定的JSON文件中。

示例:

elasticdump --input=http://192.168.0.221:11700/cnoa_data_1987051001 --output=E:/elatic_dump/cnoa_data_1987051001_settings.json --type=settings

在这里插入图片描述

3.2 导出索引映射(mapping)

elasticdump --input=http://localhost:9200/my_index --output=/path/to/exported_mapping.json --type=mapping

这将导出"my_index"索引的映射,并保存到指定的JSON文件中

示例:

elasticdump --input=http://192.168.0.221:11700/cnoa_data_1987051001 --output=E:/elatic_dump/cnoa_data_1987051001_mapping.json --type=mapping

在这里插入图片描述

3.3 导入索引设置(settings)

elasticdump --input=/path/to/exported_settings.json --output=http://localhost:9200/new_index --type=settings

这将导入先前导出的设置数据到"new_index"索引中。

示例:

elasticdump --input=E:/elatic_dump/cnoa_data_1987051001_settings.json --output=http://localhost:9200/zhouquan_index --type=settings

在这里插入图片描述
注意:此操作会创建新的es索引并设置settings
在这里插入图片描述

3.4 导入索引映射(mapping)

elasticdump --input=/path/to/exported_mapping.json --output=http://localhost:9200/new_index --type=mapping

这将导入先前导出的映射数据到"new_index"索引中。

示例:

elasticdump --input=E:/elatic_dump/cnoa_data_1987051001_mapping.json --output=http://localhost:9200/zhouquan_index --type=mapping

在这里插入图片描述

4. 导出index

4.1 导出索引(index)

elasticdump --input=http://192.168.0.1:9200/data --output=D:/duoyuan/testenv_bak/data_index.json --type=index

这将data索引导出到本地data_index.json中

示例:

elasticdump --input=http://192.168.0.1:9200/zkcx_data_1987051001 --output=D:/duoyuan/testenv_bak/zkcx_data_1987051001_index.json --type=index

在这里插入图片描述

4.2 导入索引(index)

elasticdump --input=D:/duoyuan/zkcx_datacenter_data_index.json --output=http://192.168.0.1:9700/zkcx_data_1987051001 --type=index 

这将本地data_index.json索引文件导入到192.168.0.1:9700/zkcx_data_1987051001的索引中

示例:

elasticdump --input=D:/duoyuan/zkcx_datacenter_data_index.json --output=http://192.168.0.1:9700/zkcx_data_1987051001 --type=index 

在这里插入图片描述

5. 使用Elasticsearch Dump导出数据

在终端或命令行界面中,可以使用以下命令导出Elasticsearch索引中的数据:

elasticdump --input=http://your_elasticsearch_host:9200/your_index_name --output=/path/to/output_file.json --type=data

img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

需要这份系统化资料的朋友,可以戳这里获取

入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!**

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

需要这份系统化资料的朋友,可以戳这里获取

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值