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.
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
as shown below.
<auto-detection enabled="true" />
If Hazelcast does not detect any of the aforementioned environments, it falls back to discovery using multicast.
You can configure Hazelcast to be a full TCP/IP cluster. See Discovering Members by TCP for configuration details.
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 supports the Eureka V1 discovery. See the Cloud Discovery Plugins: Hazelcast Eureka section.
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.