I am trying to get Elasticsearch to listen to IP addresses other than 127.0.0.1. I have edited the /etc/elasticsearch.yml file as follows:
#network.host: ["local", "site"] -- tried this one first but didn't work
network.host: [ "local:ipv4" , "site:ipv4" ]
http.port: 9200
netstat shows that it seems to be listening on the port:
$ sudo netstat -anp|grep 9200
tcp6 0 0 192.168.0.39:9200 :::* LISTEN 31495/java
tcp6 0 0 127.0.0.1:9200 :::* LISTEN 31495/java
curl http://127.0.0.1:9200 results are as expected:
{
"name" : "1_im18G",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "bsw9TRs8SvakK5WDVeM5xQ",
"version" : {
"number" : "5.2.0",
"build_hash" : "24e05b9",
"build_date" : "2017-01-24T19:52:35.800Z",
"build_snapshot" : false,
"lucene_version" : "6.4.0"
},
"tagline" : "You Know, for Search"
}
and the change from netstat:
sudo netstat -anp|grep 9200
tcp 0 0 127.0.0.1:49663 127.0.0.1:9200 TIME_WAIT -
tcp6 0 0 192.168.0.39:9200 :::* LISTEN 31495/java
tcp6 0 0 127.0.0.1:9200 :::* LISTEN 31495/java
response to curl http://192.168.0.39:9200 though results in:
curl http://192.168.0.39:9200
<HTML><HEAD>
<TITLE>Network Error - tcp_error</title>
SNIP
Network Error (tcp_error)</b> </font> </p>
SNIP
<p><font face="Arial, Helvetica, sans-serif" size="2"> A communication error occurred: "Operation timed out"
</font> </p>
<p><font face="Arial, Helvetica, sans-serif" size="2"> The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.
and no change to netstat.
tcp6 0 0 192.168.0.39:9200 :::* LISTEN 31495/java
tcp6 0 0 127.0.0.1:9200 :::* LISTEN 31495/java
Am I missing something or is there maybe a server networking issue?
Thanks.