elastic-cloud - Elasticsearch - 'network.host':在 ElasticCloud 上是不允许的
问题描述
我正在使用 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':不允许
我找不到有关此问题的任何文档及其解决方案,如果有人可以提供帮助,我将不胜感激。
解决方案
从支持获得解决方案,发布答案以防有人面临同样的问题:
它需要使用弹性搜索公共端点而不是本地主机。所以它看起来像这样:
"input" : {
"http" : {
"request" : {
"url" : "https://REDACTED.cloud.es.io:9243/_cluster/health",
"auth": {
"basic": {
"username": "Myuser",
"password": "mypassword"
}
}
}
}
}
推荐阅读
- php - Laravel 7变量未传递给视图
- python - 在组内按日期将最新列值分配给熊猫中的其他行
- python - 如何在Python中对具有字符串作为键和整数作为值的字典进行排序
- c++ - 了解在 STL 映射中使用的运算符重载“const”语法
- python - PyCaret NLP assign_model(lda) 在空行上分配主题
- javascript - 如何使用 SelectAreas.js 设置图像上边界框的数量限制
- c# - ASP.NET Core 代码优先中的迁移不起作用
- python - 美丽的汤选择器
- docker - 纱线安装错误“ENOENT:没有这样的文件或目录
- slack-api - Slack API - 为某些帖子生成:invalid_arg_name