8.16.2. Upgrading Tungsten Replicator to use tpm

The tpm is used to set configuration information and create, install and update deployments. Using tpm provides a number of key benefits:

  • Simpler deployments, and easier configuration and configuration updates for existing installations.

  • Easier multi-host deployments.

  • Faster deployments and updates; tpm performs commands and operations in parallel to speed up installation and updates.

  • Simplified update procedure. tpm can update all the hosts within your configured service, automatically taking hosts offline, updating the software and configuration, and putting hosts back online.

  • Extensive checking and verification of the environment and configuration to prevent potential problems and issues.

To upgrade your installation to use tpm, the following requirements must be met:

  • Tungsten Replicator 2.1.0 should already be installed. The installation must have previously been upgraded to Tungsten Replicator 2.1.0 using the method in Section 8.16.1, “Upgrading Installations using update.

  • Existing installation should be a master/slave, multi-master or fan-in configuration. Star topologies may not upgrade correctly.

Once the prerequisites have been met, use the following upgrade steps:

  1. First fetch your existing configuration into the tpm system. This collects the configuration from one or more hosts within your service and creates a suitable configuration:

    To fetch the configuration:

    shell> ./tools/tpm fetch --user=tungsten --hosts=host1,host2,host3,host4 \
        --release-directory=autodetect

    Where:

    • --user is the username used by Tungsten Replicator on local and remote hosts.

    • --hosts is a comma-separated list of hosts in your configuration. Hosts should be listed explicitly. The keyword autodetect can be used, which will search existing configuration files for known hosts.

    • --release-directory (or --directory) is the directory where the current Tungsten Replicator installation is installed. Specifying autodetect searches a list of common directories for an existing installation. If the directory cannot be found using this method, it should be specified explicitly.

    The process will collect all the configuration information for the installed services on the specified or autodetected hosts, creating the file, deploy.cfg, within the current staging directory.

  2. Once the configuration information has been loaded and configured, update your existing installation to the new version and tpm based configuration by running the update process:

    If there any problems with the configuration, inconsistent configuration parameters, associated deployment issues (such as problems with MySQL configuration), or warnings about the environment, it will be reported during the update process. If the configuration discovery cannot be completed, the validation will fail. For example, the following warnings were generated upgrading an existing Tungsten Replicator installation:

    shell> ./tools/tpm update
    ...
    WARN  >> host1 >> Unable to run '/etc/init.d/mysql status' or »
        the database server is not running (DatasourceBootScriptCheck)
    .
    WARN  >> host3 >> Unable to run '/etc/init.d/mysql status' or »
        the database server is not running (DatasourceBootScriptCheck)
    WARN  >> host1 >> "sync_binlog" is set to 0 in the MySQL »
        configuration file for tungsten@host1:3306 (WITH PASSWORD) this setting »
        can lead to possible data loss in a server failure (MySQLSettingsCheck)
    
    WARN  >> host2 >> "sync_binlog" is set to 0 in the MySQL »
        configuration file for tungsten@host2:3306 (WITH PASSWORD) this »
        setting can lead to possible data loss in a server failure (MySQLSettingsCheck)
    
    WARN  >> host4 >> "sync_binlog" is set to 0 in the MySQL »
        configuration file for tungsten@host4:3306 (WITH PASSWORD) this setting »
        can lead to possible data loss in a server failure (MySQLSettingsCheck)
    WARN  >> host3 >> "sync_binlog" is set to 0 in the MySQL »
        configuration file for tungsten@host3:3306 (WITH PASSWORD) this setting »
        can lead to possible data loss in a server failure (MySQLSettingsCheck)
    WARN  >> host2 >> MyISAM tables exist within this instance - These »
        tables are not crash safe and may lead to data loss in a failover (MySQLMyISAMCheck)
    WARN  >> host4 >> MyISAM tables exist within this instance - These »
        tables are not crash safe and may lead to data loss in a failover (MySQLMyISAMCheck)
    ERROR >> host1 >> You must enable sudo  to use xtrabackup
    ERROR >> host3 >> You must enable sudo  to use xtrabackup
    WARN  >> host3 >> MyISAM tables exist within this instance - These »
        tables are not crash safe and may lead to data loss in a failover (MySQLMyISAMCheck)
    
    #####################################################################
    # Validation failed
    #####################################################################
    #####################################################################
    # Errors for host3
    #####################################################################
    ERROR >> host3 >> You must enable sudo  to use xtrabackup (XtrabackupSettingsCheck)
    Add --root-command-prefix=true to your command
    -----------------------------------------------------------------------------------------------
    #####################################################################
    # Errors for host1
    #####################################################################
    ERROR >> host1 >> You must enable sudo  to use xtrabackup (XtrabackupSettingsCheck)
    Add --root-command-prefix=true to your command
    -----------------------------------------------------------------------------------------------

    These issues should be fixed before completing the update. Use tpm configure to update settings within Tungsten Replicator if necessary before performing the update. Some options can be added to the update statement (as in the above example) to update the configuration during the upgrade process. Issues with MySQL should be corrected before performing the update.

Once the upgrade has been completed, the Tungsten Replicator service will be updated to use tpm. For more information on using tpm, see Chapter 10, The tpm Deployment Command. When upgrading Tungsten Replicator in future, use the instructions provided in Section 8.16.3, “Upgrading Tungsten Replicator using tpm.