Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Elasticsearch network host

I've install ES on my VM which it has an OS of centos 7. It network.host: bind to the localhost. I can browse via port 9200.

My problem is that I've changed the network host to:0.0.0.0 (So I can get public access from my host PC).
the service started but the port is not listening.

I want to access ES from my host PC.
How can i change the network.host ?

like image 847
vish Avatar asked Oct 13 '18 16:10

vish


3 Answers

I faced same issue in elasticsearch 7.3.0 version. I resolved by putting following

values in /etc/elasticsearch/elasticsearch.yaml as shown below

network.host: 127.0.0.1
http.host: 0.0.0.0
like image 140
Shree Prakash Avatar answered Nov 08 '22 17:11

Shree Prakash


Looking at the Elasticsearch Network Settings documentation, it doesn't appear that 0.0.0.0 is a valid setting for network.host.

Try instead the special value _global_. So the section of your elasticsearch.yaml might look like this:

network:
  host: _global_

This should tell Elasticsearch to listen on all network interfaces.

like image 41
orangejulius Avatar answered Nov 08 '22 16:11

orangejulius


If you are planning to set network.host other than default(127.0.0.1) then change following details in /etc/elasticsearch/elasticsearch.yml

  • network.host: 0.0.0.0
  • discovery.seed_hosts: []
like image 6
c.sankhala Avatar answered Nov 08 '22 17:11

c.sankhala