当前位置: 首页 > news >正文

ElasticSearch迁移数据

一、查询索引

         1、查询所有索引

curl --user elastic:123456 -XGET "http://localhost:19200/_cat/indices?v&s=index"

          2、查询索引配置

以索引名称hello为例

curl --user elastic:123456 -XGET "http://localhost:19200/hello/_settings?pretty"

          3、查询字段映射

curl --user elastic:123456 -XGET "http://localhost:19200/hello/_mapping?pretty"

二、同集群迁移

curl --user elastic:123456  -H "Content-Type: application/json"  -XPUT "http://localhost:19200/_reindex?wait_for_completion=false" -d'
{
    "source": { "index": "source_index" },
    "dest": { "index": "target_index" }
}'

三、跨集群迁移

         1、在目标集群配置白名单

           vi  elasticsearch.yml

reindex.remote.whitelist:  ["remote_es:19200"]

           重启目标集群节点 使配置生效。 

          2、执行跨集群迁移

curl --user elastic:123456  -H "Content-Type: application/json"  -XPUT "http://localhost:19200/_reindex" -d'
{
  "source": {
    "remote": {
      "host": "http://remote_es:19200",
      "username": "source_user",
      "password": "source_password"
    },
    "index": "remote_index",
    "size": 5000
  },
  "dest": { "index": "local_index" }
}'

http://www.dtcms.com/a/120202.html

相关文章:

  • “剪贴板劫持“攻击:黑客利用虚假验证码通过入侵网站窃取数据
  • 自动化框架及其设计搭建浅谈(三)--自动化测试框架设计最佳实践
  • Elasticearch数据流向
  • Qt添加资源文件
  • APP应用为什么要选择使用游戏盾?从攻防本质到技术突围
  • 6.2 利用yaml进行参数的保存
  • PEM格式证书 = 域名证书.crt + 根证书(root_bundle).crt 含义解析
  • Linux(CentOS10) gcc编译
  • 大疆无人机系列知识
  • HTTP 308 错误永久重定向 (Permanent Redirect)
  • Java BigInteger 详解
  • 从云计算到算网融合:未来已来的算力革命
  • 416. 分割等和子集
  • 【WebRTC】开源项目Webrtc-streamer介绍
  • gbase8s之逻辑导出导入脚本(完美版本)
  • Linux:进程程序替换execl
  • 实习技能记录【3】-----Git操作
  • 编写junit测试类 import org.junit.Test;
  • 最新 OpenHarmony 系统一二级目录整理
  • 【详细图文】在VScode中配置python开发环境
  • ReplicaSet、Deployment功能是怎么实现的?
  • C语言:字符串处理函数strstr分析
  • BUUCTF-web刷题篇(14)
  • 边缘计算革命:低功耗GPU在自动驾驶实时决策中的应用
  • [ctfshow web入门] web25
  • 通过扣子平台将数据写入飞书多维表格
  • rockylinux 8 9 升级到指定版本
  • excel的逻辑类型函数(主要包括if、and、or、not、xor、iserror、iferror、true、false、ifs、ifna、switch)
  • 迁移WordPress网站(大文件版本)
  • 任务扩展-输入商品原价,折扣并计算促销后的价格