Elasticsearch - Binding to Public IP

Hello!

I wish to make the Elasticsearch running on my localhost open to public access (within my college). Therefore I wish to bind it to an IP address of my choice. However, I followed the instructions on this link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html and changed the 'network.host' parameter in the config file. It has still not gone public.

Any idea what else I need to do?

Thanks!

You changed it to what?

Changed the following parameters in the config file.

network.host: 172.25.3.31

http.port: 9201

172.25.3.31 is still in the private RFC1928 range, but perhaps all of your college is NATed? If so, what exactly does "not gone public" mean?

Did you restart Elasticsearch after you changed it? Elasticsearch logs which port it is binding to on startup. Once for its internal "transport" protocol and once for REST.

Magnus - It is an internal college IP. I am, however, unable to access it even after changing the config which means the hosting failed for some reason.

Nik - Yes, I did restart it. And yet, there is no difference.

Please note that I've managed to successfully host Kibana on the same IP on port 5601 by altering its configuration. Cannot fathom why it isn't happening for Elasticsearch.

Have you validated it's running and listening? (netstat -tnlp, look for java on 9300)

Could a firewall be impeding the connection? Try running netcat (or an echo server) as a listener on tcp/9300 and see if you can connect to it instead.

Do any config changes take effect? Like, what if you just put a syntax error in elasticsearch.yaml?

Update - my config has the HTTP port set to 9200 and the transport TCP port set to 9300. The host is set to 172.25.3.31 as eariler.

However, the binding still hasn't happened on either of the ports.

Here's a screenshot of the netstat -tnlp command on Ubuntu. Not very indicative, I think.

Can you past here your log ?

Exemple in my config :

network.host: ["10.90.213.132", "172.16.50.12"]

I have in my log :

[2016-03-29 16:08:36,035][INFO ][transport                ] [es-dev-node-integration] publish_address {10.90.213.132:9300}, bound_addresses {172.16.50.12:9300}, {10.90.213.132:9300}
[2016-03-29 16:08:39,064][INFO ][http                     ] [es-dev-node-integration] publish_address {10.90.213.132:9200}, bound_addresses {172.16.50.12:9200}, {10.90.213.132:9200}

If you can, you may want to re-run the netstat as root just to confirm that it's ES running on 9200.

That said, it looks like something is listening on :9200, but only on localhost. This may be an indication that the bind_host and/or network_host is only set to localhost/127.0.0.1. For it to listen on your outward facing interface it will either show 0.0.0.0:9200 or :::9200 and/or your $BIND_HOST:9200.

Problem resolved. Now hosting successfully. Turns out it was a very silly error - I had to remove the # at the beginning of the operative lines in the config file where I'd mentioned the IP addresses and the port numbers.