I want to run 2 instance of ElasticSeach on 2 differents hosts. I have build my own docker image based on Ubuntu 14.04 and the 1.3.2 version of elasticsearch. If I run 2 ES' container on 1 host each instance see the other one and can communicate, but when I run 2 instance of ES on 2 differents host it's didn't work. The 9300 port of the container is bind to the 9300 host's port.
My question is : it's possible to create an ES' cluster with my configuration ?
Best regards, Lucas Rival
Using docker-compose is much easier than running it manually in command line:
I was able to get clustering working using unicast across two docker hosts. I just happen to be using the
ehazlett/elasticsearch
image, but I do not think this should matter all that much. The really important bit seems to be setting thenetwork.publish_host
setting to a public or routable IP its docker host.Configuration
docker-host-01
docker-host-02
Building the Cluster
On Docker Host 01
On Docker Host 02
You should be able to communicate the two containers running in different hosts as far as the host machines are accessible between them in the ports needed. I think your problem is that you are trying to use ElasticSearch multicast discovery, but if then you need to expose also port 54328 of the containers. If it doesn't work you can also try to configure ElasticSearch using unicast, setting adequately the machines IP's in your elasticsearch.yml.