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

es 迁移数据elasticdump工具的使用

root4年前 (2022-07-05)数据库1791

安装直接使用是可以,采用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

分享给朋友:

相关文章

dataX:超强的数据库数据互导工具

安装下载安装包http://datax-opensource.oss-cn-hangzhou.aliyuncs.com/datax.tar.gz 然后解压进入解压后文件的./bin自检命令python  datax.py ../j...

centos7 安装mysql

centos7 安装mysql

下载rpm包wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm 安裝包仓库yum -y install * 或者yum -...

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

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

清空postgresql的缓存

系统:centos,版本:postgresql-9.6因为要测试postgresql的性能,当多次查询的时候查询结果会因为缓存用时很短,不能模拟出现实使用的场景。因此需要清除缓存。首先stop掉postgresqlsystemctl sto...

centos7 快速搭建 mysql

https://blog.csdn.net/qq_36582604/article/details/80526287...

mysql 重置表

truncate table 表名...