• No results found

Database Mirroring

In document Cumulus 8.1. Administrator Guide (Page 49-53)

Mirroring enables you to use the Cumulus database as a ‘caching engine’ that for example saves data into an external SQL-compatible database. In this role, a Cumulus catalog serves as a permanent cache.

Saving the data in an SQL database offers the advantage that any SQL analyses are possible. However, changes made to the catalog data from within the SQL database are not copied back to Cumulus and therefore should not be made. When a mirrored catalog is rebuilt, the SQL database serves as master. Each catalog requires its own SQL database.

Canto provides a plug-in that includes support for different SQL database systems. (The support for Oracle is available with Cumulus Enterprise only.) If you require support for another database system, contact Canto. Each database system requires it own JDBC driver. The JDBC drivers for most systems are pre-installed; except one: The official JDBC driver for MySQL must be downloaded from the MySQL website

(www.mysql.com). Currently the driver is available under:

http://dev.mysql.com/downloads/. The driver must be copied to the appropri- ate subfolder of the esp folder in your Cumulus Server installation folder. The subfolder dbmirror contains a folder named lib. Copy the down- loaded driver into this lib folder (e.g to ..esp/dbmirror/lib).

Cumulus catalogs of a second Cumulus Server installation can also serve as mirroring target databases. For more information, see “Using Cumulus Catalogs as Mirroring Target Databases,” p. 51.

A catalog is set up for mirroring on the Mirroring tab of a catalog’s set- tings ( Cumulus/ Edit > Preferences > Catalog Settings.)

PRECONDITIONS: To set up a catalog for mirroring, you must have the appropriate Administrator permissions (Permissions > Administrator Per- missions > Manage Mirroring (option for the Modify Catalog Settings per- mission.)

If you want to use mirroring, you should activate it directly after you have installed Cumulus, or after new catalogs are created. Note that once you activate the mirroring option for a catalog, the initialization can take some time, depending on the size of the catalog. (And the process can- not be paused – if interrupted, it must be started from the beginning.) NOTE >>> Never set up multiple catalogs for mirroring at once. Start the process for a subsequent catalog only after the previous catalog has been completely processed. <<<

If mirroring is activated, the events to be saved in the SQL database are written in a task queue. For safety reasons, each task is saved in a tempo- rary internal file. This file is deleted after the task is successfully processed. Storage locations for the queues and safety files are defined in the server.xml file found in the conf folder in the Cumulus Server installation folder. You define the basic or “root” folder for the files. This folder will house the subfolders for the queues—one subfolder for each queue (named as the unique identifier given for the queue). The default storage location is the Cumulus Server installation folder. If you want to use mir- roring, you should define the storage location directly after you install Cumulus. The collection of these files can become quite large, requiring ample storage space. The required space depends on the SQL database system and the amount of data stored in each asset. There is a difference between the initial process and normal operation. As rule of thumb: twice the size of the mirrored catalog file is recommended.

Note that if you have a catalog mirrored to a SQL database, you should back up the target database and not the original Cumulus catalog. For information on how to repair a mirrored catalog using the target data- base, see “Repairing Catalogs,” p. 58.

Example dialog for setting up mirroring. The fields for defining the database depend on the selected database system.

SECURING CATALOGS 51

Error Management

Basic mirroring errors are written to the system log of the Cumulus Server (e.g. when mirroring could not be started.) Errors that occur while mirror- ing is running are logged as configured in the log4j.xml file, which is found in the conf folder in the Cumulus Server installation folder. Canto recommends you have one log file for all mirroring events and set up email notification for all errors that occur while mirroring.

If the SQL database addressed by mirroring is not available, an error will be logged and the Cumulus Server will try to process the current task again and again. As soon as SQL database is available again, the process is resumed automatically. However, if it cannot be resumed, the size of the task queue will grow with any change performed on the catalog.

TIP: For some analysis reasons you may need to know the Short ID of a field. To find out the IDs of a field you can have it displayed in the Properties window. To have a field’s IDs (Short ID and Field ID) dis- played, you need to change the client.xml file on the machine where you run the Cumulus Client application. (The client.xml file is located in the conf folder in the Cumulus Client installation folder.) Add the following line to the client.xml file.

<ns:PrefsUseAdvancedFieldView>1</ns:PrefsUseAdvancedFieldView>

To not have the IDs displayed, just change the parameter to 0.

BACKGROUND INFORMATION: Performance

The performance depends on the SQL database system in use. During normal runtime testing, Canto did not experience perfor- mance delays or differences between different SQL database sys- tems. The time needed for the initial process, however, depends on the SQL database in use. The time needed for the initial process is also influenced by the cache size available for the Cumulus Server (File > Administration > Server Console > Remote Admin > Settings > Optimization.)

Using Cumulus Catalogs as Mirroring Target Databases Cumulus catalogs can also serve as mirroring target databases. This requires a second Cumulus Server installation. Then one Cumulus catalog can be mirrored to another Cumulus catalog of the other Cumulus Server installation. This offers failover functionality and load balancing. A target Cumulus catalog at the secondary Cumulus Server is set to read only. With read-only applications (e.g. Web Publisher Pro) it can be used as a read-only replica and take load from the primary Cumulus Server. Note that Cumulus Triggers only work in the original catalog.

MIGRATION NOTE >>> If you mirror a Cumulus 6 catalog, the target cat- alog will always be a Cumulus 7 catalog. <<<

When using Cumulus as target database system, the following data are required to define the database serving as mirror:

• Server – IP address of the computer hosting the Cumulus Server • User – Login name of the Cumulus Administrator of the Cumulus

Server used as mirror.

• Password – Password of the Cumulus Administrator of the Cumulus Server used as mirror.

• Database Path – Path of the Cumulus catalog file

NOTE >>> You can either enter the path of an existing catalog or have a new one created by entering its path. <<<

Setting up a Catalog for Mirroring

Before you activate mirroring for any catalog, the location for queues and the task safety files should be configured. The location is defined in server.xml file, which is found in the conf folder in the Cumulus Server installation folder.

The initial process setting up a catalog for mirroring takes some time, depending on the size of the catalog file and the SQL database system in use. During this time, other users are blocked from accessing the catalog. For this reason, Canto recommends you deactivate the sharing option for this catalog before you start the initial process.

To set up a catalog for mirroring:

1. Make sure the collection window containing the catalog is the active window in Cumulus.

2. Select Cumulus/ Edit > Preferences. 3. Click Catalog Settings.

The Catalog Settings window appears. If the active collection win- dow contains more than one catalog, select the catalog you want to edit under Catalogs.

4. Click Mirroring. This displays the current settings for the selected catalog.

5. Activate the Use Database Mirroring option.

The fields for the mirroring target database are activated. 6. Select the database system you want to use. Depending on the

selected database system, the fields for defining the actual data- base are displayed.

7. Enter the data required. You must define a different target data- base for each catalog to be mirrored.

Example: With a MySQL 5 database, the following data are required:

• Server – IP address of the server hosting the SQL database • Database – Name of the SQL database

• User – Login name of the SQL database user • Password – Password for the SQL database user

NOTE >>> If the target database is another Cumulus catalog, you can either enter the path of an existing catalog or have a new one created by entering its path. <<<

8. Click OK to start the mirroring. The field below the definition fields informs you on the status of the mirroring.

In document Cumulus 8.1. Administrator Guide (Page 49-53)