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://18.104.22.168:9200/ (where 22.214.171.124 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.
You need to configure your server so that port 9200 is open.
Thanks for your responstance. Does it means that elasticSearch doesn't have
itself restriction against remote access?
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
$ sudo firewall-cmd --reload
Note : In production environment public access is discouraged. A restricted access should be preferred.