Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
maxLevel64
minLevel3
styleborder:1
locationtop
separatorpipe

...

The default datasource configuration are defined in the 2 files listed below, which are located in the <PRODUCTEMM_HOME>/repository/conf/datasources directory. The database configurations in registry.xml and user-mgt.xml refer to the WSO2_CARBON_DB datasource.

info
Excerpt
  • master-datasources.xml

    Panel

    Edit the

the 
  • WSO2_CARBON_DB

, WSO2_EMM_DB
  • and WSO2AM_DB datasources in the master-datasources.xml

and cdm-datasources.xml
  • file by replacing the url, username, password

and 
  • and driverClassName settings with your custom values

and also the other values accordingly.
  • master-datasources.xml

    Panel

    This  file contains the following default datasource configurations to configure EMM with the Carbon database and the WSO2 API Manager database..
     

    Expand
    titleWSO2_Carbon_DB datasource
    Code Block
    languagexml
    <datasource>
       <name>WSO2_CARBON_DB</name>
       <description>The datasource used for registry and user manager</description>
       <jndiConfig>
          <name>jdbc/WSO2CarbonDB</name>
       </jndiConfig>
       <definition type="RDBMS">
          <configuration>
             <url>jdbc:mysql://localhost:3306/WSO2CARBON_DB</url>
             <username>wso2carbon</username>
             <password>wso2carbon</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>
    Expand
    titleWSO2AM_DB datasource
    Code Block
    languagexml
    <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://localhost:3306/WSO2AM_DB</url>
             <username>wso2carbon</username>
             <password>wso2carbon</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>
  • cdmemm-datasources.xml

    Panel

    This file contains the following default datasource configurations to configure EMM with the Connected Device Management Framework and for mobile device management.Edit the DM_DS, MobileIOSDM_DS, MobileAndroidDM_DS and MobileWindowsDM_DS datasources in the cdm-datasources.xml file by replacing the url, username, password and  driverClassName settings with your custom values.
     

    Expand
    titleDM_DS datasource
    Code Block
    languagexml
     <datasource>
       <name>DM_DS</name>
       <description>The datasource used for EMM</description>
       <jndiConfig>
          <name>jdbc/DM_DS</name>
       </jndiConfig>
       <definition type="RDBMS">
          <configuration>
             <url>jdbc:mysql://localhost:3306/WSO2DM_DB</url>
             <username>wso2carbon</username>
             <password>wso2carbon</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>
    Expand
    titleMobileIOSDM_DS datasource

    This datasource is specifically used to manage mobile devices on the iOS platform.

    Code Block
    languagexml
    <datasource>
       <name>MobileIOSDM_DS</name>
       <description>The datasource used for EMM Mobile iOS Device Management</description>
       <jndiConfig>
          <name>jdbc/MobileIOSDM_DS</name>
       </jndiConfig>
       <definition type="RDBMS">
          <configuration>
             <url>jdbc:mysql://localhost:3306/WSO2MobileIOS_DB</url>
             <username>wso2carbon</username>
             <password>wso2carbon</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>
    Expand
    titleMobileAndroidDM_DS datasource

    This datasource is specifically used to manage mobile devices on the Android platform.

    Code Block
    languagexml
    <datasource>
       <name>MobileAndroidDM_DS</name>
       <description>The datasource used for EMM Mobile Android Device Management</description>
       <jndiConfig>
          <name>jdbc/MobileAndroidDM_DS</name>
       </jndiConfig>
       <definition type="RDBMS">
          <configuration>
             <url>jdbc:mysql://localhost:3306/WSO2MobileAndroid_DB</url>
             <username>wso2carbon</username>
             <password>wso2carbon</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>
    Expand
    titleMobileWindowsDM_DS datasource

    This datasource is specifically used to manage mobile devices on the Windows platform.

    Code Block
    languagexml
    <datasource>
       <name>MobileWindowsDM_DS</name>
       <description>The datasource used for EMM Mobile Windows Device Management</description>
       <jndiConfig>
          <name>jdbc/MobileWindowsDM_DS</name>
       </jndiConfig>
       <definition type="RDBMS">
          <configuration>
             <url>jdbc:mysql://localhost:3306/WSO2MobileWindows_DB</url>
             <username>wso2carbon</username>
             <password>wso2carbon</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> 

...

  • url - The URL of the database.
  • username  - The name of the database user.

  • password - The password of the database user.
  • driverClassName  - The class name of the database driver.
  • maxActive - The maximum number of active connections that can be allocated from this pool at the same time, or enter a negative value for no limit.
  • maxWait - The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception. You can enter zero or a negative value to wait indefinitely.
  • minIdle - The minimum number of active connections that can remain idle in the pool without extra ones being created, or enter zero to create none.
  • testOnBorrow -  The indication of whether objects will be validated before being borrowed from the pool. If the object fails to validate, it will be dropped from the pool, and another attempt will be made to borrow another. 
  • validationQuery - The SQL query that will be used to validate connections from this pool before returning them to the caller.
  • validationInterval -  The indication to avoid excess validation, and only run validation at the most, at this frequency (time in milliseconds). If a connection is due for validation, but has been validated previously within this interval, it will not be validated again. 

    Info

    For more information on other parameters that can be defined in the master-datasources.xml file, see Tomcat JDBC Connection Pool.

...

Download the MySQL Java connector JAR file, and copy it to the <PRODUCTEMM_HOME>/repository/components/lib directory.

...

DatabaseDB Script name and Location
WSO2_CARBON_DB<PRODUCT<EMM_HOME>/dbscripts/mysql.sql
WSO2AM_DB<PRODUCT<EMM_HOME>/dbscripts/apimgt/mysql.sql

WSO2DM_DB

<EMM_HOME>/dbscripts/cdm/mysql.sql

WSO2MobileIOS_DB

<EMM_HOME>/dbscripts/cdm/plugins/ios/mysql.sql

WSO2MobileAndroid_DB

<EMM_HOME>/dbscripts/cdm/plugins/android/mysql.sql

WSO2MobileWindows_DB

<EMM_HOME>/dbscripts/cdm/plugins/windows/mysql.sql

Using the script

You can create database tables manually by executing the following script:

  1. Run the MySQL script individually for the latter mentioned databases that are provided with the product using the below command (outside the MySQL prompt):

    Code Block
    mysql -u <USERNAME> -p -D<DATABASE-NAME> '<PATH-TO-MYSQL-DB-SCRIPT>';

    For example:

    Code Block
    mysql -u <USERNAME> -p -Dregdb '<PRODUCT<EMM_HOME>/dbscripts/mysql.sql';
    Info

    Enter the password for each command when prompted.

  2. Start the WSO2 product instance as follows:
    • For Linux:

      Code Block
      wso2server.sh
    • For Windows:

      Code Block
      wso2server.bat

...