Skip to main content
Common Reference

The cluster_backup Command

Applies to: Tungsten Clustering for MySQL

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.

Usage
cluster_backup [action]

Where:

OptionDescriptionProductVersion
--agentThe replicator backup agent to use when running the backup, as configured in cctrl.CTTR
--datasourceExecute the backup against the specified datasource.CTTR
--directoryUse this installed Tungsten directory as the base for all operations.CTTR
--help
Aliases: -h
Show help text.CTTR
--info
Aliases: -i
CTTR
--jsonProvide return code and logging messages as a JSON object after the script finishes.CTTR
--net-ssh-optionSet the Net::SSH option for remote system calls.CTTR
--notice
Aliases: -n
CTTR
--offline-backup
Aliases:
Put the datasource OFFLINE prior to taking the backup.
Default: false
CTTR
--passwordAPI Admin user password. Default will be taken from rest-api-admin-passwordCTTR7.0.0
--quiet
Aliases: -q
CTTR
--require-automatic-modeThe script will fail if the cluster is not in the AUTOMATIC policy mode
Default: true
CTTR
--require-slave-backupRequire 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
--userAPI Admin user. Default will be taken from rest-api-admin-userCTTR7.0.0
--validateOnly run the script validation.CTTR
--verbose
Aliases: -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.

important

You should implement a check to make sure that you always have a recent backup available in the cluster!

From v7.0.0

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.