The cluster_backup Command
cluster_backup command provides a simple mechanism to execute a backup inside of the cluster. It is designed to
be called manually or as part of cron. The command should be added to cron on every server.
When started, the command will check if the server is the current coordinator for the cluster. If not, the command will exit without
an error. This design ensures that the command will only run on one server in the cluster.
The command supports command-line options that allow you to alter how and where the backup is executed.
cluster_backup [action]
Where:
| Option | Description | Product | Version |
|---|---|---|---|
--agent | The replicator backup agent to use when running the backup, as configured in cctrl. | CTTR | |
--datasource | Execute the backup against the specified datasource. | CTTR | |
--directory | Use this installed Tungsten directory as the base for all operations. | CTTR | |
--helpAliases: -h | Show help text. | CTTR | |
--infoAliases: -i | CTTR | ||
--json | Provide return code and logging messages as a JSON object after the script finishes. | CTTR | |
--net-ssh-option | Set the Net::SSH option for remote system calls. | CTTR | |
--noticeAliases: -n | CTTR | ||
--offline-backup | Put the datasource OFFLINE prior to taking the backup. Default: false | CTTR | |
--password | API Admin user password. Default will be taken from rest-api-admin-password | CTTR | 7.0.0 |
--quietAliases: -q | CTTR | ||
--require-automatic-mode | The script will fail if the cluster is not in the AUTOMATIC policy mode Default: true | CTTR | |
--require-slave-backup | Require that the backup is taken of a replica datasource. If this is enabled and there are no replicas available, no backup will be taken. Default: true | CTTR | |
--user | API Admin user. Default will be taken from rest-api-admin-user | CTTR | 7.0.0 |
--validate | Only run the script validation. | CTTR | |
--verboseAliases: -v | CTTR |
After the command confirms the current server is the coordinator, it will attempt to find a datasource to backup. Unless
--require-slave-backup has been disabled, only replicas that are ONLINE will be eligible. If no
datasource can be found, the command will exit with an error. The backup will then be started on the datasource.
The cluster_backup command will wait until the cctrl command has returned before exiting. The
cctrl command can return before the backup is completed if it takes too long or if there is another error.
You should implement a check to make sure that you always have a recent backup available in the cluster!
If manager-rest-api-authentication is true, cluster_backup will use the values of
rest-api-admin-user and rest-api-admin-password to authenticate. You can optionally use the --user and
--password options to supply the credentials to cluster_backup.
The cluster_backup command may also be configured for use in Composite clusters. In this use case, one backup
per cluster will be created.
See "Automating Backups" for more information.
For example:
shell> crontab -l
00 00 * * * /opt/continuent/tungsten/cluster-home/bin/cluster_backup >>/opt/continuent/service_logs/cluster_backup.log 2>&1
All output will be sent to /opt/continuent/service_logs/cluster_backup.log.