The Artima Developer Community
Sponsored Link

Java Buzz Forum
Hazelcast Internals 3: Cluster Membership

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Talip Ozturk

Posts: 103
Nickname: talip
Registered: May, 2003

Talip Ozturk is founder of Hazelcast, distributed queue, set, map and lock implementation.
Hazelcast Internals 3: Cluster Membership Posted: Apr 13, 2009 3:44 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Talip Ozturk.
Original Post: Hazelcast Internals 3: Cluster Membership
Feed Title: Shared Memory
Feed URL: http://www.jroller.com/talipozturk/feed/entries/rss
Feed Description: about java, jcache, jini, javaspaces, distributed data structures and a little bit of me and life.
Latest Java Buzz Posts
Latest Java Buzz Posts by Talip Ozturk
Latest Posts From Shared Memory

Advertisement
It is important to note that Hazelcast is a peer to peer clustering so there is no 'master' kind of server in Hazelcast. Every member in the cluster is equal and has the same rights and responsibilities.

When a node starts up, it will check to see if there is already a cluster in the network. There are two ways to find this out:

  1. Multicast discovery: If multicast discovery is enabled (that is the defualt) then the node will send a join request in the form of a multicast datagram packet.
  2. Unicast discovery: if multicast discovery is disabled and tcp/ip join is enabled then the node will try to connect to he IPs defined in the hazelcast.xml configuration file. If it can successfully connect to at least one node, then it will send a join request through the TCP/IP connection.

If there is no existing node, then the node will be the first member of the cluster. If multicast is enabled then it will start a multicast listener so that it can respond to incoming join requests. Otherwise it will listen for join request coming via TCP/IP.

If there is an existing cluster already, meaning, then the oldest member in the cluster will receive the join request and check if the request is for the right group. If so, the oldest member in the cluster will start the join process.

In the join process, the oldest member will:

  • send the new member list to all members
  • tell members to sync data in order to balance the data load

Every member in the cluster has the same member list in the same order. First member is the oldest member so if the oldest member dies, second member in the list becomes the first member in the list and the new oldest member.

See com.hazelcast.impl.Node and com.hazelcast.impl.ClusterManager for details.

Q. If, let say 50+, nodes are trying to join the cluster at the same time, are they going to join the cluster one by one? No. As soon as the oldest member receives the first valid join request, it will wait 5 seconds for others to join so that it can join multiple members in one shot. If there is no new node willing to join for the next 5 seconds, then oldest member will start the join process.

If a member leaves the cluster though, because of a JVM crash for example, cluster will immediately take action and oldest member will start the data recovery process.

Read: Hazelcast Internals 3: Cluster Membership

Topic: How Fast Can Android App Prototype be Produced? Previous Topic   Next Topic Topic: Germany fines Microsoft for anti-competitive pricing

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use