remote access -trying to write to Elasticsearch remotely

I am trying to send data to ealasticsearch remotely (from a different droplet). In the python code I am using there is a call to something in the python elasticsearch module that looks like this:

es = Elasticsearch([{‘host’:‘’,‘port’:9200}])

where is the address of the droplet running elasticsearch.

But this does not seem to work. I have tried other ways of doing it but they are not working. On the other hand running this from the remote host does seem to connect curl

Here is the error message Traceback (most recent call last): File “”, line 108, in <module> stream.filter(locations=GEOBOX_WORLD) File “/root/.pyenv/versions/2.7.10/lib/python2.7/site-packages/tweepy/”, line 445, in filter self._start(async) File “/root/.pyenv/versions/2.7.10/lib/python2.7/site-packages/tweepy/”, line 361, in _start self._run() File “/root/.pyenv/versions/2.7.10/lib/python2.7/site-packages/tweepy/”, line 294, in _run raise exception elasticsearch.exceptions.ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x7f2ae85aefd0>: Failed to establish a new connection: [Errno -2] Name or service not known) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7f2ae85aefd0>: Failed to establish a new connection: [Errno -2] Name or service not known) root@elk:/usr/bin#

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This comment has been deleted

Hi @willie108,

It looks like your elastic search instance is either listening only on localhost ( or perhaps not running correctly. The easiest way to check would just be to update your configuration to connect to If you don’t have luck using that then check to see if the process is running, and if not, check the logs, and try to start it by hand to get it running. Let us know if this helps, and if you need any further information.

This comment has been deleted