This documentation is for WSO2 IoT Server 3.1.0. View the documentation for the latest release.
Setting Up the Databases for Clustering - IoT Server 3.1.0 - WSO2 Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                                                   
||
Skip to end of metadata
Go to start of metadata

The following databases are needed when clustering WSO2 IoT Server.

Database NameDescriptionDatabase Script Location
APIM Database (WSO2AM_DB)This database stores data related to JAX-RS APIs and OAuth token data.<IOTS_HOME>/dbscripts/apimgt/

App management database
(WSO2APPM_DB)

This database store the mobile and IoT device application details.<IOTS_HOME>/dbscripts/appmgt
CDM core database (DM_DS)This database stores generic data about devices (such as a unique identifier, device type, ownership type), device enrollment information, device operations, policy management related data, etc.<IOTS_HOME>/dbscripts/cdm/
Certificate management databaseThis database stores the mutual SSL certificate details.<IOTS_HOME>/dbscripts/certmgt
Registry database (REG_DB)This database acts as the registry database and stores governance and config registry data. The registry database must be mounted to all nodes in the cluster.<IOTS_HOME>/dbscripts
Example: The mysql.sql script to create the database for MySQL.

Social database

(WSO2_SOCIAL_DB)

The database used by the WSO2 App Manager Store to gather the likes, comments, and rating of an application.<IOTS_HOME>/dbscripts/social
Storage databaseThe database is used by the WSO2 App Manager to store web application data, such as URI templates, subscriptions, and more.<IOTS_HOME>/dbscripts/storage
User manager database (UM_DB)This database stores the user details and user permission related details.<IOTS_HOME>/dbscripts Example: The mysql.sql script to create the database for MySQL.

The following databases are related to plugins. These enable you to keep the data that is essential for these devices to work (such as APNS related keys) and this data is not available in the CDM core database.

Database NameDescriptionDatabase Script Location
iOS database (MobileIOSDM_DS)

Stores the iOS related the data.

If you have not configured WSO2 IoT Server for iOS, you won't have the database scripts in the given location. For more information on configuring WSO2 IoT Server for iOS, see iOS Configurations.

<IOTS_HOME>/dbscripts/cdm/plugins/ios
Android database (MobileAndroidDM_DS)Stores the Android related data.<IOTS_HOME>/dbscripts/cdm/plugins/android
Windows database (MobileWindowsDM_DS)Stores the Microsoft Windows related data.<IOTS_HOME>/dbscripts/cdm/plugins/windows

To change the datasource configurations, please change the following files.

NOTE: Make sure to add the relevant JDBC library to the <IOTS_HOME>/lib directory. For example, add the mysql-connector-java-{version}.jar file to the <IOTS_HOME>/lib directory when using the MySQL database.

Files to changeDatasource
<IOTS_HOME>/repository/conf
/datasources/master-datasources.xml

This file must include the datasource configuration for the following databases.

  • APIM database

     Click here to see a sample database configuration for the API Manager database.

    Make sure to use the zeroDateTimeBehavior=convertToNull parameter when configuring the database using MySQL.

    <datasource>
       <name>WSO2AM_DB</name>
       <description>The datasource used for API Manager database</description>
       <jndiConfig>
          <name>jdbc/WSO2AM_DB</name>
       </jndiConfig>
       <definition type="RDBMS">
          <configuration>
             <url>jdbc:mysql://{hostname}:{port}/apim?autoReconnect=true&amp;relaxAutoCommit=true&amp;zeroDateTimeBehavior=convertToNull</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>
  • Registry database

  • User management database

     Click here to see a sample database configuration for the user manager, registry and app manager databases.
    <datasource>
       <name>WSO2UM_DB</name>
       <description>The datasource used for User Manager database</description>
       <jndiConfig>
          <name>jdbc/WSO2UM_DB</name>
       </jndiConfig>
       <definition type="RDBMS">
          <configuration>
             <url>jdbc:mysql://{hostname}:{port}/userdb?autoReconnect=true&amp;relaxAutoCommit=true</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>
  • App Manager database
  • Store database
  • Social database
<IOTS_HOME>/repository/conf
/datasources/cdm-datasources.xml

This file must include the datasource configuration for the CDM core database.

 Click here to see a sample database configuration that can be used for the CDM, Android, iOS and Windows databases.
<datasources>
   <datasource>
      <name>DM_DS</name>
      <description>The datasource used for CDM</description>
      <jndiConfig>
         <name>jdbc/DM_DS</name>
      </jndiConfig>
      <definition type="RDBMS">
         <configuration>
            <url>jdbc:mysql://{localhost}:3306/cdm?autoReconnect=true&amp;relaxAutoCommit=true</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>
</datasources>
<IOTS_HOME>/repository/conf
/datasources/android-datasources.xml
This file must include the datasource configuration for the Android plugin database.
<IOTS_HOME>/repository/conf
/datasources/ios-datasources.xml
This file must include the datasource configuration for the iOS plugin database.
<PRODUCT_HOME>/repository/conf
/datasources/windows-datasources.xml
This file must include the datasource configuration for the Windows Plugin database.

What's next?

Next, let's mount the registry.

  • No labels