8.27. The tungsten_prep_upgrade Script

Version Support: 6.0.0

The 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.44. tungsten_prep_upgrade Command-line Options

OptionDescription
--alldbLoop through all services on this node (based on existing tungsten_* schemas).
--debugDebug mode is VERY chatty, avoid it unless you really need it.
--dump, -dBackup tracking databases using mysqldump (default: tungsten_{service})
--dumpdb, -DSpecify database to dump
--force, -fForce the operation.
--help, -hShow help text
--host, -HSpecify the database hostname or IP address
--keep, --get, -g, -kGet the current tracking position schema for the specified service and save it as json to a text file
--offline, -oTake the specific service to the offline-deferred state at-heartbeat (default: offline_for_upg)
--offlinehb, -OSpecify the name of the heartbeat for the offline-deferred operation
--password, -wSpecify the database password
--path, -pFull path to the cross-site replicator directory (default: /opt/replicator)
--port, -PSpecify the database listener port (default: 13306)
--restore, -rLoad the tracking database backup for the specified service.
--service, -sSpecify the service name to act upon.
--startBring up the cross-site replicator process
--stopGracefully shut down the cross-site replicator process
--targetdir, -TSpecify directory target for dump
--user, -uSpecify the database user
--verbose, -vShow 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

    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)