Docker swarm initializes service name as host name depends
on health check being configured, during hazelcast binding
docker might not have necessarily initialized service name as host
name and hence hazelcat Member binding fails.
To safegaurd hazelcast initialization during application startup
bind hazelcast based on network interface name,
Following is sample code snippet used for testing:
MemberAddressProviderConfig memberAddressProviderConfig =
new MemberAddressProviderConfig();
memberAddressProviderConfig.setEnabled(true);
memberAddressProviderConfig
.setImplementation(new DockerNetworkInterfaceBasedMemberAddressProvider(
memberAddressProviderProperties));
Docker swarm initializes service name as host name depends on health check being configured, during hazelcast binding docker might not have necessarily initialized service name as host name and hence hazelcat Member binding fails.
To safegaurd hazelcast initialization during application startup bind hazelcast based on network interface name, Following is sample code snippet used for testing:
MemberAddressProviderConfig memberAddressProviderConfig = new MemberAddressProviderConfig(); memberAddressProviderConfig.setEnabled(true); memberAddressProviderConfig .setImplementation(new DockerNetworkInterfaceBasedMemberAddressProvider( memberAddressProviderProperties));