Configure Cluster Membership

You need to configure cluster membership by specifying all other nodes in the cluster. Be sure not to include a node in its own cluster membership. If this were done, the node would sync to itself as if it were a different node in the cluster.

A cluster member is specified by a host & port combinations as shown below:<Member className="org.apache.catalina.tribes.membership.StaticMember" port="<PORT_NUMBER>" host="<HOST_NAME>"/>

Execute the instruction given below:
  1. Open file "server.xml" for editing.
  2. Find StaticMembershipInterceptor and add all other members of the cluster as shown below:

Host names for two nodes are node1.example.com & node1.example.com.n node 1 server.xml:

Sample configuration in node 1 server.xml:
 <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                    port="4110"
                    autoBind="9"
                    selectorTimeout="5000"
                    maxThreads="6"/>
<Interceptor     
className="org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor"><Member className="org.apache.catalina.tribes.membership.StaticMember"
	 port="4210"  host="node2.example.com"/>				
</Interceptor>
Sample configuration in node 2 server.xml:
<Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                    port="4210"
                    autoBind="9"
                    selectorTimeout="5000"
                    maxThreads="6"/>
<Interceptor 
className="org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor">
<Member className="org.apache.catalina.tribes.membership.StaticMember"
		  port="4110" host="node1.example.com"/>			  		
</Interceptor>
Note: You need to configure the cluster membership on all the nodes when adding a new node so that every node is aware of each other.