Search code examples
hazelcast

Separate address for clients


I have a hz cluster with all of the members in the same network but the clients are in a different network. The clients can connect to the members via a NAT'd address. Is there a way to get Hazelcast to pass out a separate IP address to clients. I am looking for something like that is applied only for clients.


Solution

  • You can achieve this using Advanced Network Configuration. The feature is available since Hazelcast 3.12. The code sample at https://github.com/hazelcast/hazelcast-code-samples/tree/master/network-configuration/advanced-network-configuration demonstrates how to configure your cluster members for such a scenario. The key point is that you should define the NAT'd member address as the publicAddress of your client protocol endpoint configuration.