This page guides you through setting up a clustered deployment of WSO2 Open Banking API Manager. You can install multiple instances of WSO2 products in a cluster to ensure that if one instance becomes unavailable or is experiencing high traffic, another instance will seamlessly handle the requests. For complete information on clustering concepts, see Clustering Overview in the Common Product Administration Guide . Creating a cluster of WSO2 Open Banking API Manager instances involves a standard two-node cluster. To ensure that the instances share governance registry artifacts, you must create a JDBC mount.
At a high level, use the given options to cluster API Manager with a minimum of two nodes. The first section includes instructions on setting up databases. The second section involves setting up a standard two node cluster, the third section involves setting up the API Manager server in a clustered environment and additional configurations if you need to set up a load balancer to front your cluster.
In a standard WSO2 Open Banking 1.4.0 deployment, users can skip the steps mentioned below.
Configuring the user store
Configuring the datasources
Mounting the registry
Configure the API Manager node1 using the following steps. Go to the By default, WSO2 products identify the hostname of the current machine through the Java API. However, this value sometimes yields erroneous results in some environments. Therefore, users are recommended to configure hostname. The following procedure explains how to change the hostname and management hostname of WSO2 OB APIM as required for your production environment. Open the This hostname is used by the WSO2 OB APIM cluster. It must be specified in the Open the Configure the Store URL, which is used to access the Store web app from the Publisher application. Configure the Publisher URL, which is the URL that is used to access the tenant Store and public Store. Configure the environment configurations by defining the endpoint URL for both the REST APIs and Web Socket (WS) APIs that are hosted in the API Gateway. Generate a keystore, export the public certificate from the keystore, and import that certificate to the Follow all the configuration steps that were done in node1 for node2 as well. Deployment artifact synchronization can be done using rsync, which is a file copying tool. These changes must be done in the manager node and in the same directory. Create a file named Different nodes are separated by new lines. Create a file to synchronize the You must create your own SSH key and define it as the Create a Cron job that executes the above file every minute for deployment synchronization. Do this by running the following command in your command line. You can only run the Cron job on one given node (master) at a given time. If you switch the Cron job to another node, you must stop the Cron job on the existing node and start a new Cron job on the new node after updating it with the latest files. A load balancer or reverse proxy is required to map external traffic with ports and URLs that WSO2 APIM uses internally. Follow the instructions below to configure load balancing together with reverse proxying. This step is only applicable for a High Availablity (HA) setup where multiple nodes are fronted by a load balancer. Although the following section instructs you to use NGINX as the load balancer, you can use any load balancer in your deployment based on your preference. If both nodes are running on the same server, set the port offset to avoid port conflicts. Start Nginx. Go to Access the Management console using the following URL: Changing hostnames and ports
<WSO2_OB_APIM_HOME>/repository/conf/tomcat/catalina-server.xml
file and configure the proxy ports as follows:<Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="9443" proxyPort="443"
<Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="9763" proxyPort="80"
<WSO2_OB_APIM_HOME>/repository/conf/carbon.xml
file and set the HostName
and MgtHostName
property as shown below./etc/hosts
file as:127.0.0.1 wso2.obapim.com
<WSO2_OB_APIM_HOME>/repository/conf/api-manager.xml
file and set the HostName
and MgtHostName
property as shown below. client-truststore.jks
file.
For more information, see Creating New Keystores in the WSO2 Administration Guide.Enabling artifact synchronization
workers-list.txt
, somewhere in your machine, that lists all the worker nodes in the deployment. The following is a sample of the file where there are two worker nodes.ubuntu@192.168.1.1:~/setup/192.168.1.1/as/as_worker/repository/deployment/server
ubuntu@192.168.1.2:~/setup/192.168.1.2/as/as_worker/repository/deployment/server
<WSO2_OB_APIM_HOME>/repository/deployment/server
folders between the manager and all worker nodes.pem_file
. Alternatively, you can use an existing SSH key. For information on generating and using the SSH Keys, go to the SSH documentation. Specify the manager_server_dir
depending on the location in your local machine. Change the logs.txt
file path and the lock location based on where they are located in your machine.#!/bin/sh
manager_server_dir=~/wso2as-5.2.1/repository/deployment/server/
pem_file=~/.ssh/carbon-440-test.pem
#delete the lock on exit
trap 'rm -rf /var/lock/depsync-lock' EXIT
mkdir /tmp/carbon-rsync-logs/
#keep a lock to stop parallel runs
if mkdir /var/lock/depsync-lock; then
echo "Locking succeeded" >&2
else
echo "Lock failed - exit" >&2
exit 1
fi
#get the workers-list.txt
pushd `dirname $0` > /dev/null
SCRIPTPATH=`pwd`
popd > /dev/null
echo $SCRIPTPATH
for x in `cat ${SCRIPTPATH}/workers-list.txt`
do
echo ================================================== >> /tmp/carbon-rsync-logs/logs.txt;
echo Syncing $x;
rsync --delete -arve "ssh -i $pem_file -o StrictHostKeyChecking=no" $manager_server_dir $x >> /tmp/carbon-rsync-logs/logs.txt
echo ================================================== >> /tmp/carbon-rsync-logs/logs.txt;
done
* * * * * /home/ubuntu/setup/rsync-for-depsync/rsync-for-depsync.sh
Configuring the Proxy Server and the Load Balancer
Create a SSL certificate for the load balancer
Configure the load balancer/reverse proxy server
In the following instructions, you are instructed to use NGINX to handle the load balancing requirements.Starting up and verifying product nodes
<WSO2_OB_APIM_HOME>/bin
and start the nodes using the following command on both nodes:./wso2server.sh
https://wso2.obapim.com/carbon/
openbank_am_configdb