Important: When configuring your WSO2 products for clustering, it is necessary to use a specific IP address and not localhost or host names in your configurations. So, keep this in mind when hosting WSO2 products in your production environment.
See Setting up Up a Cluster in AWS Mode for information on clustering WSO2 products that are deployed on Amazon EC2 instances. The instructions in that topic only include the configurations done to the
- Restart the configured load balancer.
- Start the manager node. The additional
-Dsetupargument creates the required tables in the database if these were not created while setting up the databases.
sh <PRODUCT_HOME>/bin/wso2server.sh -Dsetup
-DworkerNode=falseflag is included in the startup script
wso2server.batfor Windows). So, to start the server as a worker node, you must modify this flag directly in the startup script. It is
falseby default so it must be set to
trueas shown below. The
-DworkerNode=trueargument indicates that this is a worker node. This parameter basically makes a server read-only. A node with this parameter will not be able to do any changes such as writing or making modifications to the deployment repository etc. This parameter also enables the worker profile, where the UI bundles will not be activated and only the back end bundles will be activated once the server starts up.
Start the two worker nodes.
Tip: It is recommendation is to delete the
<PRODUCT_HOME>/repository/deployment/serverdirectory and create an empty server directory in the worker node. This is done to avoid any SVN conflicts that may arise.
Check for ‘member joined’ log messages in all consoles.
Info title Additional information on logs and new nodes
When you terminate one node, all nodes identify that the node has left the cluster. The same applies when a new node joins the cluster.
If you want to add another new worker node, you can simply copy worker1 without any changes if you are running it on a new server (such as xxx.xxx.xxx.184). If you intend to use the new node on a server where another WSO2 product is running, you can use a copy of worker1 and change the port offset accordingly in the
carbon.xmlfile. You also have to change
axis2.xmlif that product has clustering enabled. Be sure to map all host names to the relevant IP addresses when creating a new node. The log messages indicate if the new node joins the cluster.
- Access management console through the LB using the following URL: https://xxx.xxx.xxx.xx1:443/carbon
Test load distribution via http://xxx.xxx.xxx.xx1:80/.