Wednesday, May 14, 2008

Static cluster membership for Axis2 & WSO2 Products

I just added this feature to Axis2. Now all WSO2 products can be configured to use static membership. The most common method of membership management and membership discovery is multicast based schemes. However, it is not always possible to rely on multicasting. On Amazon EC2, multicast-based membership management is not possible since multicasting is dissallowed. Hence a static membership management scheme is necessary. In fact, this is the first step towards making WSO2 products scale on Amazon EC2.

Static membership is configured in the axis2.xml file. You need to locate the "cluster" XML element in this file. Next find the "membershipScheme" parameter and set it to "wka". wka stands for Well-Known Address.

<parameter name="membershipScheme">wka</parameter>

You need to define the values of the "tcpListenHost" and "tcpListenPort" entries. The listen host is the name or IP address of this member. (i.e. the member on which this axis2.xml file resides)


<parameter name="tcpListenHost">host0</parameter>
<parameter name="tcpListenPort">4000</parameter>


After the declaring the cluster level parameters, you can define the list of static members as follows:


<members>
<member>
<hostname>host1</hostname>
<port>4000</port>
</member>
<member>
<hostname>host2</hostname>
<port>4001</port>
</member>
</members>


host0, host1 & host2 are the machine names. That is it. Restart the nodes after configuring them as described above.

When members in this list join or leave the group, each node will automatically detect it. This is done using a periodic TCP ping.

0 comments: