Versions Compared

Key

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

This topic is based on the worker/manager clustering pattern you choose. Note that this page describes using WSO2 Elastic Load Balancer (ELB), but you can use a third-party load balancer in its place (for configuration details, see your load balancer's documentation).

...

In this scenario, we are using WSO2 ELB for the load balancer (you can also use a third-party load balancer; for details on configuration, see your load balancer's documentation). You configure the ELB with the overall definition of the cluster and how it should distribute the load. You can achieve this by adding a few lines to a configuration file called loadbalancer.conf. You specify the detailed clustering configurations in the axis2.xml file. This section describes how to perform these steps.

Info

The system should have at least two Well-known Address (WKA) members in order to work correctly and to recover if a single WKA member fails. The member can either be another ELB or another manager or worker node.

Refer to Configuring the Load Balancer to follow instructions on how to set up the WSO2 ELB in your cluster.

...

  1. Open <ESB_MANAGER_HOME>/repository/conf/carbon.xml.
  2. Locate the <Ports> tag and change the value of its sub-tag to: 
    <Offset>1</Offset>
  3. Locate the <HOSTNAME> tag and add the cluster host name: 
    <HostName>esb.cloud-test.wso2.com</HostName>
  4. Locate the <MgtHostName> tag and uncomment it. Make sure that the management host name is defined as follows:
    <MgtHostName>mgt.wso2.org</MgtHostName> 

In the next section, we will map the host names we specified to real IPs.

...

  1. Open the <ESB_HOME>/repository/conf/axis2/axis2.xml file.
  2. Locate the Clustering section and verify or configure the properties as follows (some of these properties are already set correctly by default):
    • Enable clustering for this node: 
      <clustering class="org.wso2.carbon.core.clustering.hazelcast.HazelcastClusteringAgent" enable="true">
    • Set the membership scheme to wka to enable the Well Known Address registration method (this node will send cluster initiation messages to WKA members that we will define later): 
      <parameter name="membershipScheme">wka</parameter>
    • Specify the name of the cluster this node will join: 
      <parameter name="domain">wso2.esb.domain</parameter>
    • Specify the port used to communicate cluster messages (if this node is on the same server as the ELB, manager node, or another worker node, be sure to set this to a unique value, such as 4000 and 4001 for worker nodes 1 and 3 and 4002 for worker node 2, which is on the same server as the ELB and manager node): 
      <parameter name="localMemberPort">4000</parameter>
      Note: This port number will not be affected by the port offset in carbon.xml. If this port number is already assigned to another server, the clustering framework will automatically increment 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.
    • Add a new property "subDomain" and set it to "worker" to denote that this node belongs to worker subdomain of the cluster as defined in loadbalancer.conf.

      Code Block
      languagehtml/xml
      <parameter name="properties">
                  <property name="backendServerURL" value="https://${hostName}:${httpsPort}/services/"/>
                  <property name="mgtConsoleURL" value="https://${hostName}:${httpsPort}/"/>
                  <property name="subDomain" value="mgt"/>
                  <property name="port.mapping.8290" value="9763"/>
      </parameter>
    • Define the ELB and manager nodes as well-known members of the cluster by providing their host name and localMemberPort values. The manager node is defined here because it is required for the Deployment Synchronizer to function.

      Code Block
      languagehtml/xml
      <members>
          <member>
              
  • <hostName>elb
    • <hostName>xxx.xxx.
  • wso2
    • xxx.
  • com<
    • xxx</hostName>
              <port>5000</port>
          </member>
          <member>
              <hostName>mgt.esb.wso2.com</hostName>
              <port>4001</port>
          </member>
      </members>

Adjusting the port offset

...

We have now finished configuring the worker nodes and are ready to start them.

Info

If you want to remove all UI components from the worker nodes you need to run the ant createWorker task before you start the worker nodes. Note that this will remove management console capability from worker nodes.

Starting the ESB server

Start the ESB server by typing the following command in the terminal:

...