...
Create a MySQL database (e.g., registry) and run the
<IS_HOME>/dbscripts/mysql.sql
script on it to create the required tables.
If you are using a different database type, find the relevant script from the<IS_HOME>/dbscripts
directory.Note There are two MySQL DB scripts available in the product distribution from WSO2 Carbon Kernel 4.4.6 onwards. Click here to identify as to which version of the MySQL script to use.
Add the following datasource configuration to both the
<IS_HOME>/repository/conf/datasources/master-datasources.xml
and<API-M_HOME>/repository/conf/datasources/master-datasources.xml
files.Code Block language xml <datasource> <name>WSO2REG_DB</name> <description>The datasource used for registry</description> <jndiConfig> <name>jdbc/WSO2REG_DB</name> </jndiConfig> <definition type="RDBMS"> <configuration> <url>jdbc:mysql://localhost:3306/registry?autoReconnect=true&relaxAutoCommit=true&</url> <username>apiuser</username> <password>apimanager</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>
Note Modify the username and password parameters of above configuration with your mysql database credentials.
Info Refer Configuring master-datasources.xml for descriptive information about each property of the datasource configuration.
Create the registry mounts by inserting the following sections into the
<IS_HOME>/repository/conf/registry.xml
file.Tip When doing this change, do not replace the existing
<dbConfig>
for "wso2registry
". Simply add the following configuration to the existing configurations.Code Block language xml <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>
Info Refer Configuring registry.xml for more details on configuration details and usage of registry.xml
Repeat the above step in the
<API-M_HOME>/repository/conf/registry.xml
file as well.
...