Version Support: 6.0.0The script was added in version 6.0.0
The tungsten_prep_upgrade command is a utility script which assists in the upgrade process from earlier v5 Composite Active/Active topologies to the newer Composite Composite Active/Active topology available from v6 onwards.
tungsten_prep_upgrade [--all|--service] {service} [--path {fullpath_to_replicator_dir}] [arguments]
Where:
Table 8.53. tungsten_prep_upgrade Command-line Options
Option | Description |
---|---|
--alldb | Loop through all services on this node (based on existing tungsten_* schemas). |
--debug | Debug mode is VERY chatty, avoid it unless you really need it. |
--dump , -d | Backup tracking databases using mysqldump (default: tungsten_{service}) |
--dumpdb , -D | Specify database to dump |
--force , -f | Force the operation. |
--help , -h | Show help text |
--host , -H | Specify the database hostname or IP address |
--keep , --get , -g , -k | Get the current tracking position schema for the specified service and save it as json to a text file |
--offline , -o | Take the specific service to the offline-deferred state at-heartbeat (default: offline_for_upg) |
--offlinehb , -O | Specify the name of the heartbeat for the offline-deferred operation |
--password , -w | Specify the database password |
--path , -p | Full path to the cross-site replicator directory (default: /opt/replicator) |
--port , -P | Specify the database listener port (default: 13306) |
--restore , -r | Load the tracking database backup for the specified service. |
--service , -s | Specify the service name to act upon. |
--start | Bring up the cross-site replicator process |
--stop | Gracefully shut down the cross-site replicator process |
--targetdir , -T | Specify directory target for dump |
--user , -u | Specify the database user |
--verbose , -v | Show verbose output |
If --{service|all} is not specified, tungsten_prep_upgrade will attempt to derive a list of one or more service names from trepctl services.
For operations that require MySQL access, tungsten_prep_upgrade will attempt to auto-locate the database user and password from tpm reverse.
Below are various examples:
Take all replicator services offline automatically, or take a specific service offline:
shell>tungsten_prep_upgrade -o
~or~ shell>tungsten_prep_upgrade --service london --offline
shell>tungsten_prep_upgrade --service tokyo --offline
To invoke the actual deferred offline set with
--offline
, use the below CLUSTER-specific
trepctl command (i.e. from
/opt/continuent
, not
/opt/replicator
) on the Primary hosts within each
cluster:
shell> trepctl heartbeat -name offline_for_upg
Get (keep) the current tracking position schema for the specified service and save it as json to a text file (default: ~/position-{service}-YYYYMMDDHHMMSS.txt)
shell>tungsten_prep_upgrade -g
~or~ shell>tungsten_prep_upgrade --service nyc --get
(NOTE: saves to ~/position-nyc-YYYYMMDDHHMMSS.txt) shell>tungsten_prep_upgrade --service tokyo --get
(NOTE: saves to ~/position-tokyo-YYYYMMDDHHMMSS.txt)
Gracefully shut down the cross-site replicator process:
shell> tungsten_prep_upgrade --stop
Backup (dump) tracking databases using mysqldump (default: tungsten_{service})
shell>tungsten_prep_upgrade -d --alldb
~or~ shell>tungsten_prep_upgrade --service london --dump
shell>tungsten_prep_upgrade --service tokyo --dump
Load (restore) the tracking database backup for the specified service. --all is unavailable with --restore.
shell>tungsten_prep_upgrade -s nyc -u tungsten -w secret -r
shell>tungsten_prep_upgrade -s tokyo -u tungsten -w secret -r
~or~ shell>tungsten_prep_upgrade --service nyc --user tungsten --password secret --restore
shell>tungsten_prep_upgrade --service tokyo --user tungsten --password secret --restore
A restore may take place after the cross-site replicator is uninstalled, and so certain information is required on the command line (i.e. service, user and password)