Elasticsearch working fine with localhost but not able to connect over Browser by using IP address

Generally in Elasticsearch  people face this issue when trying to access elasticsearch related url from browser by using IP address  while everything working fine with localhost.

Suppose your System IP is 10.0.0.31 and trying to run below query in browser.You will get below screen on different browsers

http://10.0.0.31:9200/_cluster/health?pretty

IE:

IE Not connected
IE Browser

Chrome:

Chrome Not Connected
Chrome Browser

Solution:

Go to command prompt and use below command to get ipv4 address as mentioned in below screen.

Window  :

ipconfig

Unix/Linux:

ifconfig

ipconfig

Update Your IPV4 address in config/elasticsearch.yml file for property

network.host: 10.0.0.31

if  your IP is static IP then you can update same as above or if it’s dynamic then update it as below.

network.host:0.0.0.0

For testing above configuration restart your eleasticsearch and try in elasticsearch on your browser address bar after updating server ip. You will get result like below.

http://localhost:9200/_cluster/health?pretty

or as below if network.host configured

http://elasticseverIp:9200/_cluster/health?pretty

Issues Solution

For more Elasticsearch issues solution follow link Common Elasticsearch Issues.

Integration

Integrate Filebeat, Kafka, Logstash, Elasticsearch and Kibana

Advertisements

2 thoughts on “Elasticsearch working fine with localhost but not able to connect over Browser by using IP address”

This site uses Akismet to reduce spam. Learn how your comment data is processed.