||
Skip to end of metadata
Go to start of metadata

RSS metadata repository is used to maintain the databases, database users and privilege templates in each of the RSS environments in your system. Instructions for configuring RSS environments for your system are explained hereBy default, the RSS metadata repository is pointed to an embedded H2 database that is shipped as part of the WSO2 Storage Server installation archive. In a typical production setting, we recommend to use an enterprise-grade RDBMS such as MySQL , SQL SERVER or Oracle as the RSS metadata repository.

To set up and configure the RSS metadata repository:

  1. Create a database as the RSS metadata repository and a database user with admin privileges equivalent to the DBA role (this grants access to the database used as the RSS metadata repository)

    The database used as the metadata repository as well as all the database instances that you are going to provision (in every environment of your system) should be of the same RDBMS type.  

  2. Select the SQL script appropriate to the RDBMS you have from <SS_HOME>/dbscripts directory and run it. This creates the RSS metadata repository database structure. For example, if your RDBMS is MySQL, the script you must run is <SS_HOME>/dbscripts /rss-manager/mysql/wso2_rss_mysql.sql directory.
  3. Add the required JDBC drivers for the database you selected to <SS_HOME>/repository/components/lib folder.
  4. Create a datasource in the <PRODUCT_HOME>/repository/conf/datasources/master-datasources.xml file and point to that from the <PRODUCT_HOME>/repository/conf/etc/rss-config.xml file using its JNDI name.  Shown below is how the default metadata repository ("rss_db") is configured in these files. 
    1. The default master-datasources.xml file.

      SQL SERVER configurations:

      <datasource>
      	<name>MetadataRepo</name>
      	<jndiConfig>
      		<name>MetadataRepoDS</name>
      	</jndiConfig>
      	<definition type="RDBMS">
      		<configuration>
      			<dataSourceClassName>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</dataSourceClassName>
      			<dataSourceProps>
      				<property name="serverName">192.168.17.21</property>
      				<property name="portNumber">1433</property>
      				<property name="databaseName">rss_db</property>
      				<property name="user">RootUser</property>
      				<property name="password">RootPassword</property>
      			</dataSourceProps>
      		</configuration>
      	</definition>
      </datasource>

      In this example, it uses Microsoft JDBC driver to connect to the database. You have to configure SQL Server to use XA datasource before configuring Storage Server. Configuration instructions can be found at http://msdn.microsoft.com/en-us/library/aa342335.aspx.

      You can also use jTDS JDBC driver instead of Microsoft driver. Then dataSourceClassName in the above configuration should be net.sourceforge.jtds.jdbcx.JtdsDataSource. The server configuration instructions for XA datasources can be found in the README.XA file in the jTDS driver distribution pack.

      MySQL configurations:

      <datasource>
      	<name>MetadataRepo</name>
      	<jndiConfig>
      		<name>MetadataRepoDS</name>
      	</jndiConfig>
      	<definition type="RDBMS">
      		<configuration>
      			<dataSourceClassName>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</dataSourceClassName>
      			<dataSourceProps>
      				<property name="URL">jdbc:mysql://localhost:3306/rss_db</property>
      				<property name="user">RootUser</property>
      				<property name="password">RootPassword</property>
      			</dataSourceProps>
      		</configuration>
      	</definition>
      </datasource>

      PostgreSQL configurations:

      <datasource>
      	<name>MetadataRepo</name>
      	<jndiConfig>
      		<name>MetadataRepoDS</name>
      	</jndiConfig>
      	<definition type="RDBMS">
      		<configuration>
      			<dataSourceClassName>org.postgresql.xa.PGXADataSource</dataSourceClassName>
      			<dataSourceProps>                         	 	 	 	
      				<property name="serverName">localhost</property>
      				<property name="portNumber">5432</property>
      				<property name="databaseName">rss_db</property>                     	 	 	 	
      				<property name="user">RootUser</property>
      				<property name="password">RootPassword</property>
      			</dataSourceProps>
      		</configuration>
      	</definition>
      </datasource>

      When creating above database user, make sure to grant all privileges for the database before creating any tables in it (i.e. before you run the database script on database).

      The elements of the sample configuration are explained below. You can use this information to edit the file according to your requirements. For more information please see configuring master datasources.

      • <dataSourceClassName>This is the XA Driver Class provided by the JDBC driver used to connect to the type of RDBMS in which the RSS metadata repository is configured. E.g., if RSS metadata repository database is configured on MySQL - "com.mysql.jdbc.jdbc2.optional.MysqlXADataSource" has to be used as the value of this particular attribute.

      • <dataSourceProps>: Root element of the XA data source property collection that needs to be configured in order to initialize the XA datasource driver used in the RSS metadata repository configuration.

      • <property name="property_name">: Element used to specify bean properties of the XA datasource driver used in RSS metadata repository configuration. (Note: The set of properties that are to be configured are different based on the XA driver class used). E.g., the sample configuration which can be used to populate the bean properties required for MySQL XA driver is as follows:

        <dataSourceProps>
        	<property name = "URL">xxxx</property>
        	<property name = "user">xxxx</property>
        	<property name = "password">xxxx</property>
        </dataSourceProps>
    2. The default rss-config.xml file configuration for the metadata repository is shown below. Please note that JNDI name of both config files should be the same. In this example, it is "MetadataRepoDS".

      <ManagementRepository>
      	    <DataSourceConfiguration>
      			<JndiLookupDefinition>
      		     	<Name>MetadataRepoDS</Name>
      			</JndiLookupDefinition>
      	    </DataSourceConfiguration>
      </ManagementRepository> 
  • No labels