Hi,
I want to set up at least 2 elasticsearch docker containers per host so that I have a 4 node cluster on 2 servers on EC2.
My idea would be on a per host basis:
- Container ES1 to run with port eth0:9200/eth0:9300
- Container ES2 to run with port eth0:9201/eth0:9301
I'm trying to play with many host/port options to make it work and so far I don't have a cluster with 2 nodes.
Any help appreciated:
kibana:
build: ./build-kibana/
links:
- es
ports:
- "5601:5601"
environment:
- ELASTICSEARCH_URL=http://es:9200
es:
build: ./build-es/
command: elasticsearch -Des.network.publish_host=0.0.0.0 -Des.http.port=9200 -Des.http.publish_port=9200 -Des.transport.host=0.0.0.0 -Des.transport.tcp.port=9300 -Des.transport.publish_port=9300 -Des.plugin.mandatory=cloud-aws -Des.cloud.aws.access_key=XXX -Des.cloud.aws.secret_key=XXX -Des.cloud.aws.ec2.protocol=http -Des.cloud.aws.region=eu-west -Des.discovery.type=ec2 -Des.discovery.zen.ping.multicast.enabled=false -Des.discovery.ec2.tag.Description=elasticsearch-integration -Des.discovery.ec2.tag.Environnement=int -Des.discovery.zen.minimum_master_nodes=2
ports:
- "9200:9200"
- "9300:9300"
es2:
build: ./build-es/
command: elasticsearch -Des.network.publish_host=0.0.0.0 -Des.http.port=9201 -Des.http.publish_port=9201 -Des.transport.tcp.port=9301 -Des.transport.host=0.0.0.0 -Des.transport.publish_port=9301 -Des.plugin.mandatory=cloud-aws -Des.cloud.aws.access_key=XXXX -Des.cloud.aws.secret_key=XXXX -Des.cloud.aws.ec2.protocol=http -Des.cloud.aws.region=eu-west -Des.discovery.type=ec2 -Des.discovery.zen.ping.multicast.enabled=false -Des.discovery.ec2.tag.Description=elasticsearch-integration -Des.discovery.ec2.tag.Environnement=int -Des.discovery.zen.minimum_master_nodes=2
ports:
- "9201:9201"
- "9301:9301"
I can connect to each node with curl http://localhost:9200/
or curl http://localhost:9201/
but nodes don't see each others.
My kibana image is just kibana 4.5 with marvel, sense plugins
My ES image is just elasticsearch:2 with marvel-agent, license, cloud-aws and head plugins + Expose port 9201 & 9301.
In logs, I can see things such as on both nodes:
es_1 | [2016-05-13 10:19:30,895][WARN ][discovery.zen.ping.unicast] [Mahkizmo] failed to send ping to [{#zen_unicast_2#}{::1}{[::1]:9300}]
es_1 | SendRequestTransportException[[][[::1]:9300][internal:discovery/zen/unicast]]; nested: NodeNotConnectedException[[][[::1]:9300] Node not connected];
or:
es2_1 | Caused by: NodeNotConnectedException[[][[::1]:9301] Node not connected]
es2_1 | at org.elasticsearch.transport.netty.NettyTransport.nodeChannel(NettyTransport.java:1132)
es2_1 | at org.elasticsearch.transport.netty.NettyTransport.sendRequest(NettyTransport.java:819)
es2_1 | at org.elasticsearch.transport.TransportService.sendRequest(TransportService.java:329)
es2_1 | ... 12 more
es2_1 | [2016-05-13 10:21:21,619][WARN ][discovery.zen.ping.unicast] [Gideon] failed to send ping to [{#zen_unicast_1#}{127.0.0.1}{127.0.0.1:9301}]
es2_1 | SendRequestTransportException[[][127.0.0.1:9301][internal:discovery/zen/unicast]]; nested: NodeNotConnectedException[[][127.0.0.1:9301] Node not connected];
I don't see why it tries to use localhost
Thanks for your help,
Nicolas