9.42. The tungsten_provision_slave Script

Version Support: 6.1.4

This version of tungsten_provision_slave was released in 6.1.4 and the usage instructions on this page are specific to that release.

For instructions for releases older than this, please refer to the documentation here

The tungsten_provision_slave script allows you to easily provision, or reprovision, a database server using information from a remote host.

tungsten_provision_slave [ -c  ] [ --help, -h ] [ --method, -m  ] [ --port, -p  ] [ --source, -s ] [ --threads, -t  ]

Where:

Table 9.67. tungsten_provision_slave Command-line Options

OptionDescription
-cUse to flag to the script that the node being provisioned needs to be a Primary. Valid for Composite Active/Active only. Forces the provision of a failed Primary and will reset services.
--help, -hShow help text
--method, -mBackup method to use. Valid methods are mysqldump or xtrabackup.
--port, -pPort to use to connect to MySQL when using mysqldump, or ssh port when using xtrabackup.
--source, -sServer to use as a source for the backup
--threads, -tNumber of parallel threads to use for xtrabackup. Increasing this number on large databases may improve backup speeds. If not supplied, default will be based on the default for the revision of xtrabackup in use.

Important

It is recommend to run this script in a utility such as screen in case the terminal gets disconnected.

For both mysqldump and xtrabackup methods, the script will perform a streaming backup from the source node to the target node.

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 Replica that is stopped, or if the Replica is not in the ONLINE state.

Using xtrabackup

The script 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. After taking the backup, the script will prepare the directory and restart the MySQL server

Using mysqldump

The script will run mysqldump by default.

Compatibility

The script only works with MySQL at this time.

Logging

The script will log output to the /opt/continuent/service_logs directory.

Example

To reprovision the Replica db3 from another Replica, db2. Using xtrabackup

db3-shell> tungsten_provision_slave --source db2 --method xtrabackup

To reprovision the Replica db3 from another Replica, db2. Using the default, mysqldump

db3-shell> tungsten_provision_slave --source db2

To reprovision the Primary db1 from the Primary, db4, in the remote cluster. Using Xtrabackup. This is only applicable to Composite Active/Active topologies

db1-shell> tungsten_provision_slave --source db4 -c --method xtrabackup