This documentation is for older versions of WSO2 products and may not be relevant now. Please see your respective product documentation for clustering details and configurations.

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


  1. Download and unzip the WSO2 AS binary distribution. Consider the extracted directory as <PRODUCT_HOME>.
  2. Set up the cluster configurations. Edit the <PRODUCT_HOME>/repository/conf/axis2/axis2.xml file as follows.
    1. Enable clustering for this node: 
      <clustering class="org.wso2.carbon.core.clustering.hazelcast.HazelcastClusteringAgent" enable="true">
    2. Set the membership scheme to wka to enable the well-known address registration method (this node sends cluster initiation messages to the WKA members that we define later). 
      <parameter name="membershipScheme">wka</parameter>
    3. Specify the name of the cluster this node will join.
      <parameter name="domain"></parameter>
    4. Specify the host used to communicate cluster messages.
      <parameter name="localMemberHost"></parameter>
    5. Specify the port used to communicate cluster messages. This port number is not affected by the port offset value specified in the <PRODUCT_HOME>/repository/conf/carbon.xml. If this port number is already assigned to another server, the clustering framework automatically increments this port number. However, if two servers are running on the same machine, you must ensure that a unique port is set for each server.
      <parameter name="localMemberPort">4100</parameter>

    6. Specify the well known members. In this example, the well known member is a worker node. The port value for the WKA worker node must be the same value as it's localMemberPort (in this case 4200).

      Code Block

      Although this example only indicates one well-known member, it is recommended to add at least two well-known members here. This is done to ensure that there is high availability for the cluster.

      You can also use IP address ranges for the hostName. For example, This should ensure that the cluster eventually recovers after failures. One shortcoming of doing this is that you can define a range only for the last portion of the IP address. You should also keep in mind that the smaller the range, the faster the time it takes to discover members, since each node has to scan a lesser number of potential members.

    7. Change the following clustering properties. Ensure that you set the value of the subDomain as mgt to specify that this is the manager node. This ensures that traffic for the manager node is routed to this member.

      Code Block
      <parameter name="properties">
                  <property name="backendServerURL" value="https://${hostName}:${httpsPort}/services/"/>
                  <property name="mgtConsoleURL" value="https://${hostName}:${httpsPort}/"/>
                  <property name="subDomain" value="mgt"/>
  3. Configure the HostName. To do this, edit the <PRODUCT_HOME>/repository/conf/carbon.xml file as follows.

    Code Block
  4. Enable SVN-based deployment synchronization with the AutoCommit property marked as true. To do this, edit the <PRODUCT_HOME>/repository/conf/carbon.xml file as follows. See Configuring Deployment Synchronizer for more information on this.

    Code Block
  5. In the <PRODUCT_HOME>/repository/conf/carbon.xml file, you can also specify the port offset value. This is ONLY applicable if you have multiple WSO2 products hosted on the same server.

    titleClick here for more information on configuring the port offset.

    When you run multiple products/clusters or multiple instances of the same product on the same server or virtual machines (VMs), you must change their default ports with an offset value to avoid port conflicts. An offset defines the number by which all ports in the runtime (e.g., HTTP/S ports) are increased. For example, if the default HTTP port is 9763 and the offset is 1, the effective HTTP port will change to 9764. For each additional product instance, you set the port offset to a unique value. The offset of the default ports is considered to be 0.

    The port value will automatically be increased as shown in the Port Value column in the following table, allowing all five WSO2 product instances or servers to run on the same machine.

    WSO2 product instance

    Port Offset

    Port Value

    WSO2 server 1



    WSO2 server 2



    WSO2 server 3



    WSO2 server 4



    WSO2 server 5




    Important: This step is optional and only required if all server instances are running in the same machine. This is not a recommended approach for production environments. Note that you need to change all ports used in your configurations based on the offset value if you are to do this.

    Code Block
  6. If the manager node is not placed behind a load balancer, you must configure the proxy port of the worker node in the <PRODUCT_HOME>/repository/conf/carbon.xml file. You must also configure the host name of the worker node. So, when the manager node is accessed through the management console, and it is necessary to direct the client to the load balancer, the manager node must know the proxy port and host name of the worker node.These configurations help in achieving this. This is particularly useful when sending a request to a web application through a link provided in management console. The following is a sample configuration of how the proxy port of the worker node is configured.

    Code Block

    The following is a sample configuration for the host name of the worker node.

    Code Block
  7. Map the host names to the IP. Add the below host entries to your DNS, or “/etc/hosts” file (in Linux) in all the nodes of the cluster. You can map the IP address of the database server. In this example, MySQL is used as the database server, so <MYSQL-DB-SERVER-IP> is the actual IP address of the database server.

    Code Block
  8. Allow access the management console only through the load balancer. Configure the HTTP/HTTPS proxy ports to communicate through the load balancer by editing the <PRODUCT_HOME>/repository/conf/tomcat/catalina-server.xml file as follows.

    Code Block
    <Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
    <Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
    titleClick here for more information on this configuration.

    The Connector protocol tag sets the protocol to handle incoming traffic. The default value is HTTP/1.1, which uses an auto-switching mechanism to select either a blocking Java-based connector or an APR/native connector. If the PATH (Windows) or LD_LIBRARY_PATH (on most UNIX systems) environment variables contain the Tomcat native library, the APR/native connector will be used. If the native library cannot be found, the blocking Java-based connector will be used. Note that the APR/native connector has different settings from the Java connectors for HTTPS.

    The non-blocking Java connector used is an explicit protocol that does not rely on the auto-switching mechanism described above. The following is the value used:

    The TCP port number is the value that this Connector will use to create a server socket and await incoming connections. Your operating system will allow only one server application to listen to a particular port number on a particular IP address. If the special value of 0 (zero) is used, Tomcat will select a free port at random to use for this connector. This is typically only useful in embedded and testing applications.