Gra*_*ell 3 docker kibana docker-compose
试图找出 Kibana 的 ELASTICSEARCH_HOSTS 语法,但我收到:
kib01 | FATAL Error: [config validation of [elasticsearch].hosts]: types that failed validation:
kib01 | - [config validation of [elasticsearch].hosts.0]: expected URI with scheme [http|https].
kib01 | - [config validation of [elasticsearch].hosts.1]: could not parse array value from json input
Run Code Online (Sandbox Code Playgroud)
来自 Kibana 本身或:
ERROR: The Compose file './docker-compose.yml' is invalid because:
services.kibana.environment.ELASTICSEARCH_HOSTS contains ["http://es01:9200", "http://es02:9200", "http://es03:9200", "http://es04:9200"], which is an invalid type, it should be a string, number, or a null
Run Code Online (Sandbox Code Playgroud)
来自 Docker 撰写。
我的最新迭代是:
environment:
ELASTICSEARCH_HOSTS=["http://es01:9200", "http://es02:9200", "http://es03:9200", "http://es04:9200"]
Run Code Online (Sandbox Code Playgroud)
我也试过:
environment:
- ELASTICSEARCH_HOSTS: '["http://es01:9200", "http://es02:9200", "http://es03:9200", "http://es04:9200"]'
Run Code Online (Sandbox Code Playgroud)
我试着把它变成一个列表:
environment:
ELASTICSEARCH_HOSTS:
- "<host1>"
- "<host2>"
Run Code Online (Sandbox Code Playgroud)
我尝试删除上述变体中各个位置的引号以及列表中的各种组合。
我还尝试了官方文档中使用:和的组合=
和 ELASTICSEARCH_HOST = http://es01:9200, http://es02:9200...
都被拒绝了。有谁知道让这个工作的魔法语法?
ELASTICSEARCH_HOSTS: ['http://es01:9200','http://es02:9200','http://es03:9200','http://es04:9200']
ELASTICSEARCH_HOSTS="['http://es01:9200','http://es02:9200','http://es03:9200','http://es04:9200']"
- ELASTICSEARCH_HOSTS=['http://es01:9200','http://es02:9200','http://es03:9200','http://es04:9200']
- ELASTICSEARCH_HOSTS="["http://es01:9200","http://es02:9200","http://es03:9200","http://es04:9200"]"
ELASTICSEARCH_HOSTS:
- "<host1>"
- "<host2>"
Run Code Online (Sandbox Code Playgroud)
Ali*_*Tou 10
要解决您的问题,需要注意以下几点:
# A native yaml approach to define key-value objects
environment:
KEY1: VAL11
KEY2: VAL2
# OR
# Some special way for compose yaml parser
# that can split key and value from a "KEY1=VAL1" string
environment:
- KEY1=VAL1
- KEY2=VAL2
Run Code Online (Sandbox Code Playgroud)
环境变量的值必须是字符串(上例)、数字或 null(空值)。请注意,[foo, bar]它以本机(第一个)格式解析为列表,但 compose 方式(第二个)将其解析为字符串。
在此论坛问题中,有一个示例说明如何将多个 elasticsearch 主机作为环境变量 ( ELASTICSEARCH_HOSTS)传递。
所以这一定是一个 docker-compose 和 Kibana 都能理解的有效例子:
environment:
ELASTICSEARCH_HOSTS: '["http://es01:9200","http://es02:9200","http://es03:9200","http://es04:9200"]'
# OR
environment:
- ELASTICSEARCH_HOSTS=["http://es01:9200","http://es02:9200","http://es03:9200","http://es04:9200"]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3129 次 |
| 最近记录: |