我试图用Elasticsearch,Kibana和APM服务器安装Elastic APM作为docker-compose的3个服务。现在我对如何使用文档APM Server Configuration在app-server.yml文件中设置IP感到困惑。该文件应如下所示:
apm-server:
host: localhost:8200
output:
elasticsearch:
hosts: ElasticsearchAddress:9200
我尝试将ElasticsearchAddress设置为localhost或127.0.0.1,但我总是遇到错误
Failed to connect: Get http://127.0.0.1:9200: dial tcp 127.0.0.1:9200: getsockopt: connection refused
或Failed to connect: Get http://localhost:9200: dial tcp [::1]:9200: connect: cannot assign requested address
。我还尝试了其他几个ips。
有谁知道如何正确配置应用服务器,还是有任何docker-compose文件才能正确安装?
感谢您的帮助
答案 0 :(得分:3)
如果要使用单个docker compose文件启动所有服务,则app-server.yaml应该具有如下值
output:
elasticsearch:
hosts: elasticsearch:9200
“主机:elasticsearch:9200”应该是您在docker-compose中提到的elasticsearch的服务名称。就像在后面的
version: '2'
services:
elasticsearch:
image: elasticsearch:latest