当前位置: 首页 > 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" }
}'

相关文章:

  • “剪贴板劫持“攻击:黑客利用虚假验证码通过入侵网站窃取数据
  • 自动化框架及其设计搭建浅谈(三)--自动化测试框架设计最佳实践
  • 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开发环境
  • 库尔勒网站建设公司/长沙seo平台
  • 国外网络营销网站/网站seo策划方案案例分析
  • 做网站需要多少固定带宽/品牌策划包括哪几个方面
  • 分类信息网站系统/深圳华强北新闻最新消息今天
  • 免费的网站给一个/友情链接查询工具
  • 微网站管理平台/上海关键词优化推荐