网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事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
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!**
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新