Home > OS >  Unable to access Kibana on AWS EC2 instance using url
Unable to access Kibana on AWS EC2 instance using url

Time:06-20

I have elasticseasrch and Kibana installed on EC2 instance where I am able to access elasticsearch using on this url http://public-ip/9200.But I am unable to access Kibana using http://public-ip/5601.

I have configured kibana.yml and added certain fields.

server.port: 5601
server.host: 0.0.0.0
elasticsearch.url: 0.0.0.0:9200

On doing wget http://localhost:5601 I am getting below output:

--2022-06-10 11:23:37--  http://localhost:5601/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:5601... connected.
HTTP request sent, awaiting response... 200 OK
Length: 83731 (82K) [text/html]
 Saving to: ‘index.html’

Someone let me know what I am doing wrong.Any help would be appreciated.

CodePudding user response:

Server Host set to 0.0.0.0 means it should be accessible from outside localhost but double check that the listener is actually listening for external connections on that port using netstat -nltpu. The server is also accessible on it's public IP on port 9200 so try the following:

  • EC2 Security Group should inbound TCP traffic on that port 5601 from your IP address.
  • Network ACLs should allow inbound/outbound TCP traffic on port 5601.
  • OS firewall ( e.g. ufw or firewalld ) should allow traffic on that port. You can run iptables -L -nxv to check the firewall rules.
  • Try connecting to that port from a different EC2 instance in the same VPC. It is possible that what ever internet connection you are using may have a firewall blocking connections on that port. This is common with corporate firewalls.
  • If these fail, next you want to check if the packets are reaching your EC2 instance so you can run a packet capture on that port using tcpdump -ni any port 5601 and check if you have any packets coming in/out on that port.
  • if you don't see any packets on tcpdump, use VPC Flow Logs to see if packets are coming in/out that port.

CodePudding user response:

Considering the kibana port (5601 ) is open via security groups

I could able to resolve the issue by updating config server.host:localhost to server.host:0.0.0.0 and elasticsearch.hosts: ["http://localhost:9200"] (in my case kibana and ES both are running on the same machine) in kibana.yml

https://discuss.elastic.co/t/kibana-url-gives-connection-refused-from-outside-machine/122067/8

  • Related