Discovery Mechanisms

A Hazelcast cluster is a network of cluster members that run Hazelcast. Cluster members automatically join together to form a cluster. This automatic joining takes place with various discovery mechanisms that the cluster members use to find each other.

Please note that, after a cluster is formed, communication between cluster members is always via TCP/IP, regardless of the discovery mechanism used.

Hazelcast uses the following discovery mechanisms.

Auto Detection

By default, Hazelcast tries to automatically detect a member’s runtime environment and apply rules to help members discover each other in those environments.

Auto Detection is not recommended for production.

Hazelcast can detect the following environments:

You do not need to explicitly enable the discovery for the above environments since the auto-detection, which is enabled by default, takes care of it. It can be configured using the auto-detection element as shown below.

  • XML

  • YAML

<hazelcast>
    ...
    <network>
        <join>
            <auto-detection enabled="true" />
            <multicast enabled="false">
            ...
        </join>
    </network>
    ...
</hazelcast>
hazelcast:
  network:
    join:
      auto-detection:
        enabled: true
      multicast:
          ...

If Hazelcast does not detect any of the aforementioned environments, it falls back to discovery using multicast.

TCP

You can configure Hazelcast to be a full TCP/IP cluster. See Discovering Members by TCP for configuration details.

Multicast

With this mechanism, Hazelcast allows cluster members to find each other using the multicast communication. See Discovering Members by Multicast.

If you prefer to use this mechanism, make sure that your network is secure. Since multicast packets are being broadcasted, any member from anywhere can join the cluster with the appropriate cluster name, so you have less control on the cluster.

Note also that if User Datagram Protocol (UDP) Multicast is blocked, as it is for most of the production environments, discovering with multicast does not work.

Hazelcast for Kubernetes

You can deploy a Hazelcast cluster to Kubernetes using Helm or Hazelcast Enterprise Edition Operator. See the Deploying in Kubernetes section.

Eureka Cloud Discovery

Hazelcast supports the Eureka V1 discovery. See the Cloud Discovery Plugins: Hazelcast Eureka section.

Zookeeper Cloud Discovery

This discovery mechanism provides a service based discovery strategy by using Apache Curator to communicate with your Zookeeper server. See the Cloud Discovery Plugins: Hazelcast Zookeeper section.