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.
...
Add the following configuration in the
<EI_HOME>/wso2/business-process/repository/conf/registry.
xml file of Node 1 to configure the registry mounts.Code Block language xml title Registry mounting configuration for EI Node 1 (Business Process profile ) <dbConfig name="wso2bpsregistry"> <dataSource>jdbc/WSO2RegistryDB</dataSource> </dbConfig> <remoteInstance url="https://localhost:9443/registry"> <id>instanceid</id> <dbConfig>wso2bpsregistry</dbConfig> <readOnly>false</readOnly> <enableCache>true</enableCache> <registryRoot>/</registryRoot> <cacheId>root@jdbc:mysql://localhost:3306/REGISTRY_DB</cacheId> </remoteInstance> <mount path="/_system/config" overwrite="true"> <instanceId>instanceid</instanceId> <targetPath>/_system/bpsconfig</targetPath> </mount> <mount path="/_system/governance" overwrite="true"> <instanceId>instanceid</instanceId> <targetPath>/_system/governance</targetPath> </mount>
Add the following configuration in the
<EI_HOME>/wso2/business-process/repository/conf/registry.
xml file of Node 2 to configure the registry mounts.Code Block language xml title Registry mounting configuration for all other EI (Business Process profile ) nodes in the cluster <dbConfig name="wso2bpsregistry"> <dataSource>jdbc/WSO2RegistryDB</dataSource> </dbConfig> <remoteInstance url="https://localhost:9443/registry"> <id>instanceid</id> <dbConfig>wso2bpsregistry</dbConfig> <readOnly>true</readOnly> <enableCache>true</enableCache> <registryRoot>/</registryRoot> <cacheId>root@jdbc:mysql://localhost:3306/REGISTRY_DB</cacheId> </remoteInstance> <mount path="/_system/config" overwrite="true"> <instanceId>instanceid</instanceId> <targetPath>/_system/bpsconfig</targetPath> </mount> <mount path="/_system/governance" overwrite="true"> <instanceId>instanceid</instanceId> <targetPath>/_system/governance</targetPath> </mount>
...
Configure the datasources to point to the
REGISTRY_LOCAL1
,WSO2_REGISTRY_DB
, andWSO2_USER_DB
databases as follows in the<EI_HOME>/wso2/business-process/conf/datasources/master-datasources.
xml filexml
file as follows:Tip Replace the username, password, and database URL of your MySQL environment accordingly.
Code Block language xml <datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration"> <providers> <provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider> </providers> <datasources> <datasource> <name>REGISTRY_LOCAL1</name> <description>The datasource used for registry- local</description> <jndiConfig> <name>jdbc/WSO2CarbonDB</name> </jndiConfig> <definition type="RDBMS"> <configuration> <url>jdbc:mysql://carbondb.mysql-wso2.com:3306/REGISTRY_LOCAL1?autoReconnect=true</url> <username>regadmin</username> <password>regadmin</password> <driverClassName>com.mysql.jdbc.Driver</driverClassName> <maxActive>50</maxActive> <maxWait>60000</maxWait> <testOnBorrow>true</testOnBorrow> <validationQuery>SELECT 1</validationQuery> <validationInterval>30000</validationInterval> </configuration> </definition> </datasource> <datasource> <name>REGISTRY_DB</name> <description>The datasource used for registry- config/governance</description> <jndiConfig> <name>jdbc/WSO2RegistryDB</name> </jndiConfig> <definition type="RDBMS"> <configuration> <url>jdbc:mysql://carbondb.mysql-wso2.com:3306/REGISTRY_DB?autoReconnect=true</url> <username>regadmin</username> <password>regadmin</password> <driverClassName>com.mysql.jdbc.Driver</driverClassName> <maxActive>50</maxActive> <maxWait>60000</maxWait> <testOnBorrow>true</testOnBorrow> <validationQuery>SELECT 1</validationQuery> <validationInterval>30000</validationInterval> </configuration> </definition> </datasource> <datasource> <name>WSO2_USER_DB</name> <description>The datasource used for registry and user manager</description> <jndiConfig> <name>jdbc/WSO2UMDB</name> </jndiConfig> <definition type="RDBMS"> <configuration> <url>jdbc:mysql://carbondb.mysql-wso2.com:3306/WSO2_USER_DB</url> <username>regadmin</username> <password>regadmin</password> <driverClassName>com.mysql.jdbc.Driver</driverClassName> <maxActive>50</maxActive> <maxWait>60000</maxWait> <testOnBorrow>true</testOnBorrow> <validationQuery>SELECT 1</validationQuery> <validationInterval>30000</validationInterval> </configuration> </definition> </datasource> </datasources> </datasources-configuration>
Tip Repeat this configuration on the second WSO2 EI node to configure the datasources to point to the
REGISTRY_LOCAL2
,WSO2_REGISTRY_DB
, andWSO2_USER_DB
databases as follows: (Change the username, password, and database URL as needed for your environment):Code Block language xml <datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration"> <providers> <provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider> </providers> <datasources> <datasource> <name>REGISTRY_LOCAL2</name> <description>The datasource used for registry- local</description> <jndiConfig> <name>jdbc/WSO2CarbonDB</name> </jndiConfig> <definition type="RDBMS"> <configuration> <url>jdbc:mysql://carbondb.mysql-wso2.com:3306/REGISTRY_LOCAL2?autoReconnect=true</url> <username>regadmin</username> <password>regadmin</password> <driverClassName>com.mysql.jdbc.Driver</driverClassName> <maxActive>50</maxActive> <maxWait>60000</maxWait> <testOnBorrow>true</testOnBorrow> <validationQuery>SELECT 1</validationQuery> <validationInterval>30000</validationInterval> </configuration> </definition> </datasource> <datasource> <name>REGISTRY_DB</name> <description>The datasource used for registry- config/governance</description> <jndiConfig> <name>jdbc/WSO2RegistryDB</name> </jndiConfig> <definition type="RDBMS"> <configuration> <url>jdbc:mysql://carbondb.mysql-wso2.com:3306/REGISTRY_DB?autoReconnect=true</url> <username>regadmin</username> <password>regadmin</password> <driverClassName>com.mysql.jdbc.Driver</driverClassName> <maxActive>50</maxActive> <maxWait>60000</maxWait> <testOnBorrow>true</testOnBorrow> <validationQuery>SELECT 1</validationQuery> <validationInterval>30000</validationInterval> </configuration> </definition> </datasource> <datasource> <name>WSO2_USER_DB</name> <description>The datasource used for registry and user manager</description> <jndiConfig> <name>jdbc/WSO2UMDB</name> </jndiConfig> <definition type="RDBMS"> <configuration> <url>jdbc:mysql://carbondb.mysql-wso2.com:3306/WSO2_USER_DB</url> <username>regadmin</username> <password>regadmin</password> <driverClassName>com.mysql.jdbc.Driver</driverClassName> <maxActive>50</maxActive> <maxWait>60000</maxWait> <testOnBorrow>true</testOnBorrow> <validationQuery>SELECT 1</validationQuery> <validationInterval>30000</validationInterval> </configuration> </definition> </datasource> </datasources> </datasources-configuration>
Add the following configuration in the
<EI_HOME>/wso2/business-process/conf/user-mgt.
xml file to configure the user stores.Tip Enter the datasource information for the user store that you configured in the
<EI_HOME>/conf/
datasources/master-
datasources.
xml file. You can change the admin username and password as well. However, you should do this before starting the server.Code Block language xml <Configuration> <AddAdmin>true</AddAdmin> <AdminRole>admin</AdminRole> <AdminUser> <UserName>admin</UserName> <Password>admin</Password> </AdminUser> <EveryOneRoleName>everyone</EveryOneRoleName> <Property name="dataSource">jdbc/WSO2UMDB</Property> </Configuration>
- Update the
dataSource
property in all nodes in the<EI_HOME>/wso2/business-process/conf/user-mgt.xml
file as shown below to configure the datasource:<Property name="dataSource">jdbc/WSO2UMDB</Property>
Add the following configuration in the
<EI_HOME>/wso2/business-process/conf/
datasources/bps-
datasources.
xml file to configure the connection to the business process profile related database as shown below. Change the driver class, database URL, username, and password as needed for your environment:Note Set the
<defaultAutoCommit>
property to true in every node with the business process profile. This is an important setting for the BPEL engine.Code Block language xml <datasource> <name>BPM_DS</name> <description></description> <jndiConfig> <name>bpmds</name> </jndiConfig> <definition type="RDBMS"> <configuration> <url>jdbc:mysql://localhost:3306/BPM_DB</url> <username>root</username> <password>root</password> <driverClassName>com.mysql.jdbc.Driver</driverClassName> <testOnBorrow>true</testOnBorrow> <validationQuery>SELECT 1</validationQuery> <validationInterval>30000</validationInterval> <useDataSourceFactory>false</useDataSourceFactory> <defaultAutoCommit>true</defaultAutoCommit> <maxActive>100</maxActive> <maxIdle>20</maxIdle> <maxWait>10000</maxWait> </configuration> </definition> </datasource>
Add the following configurations in the
<EI_HOME>/wso2/business-process/conf/datasources/activiti-datasources.xml
file.Code Block language xml <datasource> <name>ACTIVITI_DB</name> <description>The datasource used for activiti engine</description> <jndiConfig> <name>jdbc/ActivitiDB</name> </jndiConfig> <definition type="RDBMS"> <configuration> <url>jdbc:mysql://localhost:3306/BPMN_DB</url> <username>root</username> <password>root</password> <driverClassName>com.mysql.jdbc.Driver</driverClassName> <maxActive>50</maxActive> <maxWait>60000</maxWait> <testOnBorrow>true</testOnBorrow> <validationQuery>SELECT 1</validationQuery> <validationInterval>30000</validationInterval> </configuration> </definition> </datasource>
Edit the
<EI_HOME>/wso2/business-process/conf/axis2/axis2.xml
file as follows to set up the cluster configurations.- Enable clustering for this node as follows:
<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 sends cluster initiation messages to the WKA members):
<parameter name="membershipScheme">wka</parameter>
- Specify the name of the cluster this node will join as follows:
<parameter name="domain">wso2.ei.domain</parameter>
- Specify the host to communicate cluster messages as follows:
<parameter name="localMemberHost">xxx.xxx.xxx.xx1</parameter>
Specify the port to communicate cluster messages as follows:
<parameter name="localMemberPort">4100</parameter>
Info This port number is not affected by the port offset value specified in the
<EI_HOME>/conf/carbon.
xml
file. If this port number is already assigned to another server, the clustering framework automatically increments this port number. However, if there are two servers running on the same machine, ensure that a unique port is set for each server.Specify the well-known members as follows: (The port value for the WKA node must be the same value as it's localMemberPort (in this case it is 4100).
Info You can also use IP address ranges for the hostname (e.g., 192.168.1.2-10). However, you can define a range only for the last portion of the IP address. Smaller the range, the faster the time it takes to discover members since each node has to scan a lesser number of potential members.
- Enable clustering for this node as follows:
Change the
<taskServerMode>
configuration in the<EI_HOME>wso2/business-process/conf/etc/tasks-config.
xml file as follows:<taskServerMode>STANDALONE</taskServerMode>
Info WSO2 EI ships with the task server component. By default, this component waits for two task server nodes when you enable clustering. Hence, change this entry to
STANDALONE
to start the business process profile.The task server configuration does not have an impact on the server runtime functionality. Hence, using AUTO or STANDALONE for this will not affect how the BPEL processes are executed during runtime.
However, when the AUTO setting is enabled in this default setting when clustering is enabled, the server will wait till it picks up another node so that there are two task server instances up and running. Hence, you will need to start both nodes simultaneously. Therefore, if you want to use AUTO, change the
taskServerCount
to 1 so that you can start the management node first.Add the following configurations in the
<EI_HOME>/wso2/business-process/conf/bps.
xml file:Note This is required only if you are using BPEL/ WS-Human Task functionality.
Enable distributed lock as follows:
<tns:UseDistributedLock>true</tns:UseDistributedLock>
Info This entry enables the Hazelcast-based synchronizations mechanism to prevent concurrent modification of the instance state by cluster members.
Configure the scheduler thread pool size as follows:
<tns:ODESchedulerThreadPoolSize>0</tns:ODESchedulerThreadPoolSize>
Info Thread pool size must always be smaller than the maximum active database connections configured in the
<EI_HOME>/wso2/business-processconf/
datasources/master-
datasources.
xml file. When configuring the thread pool size, allocate 10-15 threads per core depending on your setup. Leave some additional number of database connections since WSO2 EI uses database connections for API management as well.Example settings for a two node cluster are:
Oracle Server configured database connection size - 250
maxActive
entry in the<EI_HOME>/wso2/business-process/conf/
datasources/master-
datasources.
xml file for each node - 100SchedulerTreadPool
size for each node - 50
Optionally, uncomment the elements accordingly and give an unique ID to assign a unique ID to a node as follows:
<tns:NodeId>node1</tns:NodeId>
...