User's Guide
Get Adobe Reader |
The following sections describe how to backup and restore WebLogic Network Gatekeeper installations:
The following sections describe two types of system backups. The first type, the full system backup, makes a backup copy of all BEA WebLogic Network Gatekeeper related software, installed applications, configuration files and database tables. A full system backup should be performed after the system has been successfully verified and after major re-configurations, upgrades and when patches have been installed in the system.
The second type, the system data backup, is a smaller backup that makes a backup copy of the configuration files, user certificates and database tables. This backup has to be performed on a regular basis and when new applications have been installed.
System backup procedures may vary for different systems and configurations, depending on system type, additional equipment connected to the system, and so on. This chapter gives a recommendation on how to perform backup and restore, and also gives information the tools to support these procedures.
The database and system backup files generated by the backup scripts are named as follows:
system_<date>.zip.
data_<date>.zip
Where <date>
represents the creation date and time.
The files are zipped together and requires an unzip-utility, like jar, in order to restore them.
The backup-files are created in a directory as defined in the
xml-tag <BACKUP directory="<dir>"/>
in the file slee_properties.xml.
Replace <dir>
with the full path to the desired directory, preferably on a separate disk.
To apply the changes, the script SLEEConfig.sh -px must be executed. The script is located in the bin
directory of the installation.
For example, edit the file slee_properties.xml
and change the lines to (the given path is just an example of a path to a separate disk):
Save and close the file, and run the script SLEEConfig.sh -px to apply the changes.
To enable data backups on a single database system, make sure binary logging is enabled.
server-id=1
log-bin=
/usr/local/mysql/
data/query-bin
If the rows were not present, proceed with the next step. If the rows are present, binary logging is enabled and no further action is needed.
Since MySQL is stopped during this procedure, make sure that all SLEEs using the database are in state shutdown.
cd
/usr/local/mysql/
./bin/mysqladmin -u root -p shutdown
./bin/safe_mysqld &
Follow the instruction below to perform a full system backup. The backup saves all software and data related to the BEA WebLogic Network Gatekeeper system, including third party products and database tables.In order to reduce the size of the database backup, it is recommended to dump the charging data to a text-file, see Chapter 9, Charging Data Export before performing the backup. It is also recommended to remove old alarms, events, and statistics from the database. See Deleting alarm entries from the database on page 10-4, Deleting event entries from the database on page 10-7, and Deleting statistics data from the database on page 8-7.
If using a single database system, follow the instructions below to perform a backup. If using a replicated database system, perform the procedure as described in Backup replicated database system on page 18-6.
Note: No updates can be made on the database during the full system backup, causing the system to halt during the procedure. It is strongly recommended to shutdown all SLEE instances that use the database during the full system backup.
Caution: If the MySQL client is closed during the execution of Step 4 to Step 9, the result will be corrupt data in the backup.
FLUSH TABLES WITH READ LOCK;
FLUSH LOGS;
SHOW MASTER STATUS;
+--------+----------+--------------+------------------+
| File | Position | Binlog_do_db | Binlog_ignore_db |
+--------+----------+--------------+------------------+
| <file> | <pos> | | |
+--------+----------+--------------+------------------+
1 row in set (0.00 sec)
PURGE MASTER LOGS TO '<file>'
<file>
is replaced by a file name as output in Step 6 on page 5. The name is for example query-bin.114
Note: This step must be performed from another command window, or using a file manager. Do not exit the MySQL client.
UNLOCK TABLES;
exit
follow the instructions below to perform a backup.
If using a single database configuration, see Backup single database system on page 18-4.
Note: The standby database will be shutdown during the backup. If the currently active database crashes during the backup, there will be no database available for BEA WebLogic Network Gatekeeper, causing it to fail.
Note: It is important to perform the procedure on both computers hosting the database in order to create a complete backup.
/usr/local/slee/bin/db_runDualSystemBackup.sh
If the script was run on the standby database, it will create a backup. It will also produce a message informing where to find the files. The files system_<date>.zip
and data_<date>.zip
, where <date>
represents the current date and time, are created. Static MySQL files are backed up to system_<date>.zip.
MySQL Database files are backed up to data_<date>.zip
If the script was run on the currently active database only the configuration file, my.cnf
, and MySQL static files are copied. It will also produce a message informing where to find the files.
In both cases, the files are created in the directory as configured. See Setting up backup directories on page 18-1.
Follow the instruction below to perform a system data backup. The backup saves all BEA WebLogic Network Gatekeeper system data from the database, but not BEA WebLogic Network Gatekeeper system software.
The system data backup on a single database system does not interfere with the system operation. The script can be a scheduled job to be executed periodically. The backed up files should be moved from the backup directory and saved on tape after each execution to avoid full disk.
Note: The files backed up are the ones generated since the last full system backup. In order to reduce the size of the files, and thereby shorten the time it takes to perform a restoration, it is recommended to perform a full system backup on a regular basis when using a single database system. It is important to save all system data backup files since the last full system backup.
The script can be a scheduled job to be executed periodically. It should be scheduled to run at the same time on both database nodes, since it will only copy files on the standby database. The backed up files should be moved from the backup directory and saved on tape after each execution to avoid full disk.
Note: The standby database will be shutdown during the backup. If the currently active database crashes during the backup, there will be no database available for BEA WebLogic Network Gatekeeper, causing it to fail.
Note: It is important to perform the procedure on both computers hosting the database in order to create a complete backup.
/usr/local/slee/bin/db_runDualDataBackup.sh
If the script was run on the standby database, it will create a backup. The script displays a message informing where to find the backed up files.
The file data_<date>.zip
, where <date>
represents the current date and time, is created. Database tables are backed up to data_<date>.zip
If the script was run on the currently active database only the configuration file, no files are copied. The script displays a recommendation to run the script on the inactive database.
In both cases, the files are created in the directory as configured. See Setting up backup directories on page 18-1.
System restoration includes both restoring the full BEA WebLogic Network Gatekeeper system and restoring the system data. When restoring the full system, all BEA WebLogic Network Gatekeeper software (including third party software) and all system data is restored. In case of a system data restoration, user certificates and database tables are restored.
For a successful restoration, the backup must have been performed according to the sections Performing a full system backup on page 18-3 and Performing a system data backup on page 18-6 respectively.
Also, it is important that the same directory structure is used on the restored system as on the backed up system.
If one of the databases in the system has failed it is possible to create a snapshot of the still running database host and use that snapshot for restoring the failed database. This is called a database snapshot restoration.
Follow the instruction below to perform a full system restoration. The restoration requires:
/usr/local/mysql/bin/mysqladmin -u root -p shutdown
cd /usr/local/mysql/
jar xf <system_backup_file>
Caution: Follow the instruction below to perform a restoration of BEA WebLogic Network Gatekeeper system data. After the restoration, all data that has been written to the database after the latest backup will be lost.
It is necessary to run system data backups frequently to avoid to large data loss in case of a database crash
Note: The restoration requires a system data backup copy made according to the section Performing a system data backup on page 18-6.
The MySQL root
user is used in all MySQL commands.
Caution: For single database system data restoration you also need the last full system backup together with all system data backup files since the latest full system backup. The different backup files needs to be synchronized; never add system data backup files older than the full system backup used.
/usr/local/mysql/bin/mysqladmin -u root -p shutdown
cd /usr/local/mysql/
./bin/safe_mysqld &
Note: Relevant system data backup files are the ones taken since last full system backup.
/usr/local/mysql/
bin/mysqlbinlog <backup dir>/query-bin.[0-9].* | /usr/local/mysql/bin/mysql -u root -p
For dual (replicated) database system data restoration you need the latest performed system data backup.
Note: After the restoration, all data written to the database after the latest backup will be lost. Run backups frequently to avoid to large data loss in case of a database crash.
In a replicated database system, if one database crashes, all information should be present in the still working database. It is possible to save this data when restoring this node, and import this data in a separate MySQL installation to be able to, for instance, dump charging data.
The following references are used below.
Host A: The computer hosting database A.
Database A: The database that will replace the previously malfunctioning database (or standby database if the restoration is a rollback to a previous configuration).
Host B: The computer hosting database B.
Database B: The currently active database used by the system.
/usr/local/mysql/bin/mysqladmin -u root -p shutdown
cd /usr/local/mysql/
jar xf <system_backup_file>
<system_backup_file>
is the name of the system back-up file./usr/local/mysql/data
. Check both database A and database B to get the latest backup copy.cd /usr/local/mysql/data
jar xf <data_backup_file>
chown -R root:mysql /usr/local/mysql
chown -R mysql /usr/local/mysql/data
Where <data_backup_file>
is the name of the data back-up file.master
into comments, by inserting a hash (#
) character in the beginning of the row.data
. Use the same backup copy as in Step 2 on page 13, sub-step f.master-host
in my.cnf
in host A is the IP address of Host B and vice versa.CHANGE MASTER TO
MASTER_HOST='<database B IP address>',
MASTER_USER='<replication user>',
MASTER_PASSWORD='<replication password>',
MASTER_PORT=<database B port>;
<database B IP address>
, <replication user>
, <replication password>
, <database B port>
are replaced with the corresponding values, as defined in my.cnf
.
SHOW MASTER STATUS;
SHOW SLAVE STATUS;
Follow the instruction below to perform a backup and restore procedure that can be used when one of the databases in the system has failed and needs to be restored. The procedure assumes that there is still one functional and active database in the system.
When performing a snapshot of the functional database it must be locked for some time in order guarantee a stable copy. During the lock time all write requests towards the database will be blocked. In order to reduce the lock duration it is possible to specify a list of database tables that can be temporary renamed and copied separately in order to reduce the lock duration.
The tables to be separately copied can me managed with the addMasterSnapshotSpecialCopyTable, removeMasterSnapshotSpecialCopyTable and listMasterSnapshotSpecialCopyTable OAM methods in the SLEE_backup service.
The data in the specified tables will become unavailable for the duration of the snapshot process but will become available again after completion of the snapshot process. This may cause outstanding requests to be lost.
The following are some examples of tables suitable for separate copy:
The backup snapshot is created by executing the createMasterSnapshotForRestore method in the SLEE_backup OAM interface.
Note that during creation of the snapshot the database slave replication thread at the functional database will be stopped. Once the other database host has been restored it must be started again using the restartSlaveThreadAfterSnapshotRestore OAM method.
Alarms will be generated to indicate when the snapshot procedure has ended and where it is located.
Pack the backup snapshot files together That is, perform the following commands:
cd /usr/local/slee/backup/<snapshot_timestamp>
tar cvf db_snapshot_backup.tar mysql slee_db
FTP the backup to the machine with the failed database.
Restore the failed database host:
rm -r /usr/local/mysql/data/*
/usr/local/mysql/data
so that the mysql
and slee_db
directories are created under /usr/local/mysql/data
chown -R mysql /usr/local/mysql/data
chgrp -R mysql /usr/local/mysql/data
postconfig.sh
in /usr/local/slee/bin
in order to create a proper my.cnf
file. Executing postconfig.sh
will also restart the database.
If corrupt database tables are discovered during a restoration, they might be recovered. Follow the instructions given in section "Disaster Prevention and Recovery "in MySQL Reference Manual.