There several ways of mounting a remote repository to a WSO2 product (In this case WSO2 EB). You can find more information on . In this post I am trying to explain, how to mount a remote repository to WSO2 ESB via JDBC-based configuration.
In this approach you have to move the local DB of the WSO2 GREG to an external DB. So any change you do the registry will be reflected in the external DB. In this example I will be using a MYSQL database.
Moving WSO2 GREG repository to external DB
- Create a new database schema (regdb), a new user (wso2carbon) with password (wso2carbon) and grant all permissions to wso2carbon.
- Change the data source details of WSO2_CARBON_DB in
master-datasources.xml file, which is located in
GREG_HOME/repository/conf/datasources/, with your DB information.
- Start the server with -Dseup argument
This will setup all the tables in the DB and all the initial configurations needed. And WSO2 GREG is now ready with external registry.
Mounting remote repository to WSO2 ESB
- Add a new data source to the master-datasources.xml file, which is
located in ESB_HOME/repository/conf/datasources/. NOTE: This entry is
exactly same as the record we entered in WSO2 GREG, except for the
<name> and <jndiConfig>/<name>
- Add a new record <dbConfig> to registry.xml, which is located at ESB_HOME/repository/conf/
- Uncomment the <remoteInstance> and <mount> sections in the registry.xml file and update with the correct details.
- Start the WSO2 ESB. If you are running both WSO2 GREG and WSO2 ESB on
same machine, you will have to set port offsets on one of them.eg:
To verify this go to resource browser of the admin console of the WSO2 ESB, https://localhost:9445, which you can find on the following URL if you start with postOffset=2
Then browse resources,
- You should find the mounted remote repository in _system/config/nodes with a folder icon having a blue arrow in it
- You should find the mounted remote repository details on _system/local/repository/components/org.wso2.carbon.registry/mount