Configuring RSS Environments
The RSS provisioning environments in your system can be considered as logical boundaries separating a set of database server instances from another. One typical example of using multiple provisioning environment is, if you are running an application development infrastructure allowing users to develop applications in different environments within its life cycle, such as DEV, QA, STAGING, PROD, etc., you would ideally need to have separate database provider infrastructure per environment. The aforementioned feature can be a handful in provisioning all those environments with a single WSO2 Storage Server instance.
Note that 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.
See the following topics for instructions:
Configuring the default RSS environment
The RSS environments can be defined and configured for a system using the rss-config.xml file stored in the <SS_HOME>/repository/conf/etc/ directory. By default, WSO2 Storage Server comes with one environment, which contains one RSS instance. Shown below is the default configurations in the rss-config.xml file. Descriptions of the rss-config.xml elements are explained below, which you can use to edit the file according to your requirements.
The elements of the sample configuration are explained below.
- <Provider>: Element used to configure the DBMS Type of the RSS instance. Fixed values are H2, MYSQL, SQLSERVER, POSTGRES.
- <Environments>: Root element that wraps the configurations for all RSS environments.
- <Environment>+: Root element that wraps the configurations for an individual RSS environment. You can add new environments by duplicating this element in this file.
- <Name>: Element used to configure the name of the RSS environment.
- <RSSInstances>: Root element that wraps the RSS instances configured in the RSS environment.
- <RSSInstance>+:Element used to configure one particular database server instance to be provisioned. You can add new RSS instances by duplicating this element in this file.
- <InstanceType>: Element used to configure the type of the RSS instance. Currently, the possible values of this particular attribute is SYSTEM and USER_DEFINED. SYSTEM implies that the configured RSS instance would be provisioned as part of the logical database cluster named SYSTEM. USER_DEFINED is for instances that are created by individual tenant users from the management console.
- <DbmsType>: Element used to configure the DBMS type of the RSS instance. Fixed values are H2, MYSQL, SQLSERVER, POSTGRES.
- <DataSourceConfiguration>: Root element of the datasource configuration of the RSS instance.
- <Definition>: Root element of the datasource configuration.
- <Url>: Element provided to configure the JDBC URL that is used to connect to the database server (configured as the RSS instance).
- <Username>: Element provided to configure the username of the database user. This user connects to the database server, which is configured as the RSS instance.
- <Password>: Element provided to configure the password of the database user.
- <DriverClassName>: Element provided to configure the JDBC driver class that is used to connect to the database server (which is configured as the RSS instance).
Configuring additional RSS environments
You can add any number of RSS environments to your system, by duplicating the <Environment> section in the rss-config.xml file (shown below) and updating the environment related details. Descriptions of the rss-config.xml elements are explained above, which you can use to edit the file according to your requirements.
<Provider></Provider> <Environments> <Environment> <Name></Name> <RSSInstances> <RSSInstance> <Name></Name> <InstanceType></InstanceType> <DbmsType></DbmsType> <ServerCategory></ServerCategory> <DataSourceConfiguration> <Definition> <Url></Url> <Username></Username> <Password></Password> <DriverClassName></DriverClassName> </Definition> </DataSourceConfiguration> </RSSInstance> </RSSInstances> </Environment> </Environments>
Enabling snapshot creation for database instances
When you define the RSS instances for an environments, you can enable the possibility to create snapshots of databases using the management console. A database snapshot is a complete copy of a source database, which is taken at the time of snapshot creation. You can enable this feature by adding the following configurations to the rss-config.xml file:
Note that this configuration (snapshot creation) is not applicable to database instances of "Postgre" type.
To allow the Storage Server to create snapshots of databases in RSS instances, an authenticated connection has to be established between the Storage Server instance and the locations where the RSS instances are hosted. We will be using a keystore with a key pair for this purpose as follows:
Create a key pair and add it to a keystore. Find more information about keystores in the working with security section.
Update the rss-config.xml file with the path to the private key and the pass phrase as shown below. Note that the path to the private key created in step 1 above should be specified as the <PrivateKeyPath> in this configuration.
<PrivateKeyConfiguration> <PrivateKeyPath>/data/private/my_keys/private.key</PrivateKeyPath> <PassPhrase>pass</PassPhrase> </PrivateKeyConfiguration>
Note that this configuration is common to all RSS instances in all the RSS environments in your system.
The public key of the keystore should be shared with the hosts of the RSS instances for the authentication to work.
Details of where the RSS instance is hosted should be specified as shown below. Note that the below example shows details of the default RSS instance in SS.
<SSHInformation> <Host>remotehost</Host> <Port>22</Port> <Username>username</Username> </SSHInformation> <SnapshotConfiguration> <TargetDirectory>/home/cloud/snapshots</TargetDirectory> </SnapshotConfiguration>
- <Host>:The IP or host name of the location where the database server instance is hosted.
- <Port>: The port ID.
- <Username>: The user name required to log in to the host.
- <TargetDirectory>: The location of the database server instance in the hosting machine.
As explained above, you can add both environments as well the RSS instances directly using the rss-config.xml file. However, once you have configured all the RDBMS environments, you have the option of adding RSS instances to each environment using the management console of WSO2 Storage Server as explained here.