Multiple instances-containers of elasticsearch on docker

May 24, 2016 2.7k views
Docker Elasticsearch Ubuntu

trying to run multiple copies of elastic search using the following commands.

docker run -d -p 9200:9200 -p 5601:5601 nshou/elasticsearch-kibana

docker run -d -p 9202:9200 -p 5602:5601 nshou/elasticsearch-kibana

after running these I can access at ports 9200 and 9202 (and 5601 and 5602).

But I seem to get errors when I run the python script below. Also, I want to run the script below separately for each of the docker instances (containers?), I want to run slightly different versions of the python script actually. What do I need to do to set this up?

  • Your methodology should work, based on what you've written here.

    Would it be possible to provide the errors you are receiving, as well as the script (or documentation for it, etc. -- it seems to have gotten cut off from your original post)? I was unable to replicate the issue with this image off-hand, so to better assist you, the community may benefit from a little more detail, if at all possible.

    There's also another maintained ELK Docker image with extensive documentation here:

    Which may also help you getting this up and running, if there was something under-documented elsewhere for your selected image.

  • Another issue is that sometimes when I run the script I get this
    /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see
    .py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see
    Segmentation fault

  • when I rebooted the machine and the segmentation fault disappeared.

  • when I try to post the code here it does not upload I don't know why. Anyway, how can I run one script for one of the installations and a different for the other. Right now I am running one script. Then I did this
    root@dgone:~# docker run -d -p 9204:9200 -p 5604:5601 nshou/elasticsearch-kibana
    root@dgone:~# docker ps -a
    4c3cc4cdba39 nshou/elasticsearch-kibana "/bin/sh -c 'elastics" 16 seconds ago Up 15 seconds>5601/tcp,>9200/tcp trustinggolick
    6b510d76d8a8 nshou/elasticsearch-kibana "/bin/sh -c 'elastics" 9 hours ago Up 4 minutes>5601/tcp,>9200/tcp kickass

    but how can I run a similar but slightly different script for the new container (?) I just created.
    Since I cannot upload the script let me call the first one and the second I am running and it is indexing in the first elasticsearch. Now I want to run and have it index to the second elasticsearch.

    Also, now I am getting this error.
    Traceback (most recent call last):
    File "", line 71, in <module>
    File "/usr/local/lib/python2.7/dist-packages/tweepy/", line 445, in filter
    File "/usr/local/lib/python2.7/dist-packages/tweepy/", line 361, in start
    File "/usr/local/lib/python2.7/dist-packages/tweepy/", line 294, in _run
    raise exception
    elasticsearch.exceptions.ConnectionError: ConnectionError(('Connection aborted.', error(104, 'Connection reset by peer'))) caused by: ProtocolError(('Connection aborted.', error(104, 'Connection reset by peer')))

1 Answer

when I try to post the code on this forum the submit button here does not work

Have another answer? Share your knowledge.