Not able to access 9200, 5601, 8200 port from outside the installed ELK APM server

Hi Team,

I am able to view the kibana dashboard from the sever where they are being installed but not from outside the server. Can you please help me out to solve the issue

Did a netstat :

[root@potman1 ~]# netstat -nat | grep 9200
tcp6 0 0 :::9200 :::* LISTEN
[root@potman1 ~]# netstat -nat | grep 5601
tcp6 0 0 :::5601 :::* LISTEN

docker-compose.yml

version: '2.2'

services:
delete-indexes:
image: playdingnow/delete-outdated-es-indexes:1.3
environment:
- eshost=elasticsearch
- esport=9200
- esmaxdays=15
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.5.1
environment:
- xpack.security.enabled=false
- ES_JAVA_OPTS=-Xms512m -Xmx512m
ports:
- 9200:9200
healthcheck:
test: ['CMD', 'curl', '-f', 'http://0.0.0.0:9200']
interval: 10s
timeout: 5s
retries: 3
kibana:
image: docker.elastic.co/kibana/kibana:6.5.1
ports:
- 5601:5601
healthcheck:
test: ['CMD', 'curl', '-f', 'http://0.0.0.0:5601']
interval: 10s
timeout: 5s
retries: 3
depends_on:
elasticsearch:
condition: service_healthy
apm-server:
image: docker.elastic.co/apm/apm-server:6.5.1
ports:
- 8200:8200
environment:
- output.elasticsearch.hosts=['http://elasticsearch:9200']
- apm-server.host="0.0.0.0:8200"
- apm-server.secret_token="xxVpmQB2HMzCL9PgBHVrnxjNXXw5J7bd79DFm6sjBJR5HPXDhcF8MSb3vv4bpg44"
- setup.kibana.host="kibana:5601"
- setup.template.enabled=true
- logging.to_files=false
depends_on:
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy

How can i enable the ports to make is accessible from outside as well.

Thanks,
Susmit

Hi @Susmit07

To me this sounds like a firewall problem. I'm sorry for the silly question, but did you change the configuration of iptables/firewalld or whatever firewall you are using to allow access on these ports?

If yes, which OS are you using?

Hope this helps.

MiTschMR

Hi @MiTschMR I am using a windows VM, firewall is not the issue, still I am stuck with the issue. It's quite frustrating :frowning:

Hi @Susmit07

I did a quick search and only found this solution on stackoverflow. It looks like Windows only binds the port to localhost, so you have to specify the port like 0.0.0.0::. If I am not mistaken this solution should also work in the docker compose files.

Because I am using CentOS 7 I can't reproduce your error, I'm sorry.

Hope this helps.

MiTschMR

Hi @MiTschMR I am already using 0.0.0.0 so it can be accessed across all network interfaces. Please find my docker-compose.yml I have attached above. Will be awaiting for your response ~ BR, Susmit

Hi @Susmit07

Please try this form of the „ports“ setting on every port you publish:

ports: 
  - 0.0.0.0:5601:5601 

This is the solution given from the thread I referenced to.

Hope this helps.

MiTschMR

ports:
- 8200:8200
- 9200:9200
- 5601:5601 

in your docker compose file under APM

I had the same issue using windows too, i have set the below in kibana.yml which gave me access from outside the server through a browser (ServerIP:5601)

server.port: 5601
server.host: "actual server ip here"

@iukea & @MiTschMR I am already using it. Please see my updated docker-compose.yml

version: '2'
services:
zookeeper:
image: wce-gateways-docker-dev.artifactory.swg-devops.com/dev-zookeeper
ports:
- "2181:2181"
kafka:
image: wce-gateways-docker-dev.artifactory.swg-devops.com/dev-kafka
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: b2bisand1.fyre.ibm.com
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
volumes:
- /var/run/docker.sock:/var/run/docker.sock
elk:
image: wce-gateways-docker-dev.artifactory.swg-devops.com/dev-elk
ports:
- "5601:5601"
- "9200:9200"
- "5044:5044"

Now I am able to access 9200 and 5044, but Kibana showing error

Kibana did not load properly. Check the server output for more information.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.