Hazelcast Cluster Setup

HazelCast Cluster Setup

What is Hazelcast?

Hazelcast is an in-memory data grid that provides distributed computing capabilities. It allows multiple nodes to work together as a single, seamless cluster, offering features like distributed caching, processing, and data storage. Hazelcast is highly scalable, resilient, and ideal for building real-time applications.


Objective

To form a Hazelcast cluster on staging virtual machines (VMs) by configuring firewalls and verifying cluster formation through Tomcat logs.


Firewall Configuration

To allow communication between Hazelcast nodes, configure the firewall to open the required ports. Execute the following commands on all VMs:

ufw allow 6000:6999/tcp
ufw allow 54321/tcp
ufw reload

This ensures that Hazelcast’s default communication and cluster discovery ports are open.


Verifying Cluster Formation

Once the firewall is configured and Hazelcast is started, check the Tomcat log file (catalina.out) for cluster formation details. Typical entries in catalina.out include:

27-Dec-2024 16:13:39.260 INFO [hz.ps_sb_cs.cached.thread-11] com.hazelcast.internal.server.tcp.TcpServerConnector.null [172.21.0.63]:6501 [ps_sb_cs] [5.3.8] Connecting to /172.21.0.64:6501, timeout: 10000, bind-any: false
27-Dec-2024 16:13:39.264 INFO [hz.ps_sb_cs.IO.thread-in-1] com.hazelcast.internal.server.tcp.TcpServerConnection.null [172.21.0.63]:6501 [ps_sb_cs] [5.3.8] Initialized new cluster connection between /172.21.0.63:56675 and /172.21.0.64:6501
27-Dec-2024 16:13:44.279 INFO [hz.ps_sb_cs.priority-generic-operation.thread-0] com.hazelcast.internal.cluster.ClusterService.null [172.21.0.63]:6501 [ps_sb_cs] [5.3.8]

Members {size:6, ver:6} [
        Member [172.21.0.64]:6501 - f77ec24f-c906-4b1d-b6b7-28f826446044
        Member [172.21.0.62]:6501 - fe33561d-2615-41b6-84a4-5340a83c5f28
        Member [172.21.0.65]:6501 - 0ad9ee40-0db6-4d16-a0b3-a2d079971f3f
        Member [172.21.0.66]:6501 - 7d89d843-6929-48dd-94bb-706667cb42e1
        Member [172.21.0.61]:6501 - 3be34f80-2865-4b83-97fb-5f3c70497c60
        Member [172.21.0.63]:6501 - 0a01d8ae-832f-4b7e-bfb7-c05c129ef6f4 this
]

This indicates that the cluster has been successfully formed, with all members listed.


Cluster Details

  • Local Data Center Nodes: 5 nodes with the following IPs:

    • 172.21.0.61
    • 172.21.0.62
    • 172.21.0.63
    • 172.21.0.64
    • 172.21.0.65
  • Remote Node: 1 node in the PI data center (connected via VPN):

    • 172.21.0.66

Conclusion

The logs confirm that all nodes are part of the Hazelcast cluster. The configuration supports 5 nodes in the local data center and 1 node in the PI data center connected via VPN. Ensure all nodes remain online and properly configured to maintain cluster integrity.

Hazelcast Cluster Setup Documentation

What is Hazelcast?

Hazelcast is an in-memory data grid that provides distributed computing capabilities. It allows multiple nodes to work together as a single, seamless cluster, offering features like distributed caching, processing, and data storage. Hazelcast is highly scalable, resilient, and ideal for building real-time applications.

Objective

To form a Hazelcast cluster on staging virtual machines (VMs) by configuring firewalls and verifying cluster formation through Tomcat logs.

Firewall Configuration

To allow communication between Hazelcast nodes, configure the firewall to open the required ports. Execute the following commands on all VMs:

ufw allow 6000:6999/tcp
ufw allow 54321/tcp
ufw reload

This ensures that Hazelcast’s default communication and cluster discovery ports are open.

Verifying Cluster Formation

Once the firewall is configured and Hazelcast is started, check the Tomcat log file (catalina.out) for cluster formation details. Typical entries in catalina.out include:

27-Dec-2024 16:13:39.260 INFO [hz.ps_sb_cs.cached.thread-11] com.hazelcast.internal.server.tcp.TcpServerConnector.null [172.21.0.63]:6501 [ps_sb_cs] [5.3.8] Connecting to /172.21.0.64:6501, timeout: 10000, bind-any: false
27-Dec-2024 16:13:39.264 INFO [hz.ps_sb_cs.IO.thread-in-1] com.hazelcast.internal.server.tcp.TcpServerConnection.null [172.21.0.63]:6501 [ps_sb_cs] [5.3.8] Initialized new cluster connection between /172.21.0.63:56675 and /172.21.0.64:6501
27-Dec-2024 16:13:44.279 INFO [hz.ps_sb_cs.priority-generic-operation.thread-0] com.hazelcast.internal.cluster.ClusterService.null [172.21.0.63]:6501 [ps_sb_cs] [5.3.8]

Members {size:6, ver:6} [
        Member [172.21.0.64]:6501 - f77ec24f-c906-4b1d-b6b7-28f826446044
        Member [172.21.0.62]:6501 - fe33561d-2615-41b6-84a4-5340a83c5f28
        Member [172.21.0.65]:6501 - 0ad9ee40-0db6-4d16-a0b3-a2d079971f3f
        Member [172.21.0.66]:6501 - 7d89d843-6929-48dd-94bb-706667cb42e1
        Member [172.21.0.61]:6501 - 3be34f80-2865-4b83-97fb-5f3c70497c60
        Member [172.21.0.63]:6501 - 0a01d8ae-832f-4b7e-bfb7-c05c129ef6f4 this
]

This indicates that the cluster has been successfully formed, with all members listed.

Cluster Details
  • Local Data Center Nodes: 5 nodes with the following IPs:

    • 172.21.0.61
    • 172.21.0.62
    • 172.21.0.63
    • 172.21.0.64
    • 172.21.0.65
  • Remote Node: 1 node in the PI data center (connected via VPN):

    • 172.21.0.66

The logs confirm that all nodes are part of the Hazelcast cluster. The configuration supports 5 nodes in the local data center and 1 node in the PI data center connected via VPN. Ensure all nodes remain online and properly configured to maintain cluster integrity.