我正在使用 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':不允许
我找不到有关此问题的任何文档及其解决方案,如果有人可以提供帮助,我将不胜感激。