Elasticsearch克隆索引

我所使用的Elasticsearch的版本是基于7.17.7。

需求是将某个ES的索引进行克隆。例如我要将索引test_0419_1克隆一份新的索引test_0419_2。步骤如下:

  • 首先将源索引进行修改PUT /test_0419_1/_block/write,即禁止对这个索引进行写数据操作。

  • 然后执行克隆操作:

    POST test_0419_1/_clone/test_0419_2
    {
    "settings": {
    "index.number_of_shards": 1
    }
    }

在克隆时,可以指定index.number_of_replicasindex.auto_expand_replicas。还可以指定alias,如下所示:

复制代码
{
  "settings": {
    "index.number_of_shards": 1 
  },
  "aliases": {
    "test_1": {
      "filter": {
        "term": {
          "label": "test_label"
        }
      }
    }
  }
}

这样通过test_1别名就可以搜到这个当前别名下的数据了。

相关推荐
Elasticsearch14 小时前
Kibana 中的 SNMP 拓扑数据:从采集到 Canvas
elasticsearch
Nturmoils16 小时前
订单列表慢查询,先看 WHERE、ORDER BY 和 LIMIT
数据库
渣波20 小时前
拒绝 SQL 焦虑!手把手带你用 NestJS + Prisma + DTO 写出“防弹”级后端代码
javascript·数据库·后端
大大大大晴天20 小时前
Hudi技术内幕:RecordPayload到RecordMerger
大数据
SelectDB1 天前
秒级弹性、最高降本 70%:SelectDB Serverless 如何重塑云数仓资源效率
大数据·后端·云原生
WhoAmI1 天前
MapReduce框架原理解析一:InputFormat
大数据·hadoop
WhoAmI1 天前
MapReduce框架原理解析三:OutputFormat
大数据·hadoop
WhoAmI1 天前
MapReduce框架原理解析二:Shuffle
大数据·hadoop
倔强的石头_2 天前
KingbaseES 新版MySQL 兼容版体验:旧版迁移 + 功能实测
数据库