【问题标题】:Elasticsearch - ‘network.host’: is not allowed on ElasticCloudElasticsearch - ‘network.host’:在 ElasticCloud 上是不允许的
【发布时间】:2021-08-01 17:03:08
【问题描述】:

我正在使用 ElasticCloud,版本 v7.12.1,我已经设置了一个观察者来检查集群的健康状况,如下所示:

PUT _watcher/watch/cluster_health_watch
    {
      "trigger" : {
        "schedule" : { "cron" : "0 0/5 * * * ?" }
      },
      "input" : {
        "http" : {
          "request" : {
            "host" : "localhost",
            "port" : 9200,
            "path" : "/_cluster/health",
            "auth": {
              "basic": {
                "username": "Myuser",
                "password": "mypassword"
              }
            }
          }
        }
      },
      "condition" : {
        "compare" : {
          "ctx.payload.status" : { "not_eq" : "green" }
        }
      },
      "actions" : {
      "slackmonitoring" : {
        "throttle_period" : "5m",
        "slack" : {
          "message" : {
            "to" : [ "test-webhook" ], 
            "text" : "Cluster is Unhealthy!" 
          }
        }
      }}
    }

失败并出现此错误:

"input": {
      "type": "http",
      "status": "failure",
      "error": {
        "root_cause": [
          {
            "type": "http_host_connect_exception",
            "reason": "Connect to localhost:9200 [localhost/127.0.0.1] failed: Connection refused"
          }
        ],

经过一番搜索,有人提到要补充: network.host: 127.0.0.1 到 elasticsearch.yml 但是,当我添加它并尝试保存它时,我得到了这个错误:

Elasticsearch - 'network.host':不允许

我找不到有关此问题的任何文档及其解决方案,如果有人可以提供帮助,我将不胜感激。

【问题讨论】:

    标签: elastic-cloud elasticsearch-watcher


    【解决方案1】:

    从支持部门获得解决方案,发布答案以防有人遇到同样的问题:

    它需要使用elasticsearch公共端点而不是localhost。所以它看起来像这样:

    "input" : {
            "http" : {
              "request" : {
                "url" : "https://REDACTED.cloud.es.io:9243/_cluster/health",
                "auth": {
                  "basic": {
                    "username": "Myuser",
                    "password": "mypassword"
                  }
                }
              }
            }
          }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-07-12
      • 2016-03-01
      • 1970-01-01
      • 2013-09-01
      • 2022-11-11
      • 1970-01-01
      • 2017-12-02
      相关资源
      最近更新 更多