This section describes online backup of the admin server.
When using online backup of the admin server, the PostgreSQL Point-In-Time Recovery (PITR) mechanism is used in the backup of the metering database.
When using PITR backup and restoration, the following two resource types are backed up and restored:
Base Backup
The entire database cluster (file group in which database data is recorded) is backed up.
WAL File
Write-Ahead Log (WAL) files are files in which the contents of updates to the database are recorded.
Backup of the two preceding resource types is taken when the commands for the two corresponding backup methods (base backup and differential backup) are executed.
Resources that are backed up and restored using PITR are stored in the directory that has been specified in the settings file, regardless of the storage destination specified when the command was executed. Refer to "10.1.5 Online Backup Settings for Metering" for information on how to set this.
Each of the backup methods for performing online backup of the admin server is described below.
Base Backup
Base backup is the backup of the entire database cluster (file group in which database data is recorded).
Execute the command shown below.
For details on the command, refer to "6.6 rcxmgrbackup" in the "Reference Guide (Command/XML) CE".
>Installation_folder\SVROR\Manager\bin\rcxmgrbackup -dir directory -base [-cleanup] <RETURN>
# /opt/FJSVrcvmr/bin/rcxmgrbackup -dir directory -base [-cleanup] <RETURN>
Note
The backup command may not end normally at times, so do not perform the following operations:
Forced end using Ctrl+C during execution of the backup command
Stopping the Manager during execution of the backup command
If the operations listed above have been performed, the following action will be required, depending on the status:
Execute the command shown below the next time and any subsequent times the base backup does not end normally.
When this command is executed, base backup will end normally.
For details on the command, refer to "12.10 ctmg_resetbackuperror (Recover Base Backup Error)" in the "Reference Guide (Command/XML) CE".
<Installation_folder>\RCXCTMG\bin\ctmg_resetbackuperror.bat
The processing result is output as standard output.
The contents and meaning of the processing result are shown in the table below.
Processing Result | Return Value | Message |
---|---|---|
Normal end | 0 | Successfully reset the base-backup error. |
Error | Other than 0 | Failed to reset the base-backup error. |
If starting of the Manager fails
When operations continue after a while without the command mentioned above (ctmg_resetbackuperror) being executed, and then the Manager is stopped, subsequent starts of the Manager may fail. If this happens, an error message will be output to the database log files, as follows:
Database Log Files
Installation_folder\RCXCTMG\Charging\log\psql-nn.log (*)
* Note: The "nn" part is a 2-digit numeral indicating the day on which the log was output.
Error Message
Example: If the access control database failed to start
LOG: could not open file "pg_xlog/xxxxxxxx" (log file 0, segment xx): No such file or directory (*) LOG: invalid checkpoint record PANIC: could not locate required checkpoint record HINT: If you are not restoring from a backup, try removing the file "C:/Fujitsu/ROR/RCXCTMG/Charging/pgsql/data/backup_label".
* Note: The "xxxxxxxx" and "xx" parts of the log are undefined.
In a case like this, delete the file shown below. When this file is deleted, start of the Manager will end normally. When this file is deleted, start of the Manager will end normally.
Installation_folder\RCXCTMG\Charging\pgsql\data\backup_label
Differential Backup
With differential backup, the contents of updates to the database are output to multiple files in 16 MB-sized lots.
These files are called Write-Ahead Logging (WAL) files.
Usually, for each 16 MB written, the WAL file being written to is switched, and the WAL file for which writing has been completed is saved to the "wal" directory under the backup directory.
Execute the rcxmgrbackup command.
Periodically executing the rcxmgrbackup command allows the contents of updates to the database that are recorded in saved WAL files to be maintained for a certain period of time. For example, when the rcxmgrbackup command is executed every hour, the contents of updates performed in the most recent one-hour period will be saved.
For details on the command, refer to "6.6 rcxmgrbackup" in the "Reference Guide (Command/XML) CE".
>Installation_folder\SVROR\Manager\bin\rcxmgrbackup -dir directory [-cleanup] <RETURN>
# /opt/FJSVrcvmr/bin/rcxmgrbackup -dir directory [-cleanup] <RETURN>
The following items must be determined before periodic execution is implemented.
Items | What to Decide |
---|---|
Frequency and timing of base backup | Determine the frequency of base backup. |
Frequency and timing of differential backup | Determine the frequency of differential backup. |
Location of backup | Determine the location of the backup. Setting a disk other than the disk that installed the product is recommended. In addition, sufficient capacity is required to be able to store the backup file. |
Refer to "10.1.5 Online Backup Settings for Metering" for information on how to set the backup destination.
The following two settings are required in order to perform periodic execution of backup:
Settings for periodic execution of base backup
Setting for periodic execution of WAL file save
Note
If this procedure has been used to start batch files using the Task Scheduler, a command prompt is displayed while the batch files are being executed. Do not close this command prompt.
When an error occurs at periodic execution of online backup, a message with the error code 67198 will be output to the log files. If the occurrence of errors is being monitored, use software for monitoring the log files to monitor this error message. For details on the error message, refer to "Message number 67198" in "Messages".
Settings for Periodic Execution of Base Backup
Specify settings so that a base backup is taken periodically.
Use Windows Task Scheduler as a mechanism for periodically executing commands. Refer to Windows Help for information on how to set the Task Scheduler.
This section describes an example of a setup procedure for implementing a backup at 3:00 a.m. on the 1st of every month.
From the Windows [Start] menu, select [Administrative Tools]-[Task Scheduler] to start the Task Scheduler.
To manage tasks hierarchically, use the following procedure to create a folder:
In the Task Scheduler menu, after selecting Task Scheduler Library, select [Actions]-[New Folder], and then enter any folder name in the dialog box that is displayed and click <OK>.
Selecting the created folder and then creating another folder by selecting [Actions]-[New Folder] from the Task Scheduler menu allows a further hierarchical level to be added.
Point
Creating a folder in Task Manager allows tasks to be managed hierarchically. In cases such as where multiple tasks are to be registered, creating a folder allows task management to be performed efficiently.
From the Task Scheduler menu, select Actions >> Create Basic Task to display the Create Basic Task Wizard.
Point
When a subsequent operation is performed after any folder is selected, the task will be registered under that folder. If a folder is not selected, the task will be registered in the Task Scheduler Library.
In the [Name] field, enter a task name (for example, "Monthly backup") and click <Next>.
Select "Monthly" as the task trigger and click <Next>.
In the Start field, set the date and time at which periodic backup is to start.
Example: Set a date of the "1st" of the following month and "3:00:00".
In the [Months] field, select the "Select all months" checkbox.
In the [Days] field, select the "1" checkbox.
Click <Next>.
Select "Start a program" as the task action and click <Next>.
Click <Browse> and in the [Program/script] field, set the batch files for base backup.
Example
C:\work\backupall.bat
@echo off
echo "Resource Manager Cloud Edition Resources backup Start"
call "{Installation_folder}\SVROR\Manager\bin\rcxmgrbackup" -directory {storage destination folder} -base
echo "Resource Manager Cloud Edition Resources backup End"
For details on the rcxmgrbackup command, refer to "6.6 rcxmgrbackup" in the "Reference Guide (Command/XML) CE".
In the [Add arguments (optional)] field, set a character string to be used for outputting the command output to log files.
Example: >>F:\backup\backupall.log 2>&1
Click <Next>.
Check the task settings, and if they are correct, click <Finish>.
Settings for Periodic Execution of Differential Backup
Specify settings so that a differential backup is taken periodically.
This section describes an example of a setup procedure for saving a differential backup every hour.
Point
When using the Create Basic Task Wizard, execution for a time interval shorter than one day cannot be set, so once the task has been registered for a different frequency, change the properties.
From the Windows [Start] menu, select [Administrative Tools]-[Task Scheduler] to start the Task Scheduler.
To manage tasks hierarchically, use the following procedure to create a folder:
From the Task Scheduler menu, after selecting Task Scheduler Library, select [Actions]-[New Folder], and then enter a folder name in the dialog box that is displayed and click the <OK> button.
Selecting the created folder and then creating another folder by selecting [Actions]-[New Folder] from the Task Scheduler menu allows a further hierarchical level to be added.
Point
Creating a folder in Task Manager allows tasks to be managed hierarchically. In cases such as where multiple tasks are to be registered, creating a folder allows task management to be performed efficiently.
From the Task Scheduler menu, select [Actions]-[Create Basic Task] to display the Create Basic Task Wizard.
Point
When a subsequent operation is performed after any folder is selected, the task will be registered under that folder. If a folder is not selected, the task will be registered in the Task Scheduler Library.
In the [Name] field, enter a task name (for example, "Periodic WAL switching") and click the Next button.
Select Daily as the task trigger and click the Next button.
In the Start field, set the date and time at which online backup (WAL) is to start.
Example: Set the date of the following day and "0:00:00".
In the [Recur every] field, set 1 day (set by default).
Click the Next button.
Select Start a program as the task action and click the Next button.
Click the <Browse> button and in the [Program/script] field, set the batch files for online backup (WAL).
Example
C:\work\hourlybackup.bat
@echo off
echo "Resource Manager Cloud Edition Resources backup Start"
call "{Installation_folder}\SVROR\Manager\bin\rcxmgrbackup" -dir {storage destination folder}
echo "Resource Manager Cloud Edition Resources backup End"
For details on the rcxmgrbackup command, refer to "6.6 rcxmgrbackup" in the "Reference Guide (Command/XML) CE".
In the Add arguments (optional) field, set a character string to be used for outputting the command output to log files.
Example: >>F:\backup\backupall.log 2>&1
Click the Next button.
Check the task settings, and if they are correct, click the <Finish> button.
Select the registered task from the task list, and select [Action]-[Properties] to open the Properties dialog.
Open the Triggers tab, select the existing trigger, and click the Edit button.
Check the [task every:] checkbox in [Advanced settings], and select "1 hour" (set by default).
For the [for a duration of], select "1 day" (set by default).
Click the OK button.