dockerhazelcastautodiscovery

How to Auto discovery Two or More Application Using Hazelcast in Docker?


I have an application that uses hazelcast. I am running two containers related to this application in docker emvironment. The configuration of hazelcast is same(group name, password, multicast or tcp-ip for network join) However, they cannot see each other and cannot create cluster group. Each of them create its own cluster.

The question is that:


Solution

  • This and this should get you going.

    One thing to pay attention to is the IP address (and the flag hazelcast.local.publicAddress). On Docker, inside the container it will see a specific IP address but from outside the container it will be a different IP address.