我有以下docker compose文件。我正在尝试将在另一台机器上运行的弹性搜索连接到kibana。
version: '3.3'
services:
kibana_ci:
image: docker.elastic.co/kibana/kibana:6.3.2
environment:
ELASTICSEARCH_URL: http://my_domain:9200
container_name: kibana_ci
command: kibana
ports:
- "5601:5601"
但是kibana一直尝试连接到http://elasticsearch:9200/
网址。我还尝试了以下不起作用的选项。
environment:
- "ELASTICSEARCH_URL=http://my_domain:9200"
environment:
- "KIBANA_ELASTICSEARCH_URL=http://my_domain:9200"
environment:
KIBANA_ELASTICSEARCH_URL: http://my_domain:9200
environment:
elasticsearch.url: http://my_domain:9200
如何更改docker compose文件中的url(不覆盖kibana.yml文件)。
答案 0 :(得分:2)
此撰写文件对我有用:
version: '3.3'
services:
kibana:
image: docker.elastic.co/kibana/kibana:6.3.2
environment:
SERVER_NAME: kibana.example.org
ELASTICSEARCH_URL: http://my_domain
您不需要定义默认端口9200
。
kibana_1 | {"type":"log","@timestamp":"2018-09-20T16:58:31Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"Unable to revive connection: http://my_domain:9200/"}
kibana_1 | {"type":"log","@timestamp":"2018-09-20T16:58:31Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"No living connections"}
kibana_1 | {"type":"log","@timestamp":"2018-09-20T16:58:34Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"Unable to revive connection: http://my_domain:9200/"}
kibana_1 | {"type":"log","@timestamp":"2018-09-20T16:58:34Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"No living connections"}
答案 1 :(得分:0)
对于那些在<form action='#' method='post'>
<input type='checkbox' name='is_active_checkbox' {% if sample.active %}checked{% endif %}>
</form>
中也会遇到同样问题的人,您将必须使用Kibana 7.5
环境变量而不是ELASTICSEARCH_HOSTS
,如下所示:
ELASTICSEARCH_URL
您还可以通过以下链接查询所有可用环境变量的列表,以及如何在Docker环境中进行设置: https://www.elastic.co/guide/en/kibana/7.5/docker.html