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

es 迁移数据elasticdump工具的使用

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

安装直接使用是可以,采用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://www.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 导出csv格式数据

mysql -e "select * from newsdb.t_hk_stock_news where id <100  ...

postgresql 导入导出sql 文件

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

centos7 安装mysql

centos7 安装mysql

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

清空postgresql的缓存

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

postgresql 查看数据库、表的大小

查看数据库的大小 select pg_database_size('test'); select pg_size_pretty(pg_database_size('test');查看单...