This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Setting Up Open Banking API Manager Deployment
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 distributed deployment concepts, see Understanding the Distributed Deployment of WSO2 API Manager.
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 2.0.0 deployment, users can skip the steps mentioned below.
Configuring the user store
Configuring the datasources
Mounting the registry
Changing hostnames and ports
Configure the API Manager node1 using the following steps.
Go to the
<WSO2_OB_APIM_HOME>/repository/conf/deployment.toml
file and configure the proxy ports as follows:[transport.http.properties] port="9443" proxyPort="443" [transport.https.properties] port="9763" proxyPort="80"
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
<WSO2_OB_APIM_HOME>/repository/conf/deployment.toml
file and define the hostname for your server.[server] hostname = "wso2.obapim.com"
This hostname is used by the WSO2 OB APIM cluster. It must be specified in the
/etc/hosts
file as:127.0.0.1 wso2.obapim.com
Open the
<WSO2_OB_APIM_HOME>/repository/conf/deployment.toml
file and configure the following:
Locate the
[apim.devportal]
property and add theurl
tag to configure the Store URL, which is used to access the Store web app from the Publisher application.Locate the
[[apim.gateway.environment]]
tag and add the given properties to configure the environment by defining the endpoint URL for both the REST APIs and Web Socket (WS) APIs that are hosted in the API Gateway.[[apim.gateway.environment]] type = "hybrid" display_in_api_console = true http_endpoint = "http://gateway.wso2.com" https_endpoint = "https://gateway.wso2.com" ws_endpoint = "ws://gateway.wso2.com"
Generate a keystore, export the public certificate from the keystore, and import that certificate to the
client-truststore.jks
file.
For more information, see Creating New Keystores in the WSO2 Administration Guide.
Follow all the configuration steps that were done in node1 for node2 as well.
Enabling artifact synchronization
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
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.Different nodes are separated by newlines.
workers-list.txtubuntu@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
Create a file to synchronize the
<WSO2_OB_APIM_HOME>/repository/deployment/server
folders between the manager and all worker nodes.You must create your own SSH key and define it as the
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 themanager_server_dir
depending on the location in your local machine. Change thelogs.txt
file path and the lock location based on where they are located in your machine.rsync-for-carbon-depsync.sh#!/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
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.
* * * * * /home/ubuntu/setup/rsync-for-depsync/rsync-for-depsync.sh
Configuring the Proxy Server and the Load Balancer
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.
Create a SSL certificate for the load balancer
This step is only applicable for a High Availablity (HA) setup where multiple nodes are fronted by a 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.
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.
Starting up and verifying product nodes
If both nodes are running on the same server, set the port offset to avoid port conflicts.
Start Nginx.
Go to
<WSO2_OB_APIM_HOME>/bin
and start the nodes using the following command on both nodes:./wso2server.sh
Access the Management console using the following URL:
https://wso2.obapim.com/carbon.