...
- Enable clustering by setting
enable
totrue
in theclustering
tag.<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
<parameter name="membershipScheme">wka</parameter>
- Specify the name of the cluster this node will join
<parameter name="domain">wso2.ds.domain</parameter>
Specify the IP addresses of your server.
Localtabgroup Localtab active true title Node 1 <parameter name="localMemberHost">192.168.48.96</parameter>
Localtab title Node 2 <parameter name="localMemberHost">192.168.48.77</parameter>
Specify the port used to communicate cluster messages.
Localtabgroup Localtab title Node 1 <parameter name="localMemberPort">4100</parameter>
Localtab title Node 2 <parameter name="localMemberPort">4200</parameter>
Specify the well known members.
Localtabgroup Localtab active true title Node 1 Code Block language xml <members> <member> <hostName>192.168.48.77</hostName> <port>4200</port> </member> </members>
Localtab title Node 2 Code Block language xml <members> <member> <hostName>192.168.48.96</hostName> <port>4100</port> </member> </members>
...
192.168.48.xx ds.wso2.com
Configuring the designer.json file
Open the <DS_HOME>/repository/deployment/server/jaggeryapps/portal/configs/designer.json
configuration file and do the following configurations.
Add the hostname of the cluster as indicated in the following configuration snippet in order to render the gadgets in the dashboards. Also, you can access the dashboard using the IP address without any issue with this configuration.
Code Block "host": { "hostname": "ds.wso2.com", "port": "443", "protocol": "https" }
Connecting to a Oracle database and mounting the registry
The configurations in this section must be done in both nodes.
Configuring the master-datasources.xml
...
1. Add the data sources for Registry and User databases
...
file
Do the following configurations in the <DS_HOME>/repository/conf/datasources/master-datasources.xml
file.
Add the datasources for the registry and the user databases.
Code Block language xml title User DB datasource <datasource> <name>WSO2_DS_USER_DB</name>
...
<jndiConfig> <name>jdbc/DS_USER_DB</name>
...
</jndiConfig>
...
<definition type="RDBMS">
...
<configuration> <driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
...
<url>jdbc:oracle:thin:@192.168.48.121:1521/
...
pdbora12c</url>
...
<maxActive>100</maxActive>
...
<maxWait>60000</maxWait>
...
<minIdle>5</minIdle>
...
<testOnBorrow>true</testOnBorrow>
...
<validationQuery>SELECT 1 FROM DUAL</validationQuery>
...
<validationInterval>30000</validationInterval>
...
<username>ds_xxxx</username>
...
<password>ds_xxxx</password>
...
<defaultAutoCommit>false</defaultAutoCommit>
...
</configuration>
...
</definition>
...
</datasource>
...
...
Code Block language xml title Registry DB datasource <datasource> <name>WSO2_DS_REGISTRY_DB</name>
...
<jndiConfig> <name>jdbc/DS_REGISTRY_DB</name>
...
</jndiConfig>
...
<definition type="RDBMS">
...
<configuration> <driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
...
<url>jdbc:oracle:thin:@192.168.48.121:1521/
...
pdbora12c</url>
...
<maxActive>100</maxActive>
...
<maxWait>60000</maxWait>
...
<minIdle>5</minIdle>
...
<testOnBorrow>true</testOnBorrow>
...
<validationQuery>SELECT 1 FROM DUAL</validationQuery>
...
<validationInterval>30000</validationInterval>
...
<username>ds_xxx</username>
...
<password>ds_xxx</password>
...
<defaultAutoCommit>false</defaultAutoCommit>
...
</configuration>
...
</definition>
...
</datasource>
...
Copy the ojdbc7.jar driver for the database to the
<DS_HOME>/repository/components/lib
directory.
Configuring the registry.xml
...
file
Open the <DS_HOME>/repository/conf/registry.xml
file and do the following configurations.
Do the following configurations. These configurations enable you to mount the shared registry on both nodes.
Code Block language xml <dbConfig name="sharedregistry">
...
<dataSource>jdbc/DS_REGISTRY_DB</dataSource>
...
</dbConfig>
...
<remoteInstance url="https://localhost:9443/registry">
...
<id>instanceid</id>
...
<dbConfig>sharedregistry</dbConfig>
...
<readOnly>false</readOnly>
...
<enableCache>true</enableCache>
...
<registryRoot>/</registryRoot>
...
<cacheId>ds_long_
...
reg@jdbc:oracle:thin:@192.168.48.121:1521/
...
pdbora12c</cacheId>
...
</remoteInstance>
...
<mount path="/_system/config" overwrite="true">
...
<instanceId>instanceid</instanceId>
...
<targetPath>/_system/config</targetPath>
...
</mount>
...
<mount path="/_system/governance" overwrite="true">
...
<instanceId>instanceid</instanceId>
...
<targetPath>/_system/governance</targetPath>
...
</mount>
Configuring the user-mgt.xml file
Open the <DS_HOME>/repository/conf/user-mgt.xml
Configurations1. file and do the following configurations.
Point the user store to the new database
...
that you create for this purpose.
Code Block language xml <Configuration>
...
<AddAdmin>true</AddAdmin>
...
<AdminRole>admin</AdminRole>
...
<AdminUser> <UserName>admin</UserName>
...
<Password>admin</Password>
...
</AdminUser>
...
<EveryOneRoleName>everyone</EveryOneRoleName> <!-- By default users in this role sees the registry root -->
...
<Property name="isCascadeDeleteEnabled">true</Property>
...
<Property name="dataSource">jdbc/DS_USER_DB</Property>
...
</Configuration>
repository/deployment/server/jaggeryapps/portal/configs/designer.json configuration
Add the hostname of the cluster in the below configurations in order to render the gadgets in the dashboards. Also, you can access the dashboard using the ip address without any issue with this configuration.
"host": {
"hostname": "ds.wso2.com",
"port": "443",
"protocol": "https"
}
}
Starting the server
If you have configured a different database instead of the default start as follows.
sh wso2server.sh -Dsetup
...