4.1 Configuring Mirroring
4.1.5 Adding Databases to a Mirror
Only local databases on the currently active primary failover system can be added to a mirror.
Note: Only data in CACHE.DAT files can be mirrored. Data that is external (that is, stored on the file system) cannot be mirrored by Caché.
In addition, journaling must be enabled on the database before it can be added to the mirror; if journaling is not enabled, you cannot add the database to the mirror.
Mirrored databases must be present on both the primary and backup failover members as well as on async members that use them. In addition, namespaces and global/routine/package mappings associated with the mirrored databases must be the same on all mirror members, .
The mirrored database on the backup failover member must be mounted, active and caught up (for more information, see
Database Considerations and Activating/Catching up Mirrored Databases in this chapter) to be able to take over as the primary in the event of a failover.
After configuring a database for mirroring, add it to the backup failover member, as well as to all async member(s) that need to access it. To add databases to the mirror, do the following on the currently active primary failover system:
Important: To ensure that the database is mirrored, you must perform steps 1 through 4 (on the primary failover member), in the specified order, before you back up the database.
34 Caché High Availability Guide Mirroring
1. Navigate to the [System] > [Configuration] > [Local Databases] page of the Management Portal, and click Edit next to the database you want to add to the mirror.
2. On the Database Properties page, click Add to Mirror.
Note: If journaling is not enabled on the database, Databases must be journaled to be mirrored is displayed in place of this link; to enable it, select Yes from the Global Journal State drop-down list.
3. In the Add database to mirror window, either accept the default name or specify a unique name to identify the mirrored database.
Note: By default, the local name of the database is displayed as the name of the database in the mirror. However, because multiple mirrored databases cannot have the same mirror database name, you must ensure that the name is unique; if the database has already been configured as a mirror database, you must change the name.
4. Click Add to mirror.
5. Back up the mirrored database on the primary failover member. Depending on the database backup strategy you use (see Backup Strategies in the “ Backup and Restore ” chapter of the Caché Data Integrity Guide), consider the following:
• Caché Online Backup — With this strategy, you can back up mirrored databases on any mirror member. Inter-
Systems recommends that you run backups on all members nightly to ensure that non-mirrored databases on the backup failover member and async members are backed up, and both mirrored and non-mirrored databases on the primary failover member are backed up.
• External Backup or Cold Backup — InterSystems recommends that you back up mirrored databases on the
primary failover member nightly. In addition, it is recommended that you back up non-mirrored databases on both the primary and backup failover members, as well as on all connected async members, nightly to ensure consistency between databases on all members.
For more information, see Database Considerations in this chapter.
6. Restore the mirrored database on the backup failover member and all connected async members. Depending on the backup restore method you use (see Restoring from a Backup in the “ Backup and Restore ” chapter of the Caché Data
Integrity Guide), consider the following:
• Caché Online Backup Restore (^DBREST) Routine — The routine automatically resynchronizes mirrored
databases when they are restored on the backup failover member or any async mirror member. In addition, the restore process on the backup failover member automatically negotiates with the running primary to ensure that the restored mirrored database(s) are activated and caught up. For more information seeMirrored Database Con- siderations in the “ Backup and Restore ” chapter of the Caché Data Integrity Guide.
Note: Ensuring that the mirrored databases are synchronized requires that the journal files from the time of the backup are available and online; for information about restoring mirror journal files see Restoring Mirror Journal Files in the “ Journaling ” chapter of the Caché Data Integrity Guide.
If the relevant journal files on the primary failover member have been purged, you must restore a more up-to-date backup; for information about purging mirror journal files see Purge Journal Files in the
“ Journaling ” chapter of the Caché Data Integrity Guide.
• External Backup Restore or Cold (Offline) Backup Restore — Both of these methods require that you manually Configuring Mirroring
7. If required, activate and/or catch up the mirrored databases on the backup failover member and async member(s) as described in Activating/Catching up Mirrored Databases in this chapter.
Note: If the backup failover member and/or async member(s) have a different endianness than the primary failover member, see Member Endianness Considerations in this chapter.
When subsequent copies of a mirrored database are created on non-primary mirror members, the data to begin the catch- up process may not have been sent yet. If the required data does not arrive within 60 seconds, the catch-up process begins anyway; those databases may not catch up if the data does not arrive before it is required, however, in which case a message regarding the database(s) that had the problem is logged in the cconsole.log file.
Note: During database creation there would be only one database; however this also applies to catching up in other sit- uations where multiple databases are specified.
4.1.5.1 Activating/Catching up Mirrored Databases
Activate and/or catch up mirrored databases on the backup failover member and async member(s) through the Mirror Monitor (see the “Monitoring Caché Mirroring Performance” chapter of the Caché Monitoring Guide) .
Mirrored databases must be activated on the backup failover member and async member(s). To activate mirrored databases, do the following on the backup failover member and async member(s):
1. Navigate to the [System] > [Mirror Monitor] page.
2. Click Activate in the row of the database you wish to activate.
Similarly, mirrored databases must be caught up on the backup failover member and async member(s). To catch up mirrored databases, do the following on the backup failover member and async member(s):
1. Navigate to the [System] > [Mirror Monitor] page.
2. Click Catch up in the row of the database you wish to catch up.
In addition, you can remove databases from the mirror as described in Removing Mirrored Databases from Mirrors in this chapter. To perform these actions simultaneously for one or more mirrored databases, click More Actions, then click the action you want to perform.