Continuent Documentation

8.27. The tungsten_provision_slave Script

Version Support: 2.0.1

The script was added in Continuent Tungsten 2.0.1. It cannot be backported to older versions.

The tungsten_provision_slave script allows you to easily provision, or reprovision, a database server using information from a remote host. It implements the Tungsten Script Interface as well as these additional options.

tungsten_provision_slave [ --clear-logs ] [ --direct ] [ --directory ] [ -f, --force ] [ --help, -h ] [ --info, -i ] [ --json ] [ --mysqldump ] [ --net-ssh-option ] [ --notice, -n ] [ --offline ] [ --offline-timeout ] [ --online ] [ --service ] [ --source ] [ --validate ] [ --verbose, -v ] [ --xtrabackup ]

Where:

Table 8.51. tungsten_provision_slave Command-line Options

OptionDescription
--clear-logsDelete all THL and relay logs for the service
--directUse the MySQL data directory for staging and preparation
--directoryThe $CONTINUENT_ROOT directory to use for running this command. It will default to the directory you use to run the script.
--force, -fContinue operation even if script validation fails
--help, -hShow help text
--info, -iDisplay info, notice, warning, and error messages
--jsonOutput all messages and the return code as a JSON object
--mysqldumpUse mysqldump for generating the information
--net-ssh-optionProvide custom SSH options to use for SSH communication to other hosts.
--notice, -nDisplay notice, warning, and error messages
--offlinePut required replication services offline before processing
--offline-timeoutPut required replication services offline before processing
--onlinePut required replication services online after successful processing
--serviceReplication service to read information from
--sourceServer to use as a source for the backup
--validateOnly run script validation
--verbose, -vShow verbose information during processing
--xtrabackupUse xtrabackup for generating the information

The script will automatically put all replication services offline prior to beginning. If the services were online, the script will put them back online following a successful completion. All THL logs will be cleared prior to going online. The replicator will start replication from the position reflected on the source host.

Provisioning will fail from a slave that is stopped, or if the slave is not in either the ONLINE or OFFLINE:NORMAL (in [Tungsten Replicator 4.0 Manual]) states. This can be overridden by using the -f or --force options.

When provisioning masters, for example in fan-in in [Tungsten Replicator 4.0 Manual], multi-master, or when recovering a failed master in a standard master-slave topology, the service must be reset with the trepctl reset after the command is finished. The service must also be reset on all slaves.

The --service argument is used to determine which database server should be provisioned. If there are multiple services defined in the replicator and one of those is a master, the master service must be specified.

Using xtrabackup

The script will use Xtrabackup by default. It will run validation prior to starting to make sure the needed scripts are available. The provision process will run Xtrabackup on the source server and stream the contents to the server you are provisioning. Passing the --direct option will empty the MySQL data directory prior to doing the backup and place the streaming backup there. After taking the backup, the script will prepare the directory and restart the MySQL server.

Using mysqldump

If you have a small dataset or don't have Xtrabackup, you may pass the --mysqldump option to use it. It implements the Tungsten Script Interface as well as these additional options.

Compatibility

The script only works with MySQL at this time.