10.5.7. tpm delete-service Command

Version Support: 6.1.13

This command was introduced in version 6.1.13.

The tpm delete-service command allows you to cleanly remove a dataservice from your cluster, or a single replication service from a standalone replicator installation.

The tpm delete-service command will know if it is being run from the Clustering software of the Replicator software, and will act accordingly

See the table below for a list of valid arguments:

Table 10.17. tpm delete-service Common Options

OptionDescription
--apiUse the v2 API REST interface instead of the command line when possible
--auto, -AAutomatically execute any needed commands that it is possible to handle.
--debug, -dDebug Mode.
--i-have-run-tpm-updateFor Staging-method installations, pass this flag to confirm that the `tools/tpm update` command has already been run from the staging directory
--help, -h
--i-am-sureBypass the 'Are You Sure?' prompt when using --auto.
--info, -i
-n {file}, --newini {file}Pass the fullpath (and filename) to an INI file to be used at the 'Edit INI' step
-fPass the force flag to tpm.
-p {path}, --path {path}Pass full path to replicator executables e.g. /opt/replicator/tungsten/tungsten-replicator/bin
--quiet, -q
--test, -t
--thl {file}Path and name of thl executable (Ignores --path if also supplied)
--trepctl {file}Path and name of trepctl executable (Ignores --path if also supplied)
-vVerbose output.

A number of options determine the behavior of this command and these are outlined below.

Usage for tpm delete-service

shell> tpm delete-service [args] {service_name} [configuration_service_name]

{service_name} is the Replicator service name as seen in trepctl services and/or the Manager composite datasource name as seen via cctrl.

[configuration_service_name] is the Replicator service name as seen in tpm reverse, and only needed for standalone Replicator installations where the service name in the configuration is not the same as the actual replication service name, i.e. in cluster-extractor topologies where there is a cluster-alias employed.

The default behavior is to display the needed commands for the admin to execute manually.

To use this tool in a fully automated manner:

  • specify --auto

  • include --i-am-sure to bypass most interactive prompts

  • include --newini {filename} otherwise you will be prompted to edit the INI file in the vi editor before proceeding

Use-cases

  • Tungsten Replicator: i.e. for Standalone, Cluster-Extractor, Fan-In and Multi-Site/Active-Active topologies where there is a discrete Replicator running outside of a Cluster (needs Replicator workflow)

  • Composite Active/Passive Clusters: remove a composite member cluster (needs Manager workflow)

  • Composite Active/Active Clusters: remove a composite member cluster (needs Manager + Replicator workflow)

Workflows

  1. Replicator Service

    shell> trepctl -all-services offline
    shell> rm tungsten-replicator/conf/static-SERVICE.properties
    shell> rm tungsten-replicator/conf/.static-SERVICE.properties.orig
    shell> replicator restart
    shell> trepctl -all-services online
    
    # Remove the various directories after the restart so that the replicator no longer has the dirs open :
    shell> rm -rf thl/SERVICE/
    shell> rm -rf relay/SERVICE/
    shell> trepctl -all-services online

  2. Manager Service:

    shell> cctrl
    cctrl> set policy maintenance
    cctrl> use composite_parent
    cctrl> drop composite datasource SERVICE

    Remove SERVICE line(s) from cluster-home/conf/dataservices.properties

    • CAA & CAP: Remove lines matching /^SERVICE=/

    • CAA only: Remove lines matching /^.+?_from_SERVICE=/

    • If CAA, also follow Replicator Service workflow for *_from_SERVICE

    Finish by running an update and returning cluster to automatic

    shell> tpm update
    or
    shell> manager restart
    shell> cctrl
    cctrl> set policy automatic