栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

elasticsearch7.6.1 不同服务器间索引数据迁移 旧索引数据迁移至新索引数据

elasticsearch7.6.1 不同服务器间索引数据迁移 旧索引数据迁移至新索引数据

举例子:索引A为旧索引,索引B为新索引。 1、获取A索引(旧索引)的数据结构
GET /index_a/_mapping/

2、创建一个新的索引B,结构同A。
POST /index_b/_mapping/
{
      "properties" : {
        "age" : {
          "type" : "long"
        },
        "education" : {
          "type" : "text"
        },
        "other": {
          "type": "text"
        },
        "name" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "testedu" : {
          "type" : "text"
        }
      }
}
3、elasticsearch.yml 设置白名单
# 开启跨域
http.cors.enabled: true
# 所有人访问
http.cors.allow-origin: "*"
# network.host: 192.168.1.127
# http.port: 9200
# transport.tcp.port: 9300
reindex.remote.whitelist: "192.168.0.202:9200, 192.168.0.202:9200,127.0.10.*:9200, localhost:*"
4、迁移数据
POST _reindex
{
  "source": {
    "remote": {
      "host": "http://192.168.0.202:9200"
    }, 
    "index": "index_a"
  },
  "dest": {
    "index": "index_b"
  }
}


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/650640.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号