This documentation is for older WSO2 products. View documentation for the latest release.
Setting up a Cluster in AWS Mode - Clustering Guide 4.2.0 - WSO2 Documentation
||
Skip to end of metadata
Go to start of metadata

When WSO2 products are deployed in a clustered mode on Amazon EC2 instances, it is recommended to use the AWS clustering mode. As a best practice, it is recommended to add all nodes in a single cluster to the same AWS security group.

To enable AWS clustering mode, you must edit the clustering section in the <PRODUCT_HOME>/repository/conf/axis2/axis2.xml file. When enabling AWS clustering mode, it is imperative that you do the steps in this topic, in addition to the steps you follow in the Setting up a Cluster topic for other configuration files.

Open the <PRODUCT_HOME>/repository/conf/axis2/axis2.xml file and do the following changes.

  1. Enable clustering for this server. 
    <clustering class="org.wso2.carbon.core.clustering.hazelcast.HazelcastClusteringAgent" enable="true">
  2. Set the membership scheme to aws to enable the AWS registration method. 
    <parameter name="membershipScheme">aws</parameter>
  3. Specify the port used to communicate cluster messages. This must be any port number between 5701 and 5800.
    <parameter name="localMemberPort">5701</parameter>
  4. Define the following AWS specific configurations. These are the AWS access key, secret key, security group, region, tag key and tag value. The AWS credentials and security group depend on your configurations in the Amazon EC2 instance. The regiontagKey and tagValue are optional and the region defaults to us-east-1.

    <parameter name="accessKey">xxxxxxxxxx</parameter>
    <parameter name="secretKey">yyyyyyyyyy</parameter>
    <parameter name="securityGroup">a_group_name</parameter>
    <parameter name="region">us-east-1</parameter>  
    <parameter name="tagKey">a_tag_key</parameter>  
    <parameter name="tagValue">a_tag_value</parameter>  
  5. Start the server as per the instructions in the Setting up a Cluster topic. If the cluster is set up successfully, you should not see any errors when the server starts up, and also see the following log message.

    [2015-06-23 09:26:41,674]  INFO - HazelcastClusteringAgent Using aws based membership management scheme

    When new members join the cluster, you should see messages similar to the following.

    [2015-06-23 09:27:08,044]  INFO - AWSBasedMembershipScheme Member joined [5327e2f9-8260-4612-9083-5e5c5d8ad567]: /10.0.0.172:5701 

    When members leave the cluster, you should see messages similar to the following.

    [2015-06-23 09:28:34,364]  INFO - AWSBasedMembershipScheme Member left [b2a30083-1cf1-46e1-87d3-19c472bb2007]: /10.0.0.245:5701
 Click here to view a sample of the configurations in the axis2.xml file.
<clustering class="org.wso2.carbon.core.clustering.hazelcast.HazelcastClusteringAgent" enable="true">  
        <parameter name="AvoidInitiation">true</parameter>  
        <parameter name="membershipScheme">aws</parameter>  
        <parameter name="domain">wso2.carbon.domain</parameter>  
  
        <parameter name="localMemberPort">5701</parameter>  
        <parameter name="accessKey">xxxxxxxxxxxx</parameter>  
        <parameter name="secretKey">yyyyyyyyyyyy</parameter>  
        <parameter name="securityGroup">a_group_name</parameter>  
        <parameter name="region">us-east-1</parameter>  
        <parameter name="tagKey">a_tag_key</parameter>  
        <parameter name="tagValue">a_tag_value</parameter>   
  
        <parameter name="properties">  
            <property name="backendServerURL" value="https://${hostName}:${httpsPort}/services/"/>  
            <property name="mgtConsoleURL" value="https://${hostName}:${httpsPort}/"/>  
            <property name="subDomain" value="worker"/>  
        </parameter>  
 </clustering>
  • No labels