Embedded Hazelcast in Multi-node Docker

209 views
Skip to first unread message

rmad...@gmail.com

unread,
Apr 11, 2017, 3:36:23 PM4/11/17
to Hazelcast
Hi

  We have a Springboot based Java webapp that includes hazelcast.  We are facing issues in migrating to Docker environment.  I think i am missing something on Docker networking.  I did try the options mentioned in http://stackoverflow.com/questions/30103306/hazelcast-in-multinode-docker-environments-with-tcpip , but it did not work.  We use the plain hazelcast.xml 

<?xml version="1.0" encoding="UTF-8"?>

<hazelcast

xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.5.xsd"

xmlns="http://www.hazelcast.com/schema/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<properties>

<property name="hazelcast.logging.type">jdk</property>

<property name="hazelcast.rest.enabled">false</property>

<property name="hazelcast.mancenter.enabled">false</property>

<property name="hazelcast.memcache.enabled">false</property>

<property name="hazelcast.health.monitoring.level">OFF</property>

<property name="hazelcast.local.localAddress">${hazelcast.ip}</property>

<property name="hazelcast.max.no.heartbeat.seconds">15</property>

<property name="hazelcast.max.no.master.confirmation.seconds">30</property>

<property name="hazelcast.master.confirmation.interval.seconds">15</property>

<property name="hazelcast.member.list.publish.interval.seconds">60</property>

</properties>

<group>

<name>dev</name>

<password>dev-pass</password>

</group>


<network>

<public-address>${hazelcast.ip}</public-address>

<port auto-increment="true" port-count="100">5701</port>

<outbound-ports>

<ports>0</ports>

</outbound-ports>

<join>

<multicast enabled="false"></multicast>

<tcp-ip enabled="true">

<member-list>

</member-list>

</tcp-ip>

</join>

</network>

<partition-group enabled="false" />

<executor-service name="default">

<pool-size>16</pool-size>

<!--Queue capacity. 0 means Integer.MAX_VALUE. -->

<queue-capacity>0</queue-capacity>

</executor-service>

</hazelcast>


HostIP                 Docker Container IP     

10.151.16.27           10.42.236.108

10.151.16.209                    10.42.152.56


Host1

ip route output
default via 10.42.0.1 dev eth0
10.42.0.0/16 dev eth0  src 10.42.236.108
169.254.169.250 via 10.42.0.1 dev eth0

Host 2
ip route ouptut
default via 10.42.0.1 dev eth0
10.42.0.0/16 dev eth0  src 10.42.152.56
169.254.169.250 via 10.42.0.1 dev eth0

I start the docker by injecting the container IP into the hazelcast.ip environment variable.  The cluster does not get formed.  

Please let me know if i am missing something here.

ih...@hazelcast.com

unread,
Apr 12, 2017, 6:51:35 AM4/12/17
to Hazelcast, rmad...@gmail.com
Can you provide logs? It will provide a clue why the cluster is not being formed.

Regards,
ihsan

Madheshwara R

unread,
Apr 13, 2017, 3:06:02 AM4/13/17
to ih...@hazelcast.com, Hazelcast
Hi

  There are no errors as such. The two nodes form two separate clusters with one member each rather than joining into a single cluster.  I feel the network setup needs to be different for docker based deployments.  

Regards
Madhesh

ihsan demir

unread,
Apr 13, 2017, 10:35:13 AM4/13/17
to Hazelcast
i think you forgot to fill ip adress inside the tcp-ip tag. How can the members discovery each other without this information?
Reply all
Reply to author
Forward
0 new messages