Skip to main content
Common Reference

tpm Staging Configuration

Important

For backwards compatability, the staging deployment method is still supported however it will be deprecated in a future release and therefore it is not recommended for new deployments. Existing deployments should be converted when possible. See "Using the translatetoini.pl Script" for details on converting.

Before installing your hosts, you must provide the desired configuration. This will be done with one or more calls to tpm configure. These calls place the given parameters into a staging configuration file that will be used during installation. This is done for dataservices, composite dataservices and replication services.

Instead of a subcommand, tpm configure accepts a service name or the word defaults as a subcommand. This identifies what you are configuring.

When configuring defaults, the defaults affect all configured services, with individual services able to override or set their own parameters.

shell> tpm configure [service_name|defaults] [tpm options] [service configuration options]

In addition to the tpm Configuration Options the tpm Common Options may also be given.

The tpm command will store the staging configuration in the staging directory that you run it from. This behavior is changed if you have $CONTINUENT_PROFILES or $REPLICATOR_PROFILES defined in the environment. If present, tpm will store the staging configuration in that directory. Doing this will allow you to upgrade to a new version of the software without having to run the tpm fetch command.

If you are running Tungsten Clustering, the tpm command will only use $CONTINUENT_PROFILES.

If you are running Tungsten Replicator, the tpm command will use $REPLICATOR_PROFILES if it is available, before using $CONTINUENT_PROFILES.

Configuring default options for all services

shell> ./tools/tpm configure defaults \
--replication-user=tungsten \
--replication-password=secret \
--replication-port=13306

These options will apply to all services in the configuration file. This is useful when working with a composite dataservice or multiple independent services. These options may be overridden by calls to tpm configure service_name or tpm configure service_name --hosts.

Configuring a single service

shell> ./tools/tpm configure alpha \
--master=host1 \
--members=host1,host2,host3 \
--home-directory=/opt/continuent \
--user=tungsten

The configuration options provided following the service name will be associated with the alpha dataservice. These options will override any given with tpm configure defaults.

Relationship of `--members`, `--slaves` and `--master`

Each dataservice will use some combination of these options to define the hosts it is installed on. They define the relationship of servers for each dataservice.

  • If you specify --master and --slaves, --members will be calculated as the unique join of both values.
  • If you specify --master and --members. --slaves will be calculated as the unique difference of both values.

Configuring a single host

shell> ./tools/tpm configure alpha \
--hosts=host3 \
--backup-method=xtrabackup-incremental

This will apply the --repl-backup-method option to just the host3 server. Multiple hosts may be given as a comma-separated list. The names used in the --members,--slaves, --master, and --connectors options should be used when calling --hosts. These values will override any given in tpm configure defaults or tpm configure [servicename].

Reviewing the current configuration

You may run the tpm reverse command to review the list of configuration options. This will run in the staging directory and in your installation directory. It is a good idea to run this command prior to installation and upgrades to validate the current settings.

The following is an example taken from a host running Tungsten Clustering.

[object Object]# Installed from tungsten@host1:/home/tungsten/tungsten-clustering-8.0.4-132
# Defaults for all data services and hosts
tools/tpm configure defaults --application-password=secret --application-port=3306 --application-user=app --replication-password=secret --replication-port=13306 --replication-user=tungsten --start-and-report=true --user=tungsten
# Options for the alpha data service
tools/tpm configure alpha --connectors=host1,host2,host3 --master=host1 --members=host1,host2,host3

The output includes all of the tpm configure commands necessary to rebuild the configuration. It includes all default, dataservice and host specific configuration settings. Review this output and make changes as needed until you are satisfied.

Installation

After you have prepared the configuration file, it is time to install.

shell> ./tools/tpm install

This will install all services defined in configuration. The installation will be done as explained in "Processing Installs and Upgrades".

This will include the full set of --members, --slaves, --master, and --connectors (For Tungsten Clustering only).

Installing a set of specific services

shell> ./tools/tpm install alpha,bravo

All hosts included in the alpha and bravo services will be installed. The installation will be done as explained in "Processing Installs and Upgrades".

Installing a set of specific hosts

shell> ./tools/tpm install --hosts=host1,host2

Only host1 and host2 will be installed. The installation will be done as explained in "Processing Installs and Upgrades".

Upgrades from a Staging Directory

This process must be run from the staging directory in order to run properly. Determine where the current software was installed from.

shell> tpm query staging
tungsten@staging-host:/opt/continuent/software/tungsten-clustering-8.0.4-132

This outputs the hostname and directory where the software was installed from. Make your way to that host and the parent directory before proceeding. Unpack the new software into the /opt/continuent/software directory and make it your current directory.

shell> tar zxf tungsten-clustering-8.0.4-132.tar.gz
shell> cd tungsten-clustering-8.0.4-132
warning

Before performing and upgrade, please ensure that you have checked the prerequisites and studied the release note, as software and system requirements may have changed between versions and releases.

Before any update, the current configuration must be known. If the $CONTINUENT_PROFILES or $REPLICATOR_PROFILES environment variables were used in the original deployment, these can be set to the directory location where the configuration was stored.

Alternatively, the update can be performed by fetching the existing configuration from the deployed directory by using the tpm fetch command:

shell> ./tools/tpm fetch --reset --directory=/opt/continuent \
--hosts=host1,autodetect

This will load the configuration into the local staging directory. Review the current configuration before making any configuration changes or deploying the new software.

shell> ./tools/tpm reverse

This will output the current configuration of all services defined in the staging directory. You can then make changes using tpm configure before pushing out the upgrade. Run tpm reverse again before tpm update to confirm your changes were loaded correctly.

shell> ./tools/tpm configure service_name ...
shell> ./tools/tpm update --replace-release
Important

The use of --replace-release is not mandatory for minor configuration changes. However it is highly recommended when upgrading between versions.

Using this option will ensure that underlying metadata and property files are cleanly rebuilt, thus ensuring any new or deprecated properties between releases are correctly added/removed acordingly.

This will update the configuration file and then push the updates to all hosts. No additional arguments are needed for the tpm update command since the configuration has already been loaded.

For Clustering Users

The tpm update command may cause a brief outage while restarting the connectors. This will occur if you are upgrading to a new version You can avoid that with:

shell> ./tools/tpm update dataservice --no-connectors

The connectors must be updated separately on each server by running:

shell> tpm promote-connector

The tpm command will use connector graceful-stop 30 followed by connector start when upgrading versions. If that command fails then a regular connector stop is run. This behavior is also applied when using tools/tpm update --replace-release.

Configuration Changes from a Staging Directory

Where, and how, you make configuration changes depends on where you want the changes to be applied.

Making Configuration Changes to the Current Host

You may make changes to a specific host from the /opt/continuent/tungsten directory.

shell> ./tools/tpm update service_name --thl-log-retention=14d

This will update the local configuration with the new settings and restart the replicator. You can use the tpm help update command to see which components will be restarted.

shell> ./tools/tpm help update | grep thl-log-retention
--thl-log-retention How long do you want to keep THL files?

If you make changes in this way then you must be sure to run tpm fetch from your staging directory prior to any further changes. Skipping this step may result in you pushing an old configuration from the staging directory.

Making Configuration Changes to all hosts

This process must be run from the staging directory in order to run properly. Determine where the current software was installed from.

shell> tpm query staging
tungsten@staging-host:/opt/continuent/software/tungsten-clustering-8.0.4-132

This outputs the hostname and directory where the software was installed from. Make your way to that host and directory before proceeding.

shell> ./tools/tpm fetch --reset --directory=/opt/continuent \
--hosts=host1,autodetect

This will load the configuration into the local staging directory. Review the current configuration before making any configuration changes or deploying the new software.

shell> ./tools/tpm reverse

This will output the current configuration of all services defined in the staging directory. You can then make changes using tpm configure before pushing out the upgrade. Run tpm reverse again before tpm update to confirm your changes were loaded correctly.

shell> ./tools/tpm configure service_name ...
shell> ./tools/tpm update

This will update the configuration file and then push the updates to all hosts. No additional arguments are needed for the tpm update command since the configuration has already been loaded.

For Clustering Users

The tpm update command may cause a brief outage while restarting the connectors. This will occur if you are upgrading to a new version You can avoid that with:

shell> ./tools/tpm update dataservice --no-connectors

The connectors must be updated separately on each server by running:

shell> tpm promote-connector