After installation of dockerForMac and virtualbox on my macOs, local hazelcast members can not see each others with the multicast configuration of hazelcast (not in containers). It seems both of them are master in the cluster with the different port.
Difference after installation of docker stuff etc. is IP addresses of the members. It was my local IP address but now It has 192.168.99.1 is used by vboxnet. see my ifconfig.
This comment is about the port usage of multicast discovery function: It looks like Hazelcast uses multicast address 224.2.2.3 on UDP port 54327 (by default) for discovery, and then port 5701 for TCP communication. Opening UDP port 54327 in the firewall fixed discovery for me. (I had also opened TCP port 5701 but that was not sufficient.)
Is there anyway to make hazelcast use to my IP address? or Is there anyway to open these ports for vnetbox?
ifconfig:
vboxnet0: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether XX:XX:XX:00:00:00
vboxnet1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether XX:XX:XX:00:00:01
inet 192.168.99.1 netmask 0xffffff00 broadcast 192.168.99.255
Node-1:
2017-09-21 12:52:20.882 DEBUG 74783 --- [ main] c.h.i.cluster.impl.MulticastJoiner : [192.168.99.1]:5701 [OSMAN] [3.8.4] PostJoin master: [192.168.99.1]:5701, isMaster: true
2017-09-21 12:52:20.882 INFO 74783 --- [ main] c.h.i.cluster.impl.MulticastJoiner : [192.168.99.1]:5701 [OSMAN] [3.8.4]
Members [1] {
Member [192.168.99.1]:5701 - c38919ff-d992-4d2e-a7f8-afaae146e5d5 this
}
2017-09-21 12:52:20.906 INFO 74783 --- [ main] com.hazelcast.core.LifecycleService : [192.168.99.1]:5701 [OSMAN] [3.8.4] [192.168.99.1]:5701 is STARTED
Node-2:
2017-09-21 12:52:21.513 DEBUG 74800 --- [ main] c.h.i.cluster.impl.MulticastJoiner : [192.168.99.1]:5702 [test-group] [3.8.4] PostJoin master: [192.168.99.1]:5702, isMaster: true
2017-09-21 12:52:21.513 INFO 74800 --- [ main] c.h.i.cluster.impl.MulticastJoiner : [192.168.99.1]:5702 [test-group] [3.8.4]
Members [1] {
Member [192.168.99.1]:5702 - e21bbd01-b55f-4e6e-8a04-eff4402e300a this
}
2017-09-21 12:52:21.513 WARN 74800 --- [ main] com.hazelcast.instance.Node : [192.168.99.1]:5702 [test-group] [3.8.4] Config seed port is 5701 and cluster size is 1. Some of the ports seem occupied!
Hazelcast Configuration:
@Bean
public Config hazelCastConfig() {
Config config = new Config();
config.getGroupConfig().setName("test-group");
config.getGroupConfig().setPassword("test-password");
config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(false);
config.getNetworkConfig().getJoin().getAwsConfig().setEnabled(false);
config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(true);
return config;
}