Skip to main content
Common Reference

The tungsten_prep_upgrade Command

The tungsten_prep_upgrade command is a utility script which assists in the migration process from earlier Multi-Site/Active-Active topologies to Composite Active/Active topologies.

For a full end-to-end example of using this script, see "Upgrade/Convert from Multi-Site Active/Active (MSAA) to Composite Active/Active (CAA)"

Usage
tungsten_prep_upgrade [arguments]

Where:

OptionDescriptionProduct
--alldbLoop through all services on this node (based on existing tungsten_* schemas). Cannot be used with the --service option.CTTR
--debug
Aliases: -d
Debug mode is VERY chatty, avoid it unless you really need it.CTTR
--dump
Aliases: -d
Backup tracking databases using mysqldump.CTTR
--dumpdb
Aliases: -D
Specify database to dump.CTTR
--force
Aliases: -f
Force the operation.CTTR
--help
Aliases: -h
Show help text.CTTR
--host
Aliases: -H
Specify the database hostname or IP address.
Default: 127.0.0.1
CTTR
--keep
Aliases: --get-k-g
Get the current tracking position schema for the specified service and save it as json to a text file. The file will be named ~/position-[service]-YYYYMMDDHHMMSS.txtCTTR
--offline
Aliases: -o
Take the specific service to the offline-deferred state at-heartbeat.CTTR
--offlinehb
Aliases: -O
Specify the name of the heartbeat for the offline-deferred operation.
Default: offline_for_upg
CTTR
--password
Aliases: -w
Specify the database password.CTTR
--path
Aliases: -p
Full path to the cross-site replicator directory.
Default: /opt/replicator
CTTR
--port
Aliases: -p
Specify the database listener port.
Default: 13306
CTTR
--restore
Aliases: -r
Load the tracking database backup for the specified service. --all cannot be used with --restore.CTTR
--service
Aliases: -s
Specify the service name to act upon.CTTR
--startBring up the cross-site replicator process.CTTR
--stopGracefully shut down the cross-site replicator process.CTTR
--targetdir
Aliases: -T
Specify directory target for dump.CTTR
--user
Aliases: -u
Specify the database user.CTTR
--verbose
Aliases: -v
Show verbose output.CTTR

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
    note

    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
    note

    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)