- Local Repository : Contains system configuration and runtime data that is local to the single instance of a product. This partition is not to be shared with multiple servers and can be browsed under /_system/local in the registry browser.
- Configuration Repository : Contains product specific configuration. This partition can be shared across multiple instances of the same product and can be browsed under /_system/config in the registry browser.
- Governance Repository : Contains data and configuration shared across the platform. This partition can be made use of by multiple instances of various Carbon based products and can be can be browsed under /_system/governance in the registry browser.
We can mount registry between WSO2 carbon servers. Here I'm going to explain using WSO2 App Manager and WSO2 Identity Server.
- Create new database called APPM_REG_DB in MYSQL server.
- Create tables inside the created database by executing the script in <APPM_HOME>/dbscripts/mysql.sql
- If App Manager and Identity Server are running on the same machine, follow this step. Set Offset value to 1 in /repository/conf/carbon.xml.
- Specify the datasource definition like below in the <APPM_HOME>/repository/conf/datasources/master-datasources.xml to connect early created APPM_REG_DB database to mount registry.
- Add the same datasource configuration to <IS_HOME>/repository/conf/datasources/master-datasources.xml.
- Copy the database driver to both <IS_HOME>/repository/components/lib and <AppM_HOME>/repository/components/lib directories.
- Create the registry mounts by inserting the following sections to both <APPM_HOME>/repository/conf/registry.xml and <IS_HOME>/repository/conf/registry.xml file. Remember to not to replace the existing <dbConfig name="wso2registry">. Just add below configuration to the existing configuration.
- Restart both server.
- That's all. Now both servers should see the same configs and governance registries.
- To confirm everything was successful, go to Home > Resources > Browse from management console. You can see "config" and "governance" repositories with an arrow as in below image.
<Offset>1</Offset>
<datasource>
<name>WSO2REG_DB</name>
<description>The datasource used for registry database</description>
<jndiConfig>
<name>jdbc/WSO2REG_DB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:mysql://localhost:3306/APPM_REG_DB</url>
<username>username</username>
<password>password</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>
<dbConfig name="govregistry">
<dataSource>jdbc/WSO2REG_DB</dataSource>
</dbConfig>
<remoteInstance url="https://localhost">
<id>gov</id>
<dbConfig>govregistry</dbConfig>
<readOnly>false</readOnly>
<enableCache>true</enableCache>
<registryRoot>/</registryRoot>
</remoteInstance>
<mount path="/_system/governance" overwrite="true">
<instanceId>gov</instanceId>
<targetPath>/_system/governance</targetPath>
</mount>
<mount path="/_system/config" overwrite="true">
<instanceId>gov</instanceId>
<targetPath>/_system/config</targetPath>
</mount>
No comments:
Post a Comment