当前位置:首页 > 数据库 > 正文内容

es 迁移数据elasticdump工具的使用

root3年前 (2022-07-05)数据库1271

安装直接使用是可以,采用docker进行迁移也是可以的,我这边采用的是docker

导出数据为json文件

docker run --rm -ti -v /tmp:/tmp registry.baidubce.com/gitee-dev/elasticsearch-dump \
  --input=http://10.0.0.66:30920/index_v1 \
  --output=/root/cjm/index_v1.json \
  --type=data


导出索引的mapping

docker run --rm -ti -v /tmp:/tmp registry.baidubce.com/gitee-dev/elasticsearch-dump \
  --input=http://10.0.0.143:8201/bindex_v1 \
  --output=/tmp/index_v1_mapping.json \
  --type=mapping


迁移索引的别名

docker run --rm -ti -v /tmp:/tmp registry.baidubce.com/gitee-dev/elasticsearch-dump \
  --input=http://192.168.8.38:8200/index_v1\
  --output=http://192.168.8.38:9200/index_v1\
  --type=alias

文件格式跟地址是可以互换的。也就是输入或者输出为json文件或者为目标es库


迁移查询的数据

docker run  -ti -v /tmp:/tmp registry.baidubce.com/gitee-dev/elasticsearch-dump \
  --input=http://10.0.0.143:8200/index_v1 \
  --output=http://10.0.0.5:32067/index_v1 \
  --searchBody="{\"query\": {\"range\": {\"insert_time.keyword\": {\"from\": \"2022-03-01 00:00:00\",\"to\": \"2022-04-01 00:00:00\"}}}}" \
  --type=data


超全的使用方法:https://blog.csdn.net/lililidahaoren/article/details/124385427



扫描二维码推送至手机访问。

版权声明:本文由一叶知秋发布,如需转载请注明出处。

本文链接:https://zhiqiu.top/?id=229

分享给朋友:

相关文章

mysql启动失败 日志InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 3485

mysql报错Ignoring the redo log due to missing MLOG_CHECKPOINT betweenmysql版本:5.7.33系统版本:ubuntu16.04由于电脑突然关闭,跑在VMware里面的mys...

电脑断电导致mysql不可用,删除ib_logfile0和ib_logfile1恢复

mysql安装在虚拟机中,公司突然断电导致mysql启动失败查看mysql的error日志2021-05-19T06:44:51.993300Z 0 [ERROR] InnoDB: Ignoring the redo log due to...

postgresql 导入导出sql 文件

pg_dump  -h localhost -U postgres -t tablename databasename >./test.sql导出 -t 表名  psql -d test1 -U...

postgresql 的安装使用

安装centos系统 9.6版本# Install the repository RPMsudo yum install -y https://download.postgresql.org/pub/repos/yum/repor...

postgresql修改数据存储位置

postgresql修改数据存储位置

最近公司提供了一台新的服务器,同时有一个盘是ssd。同时为了测试postgresql的性能,将数据放置到ssd上系统centos7.9 数据库postgresql-9.6首先停掉数据库systemctl stop pos...

被Navicat坑哭的日常,版本问题

mysql5.7DROP TABLE IF EXISTS `xxx_copy1`;CREATE TABLE `xxx_copy1`  (  `id` int(11) UNSIGNED NOT NULL AUTO_INCR...