Remote access elasticsearch 9200 fails


(Djougue Basso) #1

Hi guy,
I have a problem that i am facing but i didn't found solution in the forum and into elasticsearch official documentation. I have successfully installed elasticsearch 1.7.3 in OVH cloud machin and being able to connect via localhost through the curl localhost:9200. But i tried to connect remotely using http://158.69.78.66:9200/ (where 158.69.78.66 is the server address) without success. Please which configuration am i going to more in order to be able to remotely access elasticSearch in my server.

The attached file represent my elasticsearch.yml actual configuration.

Thanks,


(Glen R Smith) #2

You need to configure your server so that port 9200 is open.


(Djougue Basso) #3

Thanks for your responstance. Does it means that elasticSearch doesn't have
itself restriction against remote access?


(Mark Walkom) #4

Have you read Connectivity issues with a new/upgraded 2.X cluster? Read here first :)?


(Harish Kumar) #5

When elasticsearch is installed and run without any configuration changes by default it binds to localhost only. To access the elasticsearch REST API endpoint remotely the below changes has to be made on the server where elasticsearch has been installed.

Elasticsearch Configuration Change
Update the network.host property in elasticsearch.yml as per the guidelines provided in the elasticsearch documentation. For example to bind to all IPv4 addresses on the local machine, change as below network.host : 0.0.0.0
Firewall Rules Update
Update the Linux firewall to allow access to port 9200. Please refer your Linux documentation for adding rules to the firewall.
For example to allow access to all the servers(public) in CentosOS use the firewall-cmd
$ sudo firewall-cmd --zone=public --permanent --add-port=9200/tcp
success
$ sudo firewall-cmd --reload
success

Note : In production environment public access is discouraged. A restricted access should be preferred.


(system) #6