WSO2 Storage Server, Relational Storage Service
(RSS) feature allows creating and managing the Relational Database Management
System (RDBMS). By default storage server support H2 database but it can be
extent. To setup MySQL as relational storage need to do following configurations
1.
Download
and install MySQL using the following command:
sudo apt-get
install mysql-server mysql-client
2.
Access
the MySQL shell using following command :
mysql –u
root -p
3.
create
a database call test as RSS meta repository using following command :
create database
test;
4.
Select
the script <SS_HOME>/dbscripts /rss-manager/mysql/wso2_rss_mysql.sql and
by running the script create the RSS metadata repository database structure.
5.
Edit
the default datasource configuration. The master-datasources.xml file, in the
<SS_HOME>/repository/conf/datasources directory.
<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/test</property>
<property
name="user">root</property>
<property
name="password">root</property>
</dataSourceProps>
</configuration>
</definition>
</datasource>
6.
To do the RSS meta data specific configurations open
the rss-config.xml file stored in the <SS_HOME>/repository/conf/etc/
directory and do the following changes:
<Provider>MYSQL</Provider>
<Environments>
<Environment>
<Name>DEFAULT</Name>
<RSSInstances>
<RSSInstance>
<Name>WSO2RSS1</Name>
<InstanceType>SYSTEM</InstanceType>
<DbmsType>MYSQL</DbmsType>
<ServerCategory>LOCAL</ServerCategory>
<DataSourceConfiguration>
<Definition>
<Url>jdbc:mysql://localhost:3306</Url>
<Username>RootUser</Username>
<Password>RootPassword</Password>
<DriverClassName>com.mysql.jdbc.Driver</DriverClassName>
</Definition>
</DataSourceConfiguration>
</RSSInstance>
</RSSInstances>
</Environment>
</Environments>
Download the MySQL
Java connector JAR file and add to the <SS_HOME>/repository/components/lib/
directory