elasticsearch - 如何删除elasticsearch跨集群搜索种子5.5.1-1

标签 elasticsearch elasticsearch-5

我正在运行 elasticsearch 5.5.1-1 和 x-pack 进行监控。

Elasticsearch 的文档说我应该能够将以下代码添加到我的 elasticsearch.yml 文件中以进行跨集群搜索播种:

search:
    remote:
        cluster_one: 
            seeds: 1.1.1.1:9300
        cluster_two: 
            seeds: 2.2.2.2:9300

那行不通,所以我按如下方式使用了 API:

PUT _cluster/settings
{
  "persistent": {
    "search": {
      "remote": {
        "cluster_one": {
          "seeds": [
            "1.1.1.1:9300"
          ]
        },
        "cluster_two": {
          "seeds": [
            "2.2.2.2:9300"
          ]
        }
      }
    }
  }
}

这工作正常但是我需要删除 cluster_one 直到它升级到 5.5.1-1,根据 elasticsearch 的文档说应该按如下方式完成:

PUT _cluster/settings
{
  "persistent": {
    "search": {
      "remote": {
        "cluster_one": {
          "seeds": null 
        }
      }
    }
  }
}

似乎我得到了确认:

    {
      "acknowledged" : true,
      "persistent" : { },
      "transient" : { }
    }

但是,如果我 curl 集群设置,我仍然会看到两个节点如下:

   {
      "persistent" : {
        "search" : {
          "remote" : {
            "cluster_one" : {
              "seeds" : [
                "1.1.1.1:9300"
              ]
            },
            "cluster_two" : {
              "seeds" : [
                "2.2.2.2:9300"
              ]
            }
          }
        }
      },
      "transient" : { }
    }

我不认为我需要在 API 调用后重新启动 elasticsearch,但我也尝试过但无济于事。

我还玩过引用/大写 null 并收到此返回消息,这让我相信 null 是一个有效值:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "json_parse_exception",
        "reason" : "Unrecognized token 'NULL': was expecting 'null', 'true', 'false' or NaN\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@6053e99; line: 7, column: 25]"
      }

最佳答案

在我的 elasticsearch 5.5 安装中将“null”放在方括号中:

PUT _cluster/settings
{
  "persistent": {
    "search": {
      "remote": {
        "cluster_one": {
          "seeds": [
            null 
          ]
        }
      }
    }
  }
}

关于elasticsearch - 如何删除elasticsearch跨集群搜索种子5.5.1-1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45581311/

相关文章:

elasticsearch - 如何使用Elasticsearch过渡API(别名已更新以指向最新创建的索引)?

ElasticSearch - 分片如何影响索引性能?

ruby-on-rails - 仅当资源具有特定属性时如何过滤搜索集合?

elasticsearch - Elasticsearch:在嵌套文档上执行 “inner_hit”时,返回层次结构中匹配偏移量的所有字段

elasticsearch - Elasticsearch 到许多聚合:无法连接到服务器

elasticsearch 按文档 id 排序

elasticsearch-5 - 当 "time-unit"= "days"时,ELK Curator 如何管理月/周索引

elasticsearch - 如何在 elasticsearch 中只存储有限数量的文档。

elasticsearch - 这些设置如何使 Elasticsearch 在开发模式下运行?

elasticsearch - 使用 elasticsearch completion suggester 获得不同于输入的输出