【问题标题】:AWS ElasticSearch shrink API node nameAWS ElasticSearch 收缩 API 节点名称
【发布时间】:2020-12-05 18:37:12
【问题描述】:

AWS ElasticSearch 的 AWS Docs 中有一个关于收缩 API 的部分:

https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/aes-supported-es-operations.html#es_version_api_notes-shrink

示例展示了如何缩小:

{
  "settings": {
    "index.routing.allocation.require._name": "name-of-the-node-to-shrink-to",
    "index.blocks.read_only": true
  }
}
PUT https://domain.region.es.amazonaws.com/source-index/_settings
{
  "settings": {
    "index.routing.allocation.require._name": null,
    "index.blocks.read_only": false
  }
}

PUT https://domain.region.es.amazonaws.com/shrunken-index/_settings
{
  "settings": {
    "index.routing.allocation.require._name": null,
    "index.blocks.read_only": false
  }
}

我在哪里可以获得name-of-the-node-to-shrink-tosource-indexshrunken-index

【问题讨论】:

    标签: aws-elasticsearch


    【解决方案1】:

    对于收缩操作:

    索引的所有主分片必须驻留在同一节点上。 https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html

    name-of-the-node-to-shrink-to”参数将索引的分片重新定位到此特定节点。

    您可以使用cat nodes API 获取集群的节点名称:

    GET /_cat/nodes?v&h=name
    

    接下来,您要对其执行收缩操作的索引中的 source-index。此过程会创建一个新的目标索引,它将是您的 shrunken-index

    您将进行以下 API 调用来执行收缩操作:

    POST /my_source_index/_shrink/my_target_index
    {
      "settings": {
        "index.routing.allocation.require._name": null, 
        "index.blocks.write": null 
      }
    }
    

    您在 AWS 文档中看到的另外两个调用用于清除 source-indexshrunken-index

    的分配要求

    你也可以关注Elastic's guide

    【讨论】:

      猜你喜欢
      • 2023-03-27
      • 1970-01-01
      • 2013-11-27
      • 2015-09-25
      • 1970-01-01
      • 2017-02-12
      • 2014-05-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多