3 Replies Latest reply on Jun 22, 2003 12:48 AM by ivelin.ivanov

    Master Node

    darranl

      I am trying to implement a clustered service that will be installed on all of the nodes in my cluster.

      One of the nodes will be the master node and will be responsible for processing all requests, the remaining nodes will do nothing and one will take over if the master fails.

      I am planning to use the distributed replicant manager and the isMasterReplica method to identify which node is the master. (I have started a different thread to discuss getting this to work but at the moment I am assuming that I will be able to get it to work).

      One possibility that I have thought of to get only the master node to process the request is to call callMethodOnCluster, each node will then check if it is the master - if it is it will process the request, otherwise it will return null. Sending a message to nodes that we can tell will not process the request seems quite inefficient.

      The second idea that I had was to use HA-RMI and implement a new LoadBalancePolicy that would always pick the master node using the same logic as isMasterReplica.

      Looking at the implementation of HARMIClient this is not going to work, if a local instance of the service is registered the local instance will always be used and the LoadBalancePolicy will be ignored.

      Does anyone have any other ideas on how to route requests to a master node?