Clustering the Business Process Profile

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/.

Clustering the Business Process Profile

The following sections give you information and instructions on how to cluster the business process profile of WSO2 EI with a third-party load balancer. 

The clustering deployment pattern

This pattern has two WSO2 EI nodes to serve service requests with high availability and scalability. It allows access to the Management Console through an external load balancer and directs service requests to nodes through this load balancer. The following image depicts the sample pattern this clustering deployment scenario will follow.

This pattern uses two nodes as well-known members. It is always recommended to have all nodes of the cluster as well-known members.

When configuring your WSO2 products for clustering to host them in your production environment, it is necessary to use a specific IP address and not localhost or host names in your configurations.

Configuring the load balancer

The load balancer automatically distributes incoming traffic across multiple WSO2 product instances. It enables you to achieve greater levels of fault tolerance in your cluster and provides the required balancing of load needed to distribute traffic.

Note the following facts when configuring the load balancer:

  • These configurations are not required if your clustering setup does not have a load balancer.

  • Load balancer ports are HTTP 80 and HTTPS 443 in the deployment pattern shown in the above diagram. If your system uses any other ports, be sure to replace 80 and 443 values with the corresponding ports when you follow the configuration steps in this section.

  • The load balancer directs requests to the server on a round robin basis. For example, the load balancer will direct requests to node 1 (xxx.xxx.xxx.xx1) of the cluster as follows:

It is recommended to use NGINX Plus as your load balancer of choice.

Follow the steps below to configure NGINX Plus version 1.7.11 or NGINX community version 1.9.2 as the load balancer.

  1. Install NGINX Plus or Nginx community version configured in a server within your cluster network.

  2. Create a VHost file (ei.http.conf) in the /etc/nginx/conf.d directory and add the following configurations into it.This configures NGINX Plus to direct the HTTP requests to the two WSO2 EI nodes (xxx.xxx.xxx.xx1 and xxx.xxx.xxx.xx2) via the HTTP 80 port using the http://ei.wso2.com/ URL. 

    Nginx Community Version and NGINX Plus

    upstream wso2.ei.com { server xxx.xxx.xxx.xx1:9765; server xxx.xxx.xxx.xx2:9765; } server { listen 80; server_name ei.wso2.com; location / { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_read_timeout 5m; proxy_send_timeout 5m; proxy_pass http://wso2.ei.com; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
  3. Create a VHost file (ei.https.conf) in the /etc/nginx/conf.d directory and add the following configurations into it. This configures NGINX Plus to direct the HTTPS requests to the two WSO2 EI nodes (xxx.xxx.xxx.xx1 and xxx.xxx.xxx.xx2) via the HTTPS 443 port using the https://ei.wso2.com/ URL. 

  4. Configure Nginx to access the Management Console as https://mgt.as.wso2.com/carbon via HTTPS 443 port. To do this, create a VHost file (ui.as.https.conf) in the /etc/nginx/conf.d/ directory and add the following configurations into it.

    Nginx Community Version and NGINX Plus

    server { listen 443; server_name ui.ei.wso2.com; ssl on; ssl_certificate /etc/nginx/ssl/server.crt; ssl_certificate_key /etc/nginx/ssl/server.key; location / { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_read_timeout 5m; proxy_send_timeout 5m; proxy_pass https://xxx.xxx.xxx.xx1:9443/;   proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } error_log /var/log/nginx/ui-error.log ; access_log /var/log/nginx/ui-access.log; }
  5. Follow the instructions below to create SSL certificates for both WSO2 EI nodes.

    1. Execute the following command to create the Server Key: $sudo opensslgenrsa -des3 -out server.key 1024

    2. Execute the following command to request to sign the certificate: $sudo openssl req -new -key server.key -out server.csr

    3. Execute the following commands to remove the passwords:
      $sudo cp server.key server.key.org 
      $sudo openssl rsa -in server.key.org -out server.key

    4. Execute the following commands to sign your SSL Certificate: $sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

    5. Execute the following command to add the certificate to the <EI_HOME>/repository/resources/security/client-truststore.jks file: keytool -import -trustcacerts -alias server -file server.crt -keystore client-truststore.jks

  6. Execute the following command to restart the NGINX Plus server: $sudo service nginx  restart 

Creating the databases

All profiles of WSO2 EI uses a database to store information such as user management details and registry data. All nodes in the cluster must use one central database for config and governance registry mounts. You can create the following databases and associated datasources.

Database Name

Description

Database Name

Description

WSO2_USER_DB

JDBC user store and authorization manager

REGISTRY_DB

Shared database for config and governance registry mounts in the product's nodes

REGISTRY_LOCAL1

Local registry space in Node 1

REGISTRY_LOCAL2

Local registry space in Node 2

It is recommended to use an industry-standard RDBMS such as Oracle, PostgreSQL, MySQL, MS SQL, etc. for most enterprise testing and production environments. However, you can also use the embedded H2 database only for the REGISTRY_LOCAL1 and REGISTRY_LOCAL2.

Following the steps below to create the databases necessary.

These instructions assume you are installing MySQL as your relational database management system (RDBMS), but you can install another supported RDBMS as needed

  1. Download and install MySQL Server.

  2. Download the MySQL JDBC driver.

  3. Download and unzip the WSO2 EI binary distribution. 

  4. Unzip the downloaded MySQL driver, and copy the MySQL JDBC driver JAR (mysql-connector-java-x.x.xx-bin.jar) into the <EI_HOME>/lib/ directory of both WSO2 EI nodes.

  5. Add the following line to the /etc/hosts file to define the host name for configuring permissions for the new database: <MYSQL-DB-SERVER-IP> carbondb.mysql-wso2.com

  6. Execute the following command in a terminal/command window, where username is the username you want to use to access the databases: mysql -u username -p

  7. Specify the password to access the databases with the username you specified when prompted.

  8. Create the databases using the following commands:

    mysql> create database WSO2_USER_DB; mysql> use WSO2_USER_DB; mysql> source <EI_HOME>/dbscripts/mysql.sql; mysql> grant all on WSO2_USER_DB.* TO regadmin@"carbondb.mysql-wso2.com" identified by "regadmin"; mysql> create database REGISTRY_DB; mysql> use REGISTRY_DB; mysql> source <EI_HOME>/dbscripts/mysql.sql; mysql> grant all on REGISTRY_DB.* TO regadmin@"carbondb.mysql-wso2.com" identified by "regadmin"; mysql> create database REGISTRY_LOCAL1; mysql> use REGISTRY_LOCAL1; mysql> source <EI_HOME>/dbscripts/mysql.sql; mysql> grant all on REGISTRY_LOCAL1.* TO regadmin@"carbondb.mysql-wso2.com" identified by "regadmin"; mysql> create database REGISTRY_LOCAL2; mysql> use REGISTRY_LOCAL2; mysql> source <EI_HOME>/dbscripts/mysql.sql; mysql> grant all on REGISTRY_LOCAL2.* TO regadmin@"carbondb.mysql-wso2.com" identified by "regadmin";

 Follow the steps below to create and configure the following databases to cluster the business process profile of WSO2 EI.

Database Name

Description

Database Name

Description

BPEL_DB

Stores process/task models and instance data of the BPEL/WS-human tasks engines

BPMN_DB

Stores process and instance data for BPMN