Accessing my elasticsearch outside of the Digital Ocean environment

September 23, 2014 1.1k views

I want to establish a link where I can access my elasticsearch droplet (to use for heroku) but i am not sure how I can do that. Can anyone with the knowledge on how to do this help me?


1 Answer

It's hard to give a thorough answer without knowing how you want to access your Elasticsearch instance on the other end, but generally there is nothing preventing you from doing so. In your Elasticsearch configuration, you will need to adjust the value of the network.bind_host setting. On Ubuntu, you can find the configuration file at /etc/elasticsearch/elasticsearch.yml Change:

network.bind_host: localhost


network.bind_host: your.ip.addr

substituting your Droplet's IP address for your.ip.addr.

It's important to note that Elasticsearch does not have any built-in access controls. Making your cluster externally accessible also makes it accessible publicly unless you take further steps. I'd strongly recommend using a firewall to limit access to all but a known set of IP addresses. You can also set up basic authentication by using an Nginx proxyin front of Elasticsearch.

by Shaun Lewis
Learn how to setup a firewall with UFW on an Ubuntu / Debian cloud server.
Have another answer? Share your knowledge.