This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Clustering Cassandra in a Distributed Setup

You can create a Cassandra cluster using Storage Server nodes.

Axis2 clustering configurations

First you have to enable Axis2 clustering in each SS node. Change following configurations in the <SS_HOME>/repository/conf/axis2/axis2.xml file.

  • Enable Hazelcast-based Axis2 clustering.
    <clustering class="org.wso2.carbon.core.clustering.hazelcast.HazelcastClusteringAgent" enable="true">
  • Set the membership scheme to WKA.
    <parameter name="membershipScheme">wka</parameter>
     
  • Set local member host.
    <parameter name="localMemberHost">192.168.0.2</parameter>
     
  • Set local member port.
    <parameter name="localMemberPort">4000</parameter>
     
  • Set the well known members.

    <members>
                <member>
                    <hostName>192.168.0.2</hostName>
                    <port>4000</port>
                </member>
                <member>
                    <hostName>192.168.0.3</hostName>
                    <port>4001</port>
                </member>
                <member>
                    <hostName>192.168.0.4</hostName>
                    <port>4002</port>
                </member>
    </members>

    Here, you have to list all SS nodes with their localMemberHost and localMemberPort values, which you already configured in previous steps.

Cassandra connection related configurations

  1. Update the <SS_HOME>/repository/conf/etc/hector-config.xml in any node you plan to use as management node. Use the following configuration:

    <HectorConfiguration>
        <Cluster>
            <Name>ClusterOne</Name>
            <Nodes>192.168.0.2:9160,192.168.0.3:9160,192.168.0.4:9160</Nodes>
            <AutoDiscovery disable="true" delay="1000"/>
        </Cluster>
    </HectorConfiguration>

    Give all SS nodes with port 9160 as a comma separated list.

  2. Configure <SS_HOME>/repository/conf/etc/cassandra-endpoint.xml as follows by giving all host names of nodes.

    <Cassandra>
     <EndPoints>
        <EndPoint>
            <HostName>css0.stratoslive.wso2.com</HostName>
        </EndPoint>
        <EndPoint>
            <HostName>css1.stratoslive.wso2.com</HostName>
        </EndPoint>
        <EndPoint>
            <HostName>css2.stratoslive.wso2.com</HostName>
        </EndPoint>
     </EndPoints>
    </Cassandra>

Cassandra Cluster Monitoring and Node Operations related configurations

To view Cassandra cluster statistics and do cluster operations, <SS_HOME>/repository/conf/etc/cluster-config.xml needs to be configured. Here, all the SS nodes and their service URLs needs to be configured.

<cluster>
    <configuration>
        <cluster_authentication>
            <username>admin</username>
            <password>admin</password>
        </cluster_authentication>
        <nodes>
            <node>
                <host>192.168.0.2</host>
                <backend_url>https://192.168.0.2:9443/services/</backend_url>
            </node>
            <node>
                <host>192.168.0.3</host>
                <backend_url>https://192.168.0.3:9443/services/</backend_url>
            </node>
            <node>
                <host>192.168.0.4</host>
                <backend_url>https://192.168.0.4:9443/services/</backend_url>
            </node>
        </nodes>
    </configuration>
</cluster>