Hazelcast configuration

The current implementation uses Hazelcast for resolving cluster nodes. You can find detailed the Hazelcast configuration description on the Hazelcast site, here: Hazelcast Configuration.

If you want to override the default configuration you can:

Config hazelcastConfig = new Config();
// Now set some stuff on the config (omitted)
ClusterManager mgr = new HazelcastClusterManager(hazelcastConfig);

You can specify a name for the current node with the instanceName option. Otherwise, a unique name will be assigned automatically.

If the quorum size is not specified in the configuration, then the first launched node will be selected as a leader (primary) node.

Cluster service options

In addition to Hazelcast settings, in HazelcastClusterManager you can set the following property:

Also, additional properties can be placed in the Advanced Configuration Properties. You can find a detailed description in the Hazelcast documentation.

Before the leader has been re-elected, the cluster must contain a member count of greater than or equal to the amount specified by the quorum size property.

Replication configuration

For configuring the replication service, two configuration files are used:

Replication Service configuration

The Replication Service configuration is defined in the replication.properties file.

Aeron Media Driver configuration

Please find the description of the Aeron configuration options at its official page.

Cluster troubleshooting

If the default multicast configuration is not working, see below to read about some common causes.

Multicast is not enabled on the machine

It is quite common, in particular on OSX machines, for multicast to be disabled by default. Please google for the answer on how to enable that.

Using the wrong network interface

If you have more than one network interface on your machine (and this can also be the case if you are running VPN software on your machine), then Hazelcast may be using the wrong one.

To tell Hazelcast to use a specific interface, you can provide the IP address of the interface in the interfaces element of the configuration. Make sure you set the enabled attribute to true. For example:

<interfaces enabled="true">

When multicast is not available

In some cases, you may not be able to use multicast as it might not be available in your environment. In that case, you should configure another transport, for example, TCP to use TCP sockets, or AWS when running on Amazon EC2.

For more information on available Hazelcast transports and how to configure them, please consult the Hazelcast Configuration.