Martin Fowler
Solution
One of the common techniques used in peer-to-peer systems is to order cluster nodes according to their ‘age’. The oldest member of the cluster plays the role of the coordinator for the cluster. The coordinator is responsible for deciding on membership changes as well as making decisions such as where Fixed Partitions should be placed across cluster nodes.
To form the cluster, one of the cluster nodes acts as a seed node or an introducer node. All the cluster nodes join the cluster by contacting the seed node.
Every cluster node is configured with the seed node address. When a cluster node is started, it tries to contact the seed node to join the cluster.
class ClusterNode…
MembershipService membershipService; public void start(Config config) { this.membershipService = new MembershipService(config.getListenAddress()); membershipService.join(config.getSeedAddress()); }
The seed node could be any of the cluster nodes.
To read the full article click on the 'post' link at the top.