Configuring high availability for Repository with external database
Before you begin
- You must have installed the repository using the procedure in Installing-the-repository-using-the-wizard. Do not choose to automatically start the web server after the installation.
You must have installed an external database.
To view a list of the supported database platforms, seeTrueSight Orchestration
on the Remedy and BMC Atrium Product Compatibility Matrices page.
- Do not start the repository server before configuring the repository to use an external server. If you are upgrading to the latest version of the repository, configure the external database first and then start the repository server.
To configure the repository to use a MySQL database
- Create an external database:
- In the external database, set the max_allowed_packet variable to a value between 512 MB and 1 GB.
For information about how to set this variable, see the product documentation for your database. - Set up the database user:
- Create the user and user password.
- Set up read and write permissions for the user.
- In the external database, create a new database (for example, repository), using the credentials created in step 1.b.
- In the external database, set the max_allowed_packet variable to a value between 512 MB and 1 GB.
- Extract the contents of the repository .war file into a new baorepo directory:
- Under the repoInstallationDirectory/tomcat/webapps/ directory, create the baorepo subdirectory.
- In the baorepo subdirectory, unzip the repoInstallationDirectory/tomcat/webapps/baorepo.war file.
Place the database's connector/driver jar file in the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/lib directory.
Example:
You could place the mysql-connector-<compatibleVersion>-bin.jar file in the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/lib directory.Open the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/classes/META-INF/repository.xml file in a text editor and update it with the connection information for the external database.
The MySQL database connection properties are as follows:Parameter
Description
class
Abstract base class for the FileSystem, DataStore, PersistenceManager, and Cluster tags.
driver
The fully-qualified class name of the JDBC driver.
com.mysql.cj.jdbc.Driver
URL
URL and port number for the external database.
jdbc:mysql://<database hostname>:<port>/<database name>
You can omit the port number if you use the default port for the database.
user
Database user name that you created in step 1.
password
Password that you assigned to the database user.
schema
The string value that indicates the database type. Use the exact string value.
This is not the name of the database schema.
schemaObjectPrefix
The string of characters at the beginning of the object name.
externalBLOBs
The external file system where the data is stored. This parameter is specific to the PersistenceManager tag located in the Workspace section in the file.
Modify the FileSystem tag.
File System for MySQL<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
<param name="url" value="jdbc:mysql://<database hostname>:<port>/<database name>" />
<param name="driver" value="com.mysql.cj.jdbc.Driver" />
<param name="user" value="<database user>"/>
<param name="password" value="<database password>"/>
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="fs_"/>
</FileSystem>Add a new DataStore tag.
Data Store for MySQL<DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
<param name="url" value="jdbc:mysql://<database hostname>:<port>/<database name>" />
<param name="driver" value="com.mysql.cj.jdbc.Driver" />
<param name="user" value="<database user>"/>
<param name="password" value="<database password>"/>
<param name="databaseType" value="mysql" />
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="datastore_"/>
</DataStore>Replace both the existing PersistenceManager tags located under the Workspace and Versioning sections.
Persistence Manager for MySQL - Workspace schema<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager">
<param name="url" value="jdbc:mysql://<database hostname>:<port>/<database name>" />
<param name="driver" value="com.mysql.cj.jdbc.Driver" />
<param name="user" value="<database user>"/>
<param name="password" value="<database password>"/>
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="${wsp.name}"/>
<param name="externalBLOBs" value="false"/>
</PersistenceManager>Persistence Manager for MySQL - Versioning schema<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager">
<param name="url" value="jdbc:mysql://<database hostname>:<port>/<database name>" />
<param name="driver" value="com.mysql.cj.jdbc.Driver" />
<param name="user" value="<database user>"/>
<param name="password" value="<database password>"/>
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="version_"/>
</PersistenceManager>Add a new Cluster tag.
Cluster for MySQL<Cluster id="<unique cluster id>" syncDelay="2000">
<Journal class="org.apache.jackrabbit.core.journal.DatabaseJournal">
<param name="revision" value="${rep.home}/revision.log" />
<param name="driver" value="com.mysql.cj.jdbc.Driver" />
<param name="url" value="jdbc:mysql://<database hostname>:<port>/<database name>" />
<param name="user" value="<database user>"/>
<param name="password" value="<database password>"/>
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="journal_"/>
</Journal>
</Cluster>
- Run the following commands to set up the secondary (High-availability) repository:
- select * from journal_local_revisions where journal_id = '<unique cluster id for first repository>';
- insert into journal_local_revisions (journal_id, revision_id) values ('<unique cluster id for second repository>', 1); //replace 1 with the output of select query
Start the repository server.
To configure the repository to use an Oracle database
- Create an external database:
- Set up the database user:
- Create the user and user password.
- Set up read and write permissions for the user. Permissions must include:
- CREATE SESSION
- CREATE TABLE
- CREATE SEQUENCE
- In the external database, create a new database (for example, repository), using the credentials created in Step 1a.
- Set up the database user:
- Extract the contents of the repository .war file into a new baorepo directory:
- Under the repoInstallationDirectory/tomcat/webapps/ directory, create the baorepo subdirectory.
- In the baorepo subdirectory, unzip the repoInstallationDirectory/tomcat/webapps/baorepo.war file.
Place the database's connector/driver jar file in the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/lib directory.
Example:
You would place the ojdbc<compatibleVersion>.jar file in repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/lib directory.Open the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/classes/META-INF/repository.xml file in a text editor and update it with the connection information for the external database.
The Oracle database connection properties are as follows:Parameter
Description
class
Abstract base class for the FileSystem, DataStore, PersistenceManager, and Cluster tags.
driver
The fully-qualified class name of the JDBC driver.
oracle.jdbc.OracleDriverURL
URL and port number for the external database.
jdbc:oracle:thin:@<hostname>:<port number>/<service_name>You can omit the port number if you use the default port for the database.
user
Database user name that you created in step 1.
password
Password that you assigned to the database user.
schema
The string value that indicates the database type. Use the exact string value.
This is not the name of the database schema.
schemaObjectPrefix
The string of characters at the beginning of the object name.
externalBLOBs
The external file system where the data is stored. This parameter is specific to the PersistenceManager tag located in the Workspace section in the file.
Modify the FileSystem tag.
File System for Oracle<FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
<param name="url" value="jdbc:oracle:thin:@<hostname>:<port number>/<service_name>"/>
<param name="user" value="<database user>"/>
<param name="password" value="<database password>"/>
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="fs_"/>
</FileSystem>Add a new DataStore tag.
Data Store for Oracle<DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
<param name="url" value="jdbc:oracle:thin:@<hostname>:<port number>/<service_name>"/>
<param name="driver" value="oracle.jdbc.OracleDriver" />
<param name="user" value="<database user>"/>
<param name="password" value="<database password>"/>
<param name="databaseType" value="oracle" />
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="datastore_"/>
</DataStore>Replace both the existing PersistenceManager tags located under the Workspace and Versioning sections.
Persistence Manager for Oracle - Workspace schema<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.OraclePersistenceManager">
<param name="url" value="jdbc:oracle:thin:@<hostname>:<port number>/<service_name>"/>
<param name="driver" value="oracle.jdbc.OracleDriver"/>
<param name="user" value="<database username>"/>
<param name="password" value="<database password>"/>
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="${wsp.name}"/>
<param name="externalBLOBs" value="false"/>
</PersistenceManager>Persistence Manager for Oracle - Versioning schema<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.OraclePersistenceManager">
<param name="url" value="jdbc:oracle:thin:@<hostname>:<port number>/<service_name>"/>
<param name="driver" value="oracle.jdbc.OracleDriver"/>
<param name="user" value="<database username>"/>
<param name="password" value="<database password>"/>
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="version_"/>
</PersistenceManager>Add a new Cluster tag.
Cluster for Oracle<Cluster id="<unique cluster id>" syncDelay="2000">
<Journal class="org.apache.jackrabbit.core.journal.OracleDatabaseJournal">
<param name="revision" value="${rep.home}/revision.log" />
<param name="driver" value="oracle.jdbc.driver.OracleDriver" />
<param name="url" value="jdbc:oracle:thin:@<hostname>:<port number>/<service_name>"/>
<param name="user" value="<database username>"/>
<param name="password" value="<database password>"/>
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="journal_"/>
</Journal>
</Cluster>
- Run the following commands to set up the secondary (High-availability) repository:
--> select * from journal_local_revisions where journal_id = '<unique cluster id for first repository>';
--> insert into journal_local_revisions (journal_id, revision_id) values ('<unique cluster id for second repository>', 1); //replace 1 with the output of select query
commit; Start the repository server.
To configure the repository to use a Microsoft SQL Server 2016 and SQL Server 2019 database
- Create an external database:
- Set up the database user:
- Create the user and user password.
- Set up read and write permissions for the user. Permissions must include:
- CREATE SESSION
- CREATE TABLE
- CREATE SEQUENCE
- In the external database, create a new database (for example, repository), using the credentials created in Step 1a.
- Set up the database user:
- Extract the contents of the repository .war file into a new baorepo directory:
- Under the repoInstallationDirectory/tomcat/webapps/ directory, create the baorepo subdirectory.
- In the baorepo subdirectory, unzip the repoInstallationDirectory/tomcat/webapps/baorepo.war file.
Place the database's connector/driver jar file in the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/lib directory.
The compatible connector/driver jar file required based on the database version is listed in the following table:
Database version
Required jar file
SQL Server 2016
mssql-jdbc-6.4.0.jre8
SQL Server 2019
mssql-jdbc-9.2.1.jre8
Open the repoInstallationDirectory/tomcat/webapps/baorepo/WEB-INF/classes/META-INF/repository.xml file in a text editor and update it with the connection information for the external database.
The Microsoft SQL Server 2016 and SQL Server 2019 database connection properties are as follows:Parameter
Description
class
Abstract base class for the FileSystem, DataStore, PersistenceManager, and Cluster tags.
driver
The fully-qualified class name of the JDBC driver.
com.microsoft.sqlserver.jdbc.SQLServerDriverURL
URL and port number for the external database.
jdbc:sqlserver://<database hostname>:<port>;databaseName=<database name>You can omit the port number if you use the default port for the database.
user
Database user name that you created in step 1.
password
Password that you assigned to the database user.
schema
The string value that indicates the database type. Use the exact string value.
This is not the name of the database schema.
schemaObjectPrefix
The string of characters at the beginning of the object name.
externalBLOBs
The external file system where the data is stored. This parameter is specific to the PersistenceManager tag located in the Workspace section in the file.
Modify the FileSystem tag.
File System for Microsoft SQL Server 2016 and SQL Server 2019<FileSystem class="org.apache.jackrabbit.core.fs.db.MSSqlFileSystem">
<param name="url" value="jdbc:sqlserver://<database hostname>:<port>;databaseName=<database name>"/>
<param name="user" value="<database user>"/>
<param name="password" value="<database password>"/>
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="fs_"/>
</FileSystem>Add a new DataStore tag.
Data Store for Microsoft SQL Server 2016 and SQL Server 2019<DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
<param name="url" value="jdbc:sqlserver://<database hostname>:<port>;databaseName=<database name>"/>
<param name="driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<param name="user" value="<database user>"/>
<param name="password" value="<database password>"/>
<param name="databaseType" value="mssql" />
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="datastore_"/>
</DataStore>Replace both the existing PersistenceManager tags located under the Workspace and Versioning sections.
Persistence Manager for Microsoft SQL Server 2016 and SQL Server 2019 - Workspace schema<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.MSSqlPersistenceManager">
<param name="driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<param name="url" value="jdbc:sqlserver://<database hostname>:<port>;databaseName=<database name>"/>
<param name="user" value="<database username>"/>
<param name="password" value="<database password>"/>
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="${wsp.name}"/>
</PersistenceManager>Persistence Manager for Microsoft SQL Server 2016 and SQL Server 2019 - Versioning schema<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.MSSqlPersistenceManager">
<param name="driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<param name="url" value="jdbc:sqlserver://<database hostname>:<port>;databaseName=<database name>"/>
<param name="user" value="<database username>"/>
<param name="password" value="<database password>"/>
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="version_"/>
</PersistenceManager>Add a new Cluster tag.
Cluster for Microsoft SQL Server 2016 and SQL Server 2019<Cluster id="<unique cluster id>" syncDelay="2000">
<Journal class="org.apache.jackrabbit.core.journal.MSSqlDatabaseJournal">
<param name="revision" value="${rep.home}/revision.log" />
<param name="driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<param name="url" value="jdbc:sqlserver://<database hostname>:<port>;databaseName=<database name>"/>
<param name="user" value="<database username>"/>
<param name="password" value="<database password>"/>
<param name="schema" value="<schema name>"/>
<param name="schemaObjectPrefix" value="journal_"/>
</Journal>
</Cluster>
- Run the following commands to set up the secondary (High-availability) repository:
- --> select * from journal_local_revisions where journal_id = '<unique cluster id for first repository>';
--> insert into journal_local_revisions (journal_id, revision_id) values ('<unique cluster id for second repository>', 1); //replace 1 with the output of select query Start the repository server.