Removing Datasources, Managers or Connectors
Removing components from a dataservice is quite straightforward, usually involved both modifying the running service and changing the configuration. Changing the configuration is necessary to ensure that the host is not re-configured and installed when the installation is next updated.
In this section:
- "Removing a Datasource from an Existing Deployment"
- "Removing a Composite Datasource/Cluster from an Existing Deployment"
- "Removing a Connector from an Existing Deployment"
Removing a Datasource from an Existing Deployment
To remove a datasource from an existing deployment there are two primary stages, removing it from the active service, and then removing it from the active configuration.
For example, to remove host6 from a service:
Check the current service state:
[LOGICAL] /alpha > lsCOORDINATOR[host1:AUTOMATIC:ONLINE]ROUTERS:+----------------------------------------------------------------------------+|connector@host1[11401](ONLINE, created=17, active=0) ||connector@host2[7998](ONLINE, created=0, active=0) ||connector@host3[31540](ONLINE, created=0, active=0) ||connector@host4[26829](ONLINE, created=27, active=1) |+----------------------------------------------------------------------------+DATASOURCES:+----------------------------------------------------------------------------+|host1(slave:ONLINE, progress=373, latency=0.000) ||STATUS [OK] [2014/02/12 12:48:14 PM GMT] |+----------------------------------------------------------------------------+| MANAGER(state=ONLINE) || REPLICATOR(role=slave, master=host6, state=ONLINE) || DATASERVER(state=ONLINE) || CONNECTIONS(created=30, active=0) |+----------------------------------------------------------------------------++----------------------------------------------------------------------------+|host2(slave:ONLINE, progress=373, latency=1.000) ||STATUS [OK] [2014/01/24 05:02:34 PM GMT] |+----------------------------------------------------------------------------+| MANAGER(state=ONLINE) || REPLICATOR(role=slave, master=host6, state=ONLINE) || DATASERVER(state=ONLINE) || CONNECTIONS(created=0, active=0) |+----------------------------------------------------------------------------++----------------------------------------------------------------------------+|host3(slave:ONLINE, progress=373, latency=1.000) ||STATUS [OK] [2014/02/11 03:17:08 PM GMT] |+----------------------------------------------------------------------------+| MANAGER(state=ONLINE) || REPLICATOR(role=slave, master=host6, state=ONLINE) || DATASERVER(state=ONLINE) || CONNECTIONS(created=0, active=0) |+----------------------------------------------------------------------------++----------------------------------------------------------------------------+|host6(master:ONLINE, progress=373, THL latency=0.936) ||STATUS [OK] [2014/02/12 12:39:52 PM GMT] |+----------------------------------------------------------------------------+| MANAGER(state=ONLINE) || REPLICATOR(role=master, state=ONLINE) || DATASERVER(state=ONLINE) || CONNECTIONS(created=14, active=1) |+----------------------------------------------------------------------------+Switch to MAINTENANCE policy mode:
[LOGICAL] /alpha > set policy maintenancepolicy mode is now MAINTENANCESwitch to administration mode:
[LOGICAL] /alpha > adminRemove the node from the active service using the
rmcommand. You will be warned that this is an expert command and to confirm the operation:[ADMIN] /alpha > rm host6WARNING: This is an expert-level command:Incorrect use may cause data corruptionor make the cluster unavailable.Do you want to continue? (y/n)> ySwitch back to logical mode:
[ADMIN] /alpha > logicalSwitch to AUTOMATIC policy mode:
[LOGICAL] /alpha > set policy automaticpolicy mode is now AUTOMATIC
Now the node has been removed from the active dataservice, the services must be stopped and then removed from the configuration.
Stop the running services:
shell> stopallRemove the INI configuration file:
shell> rm /etc/tungsten/tungsten.iniStop the replicator/manager from being started again.
If this is all the services on this node, replicator, manager and connector are being removed, remove the Tungsten Cluster installation entirely:
Remove the startup scripts from your server:
shell> sudo /opt/continuent/tungsten/cluster-home/bin/undeployallRemove the installation directory:
shell> rm -rf /opt/continuent
If the replicator/manager has been installed on a host but the connector is not being removed, remove the start scripts to prevent the services from being automatically started:
shell> rm /etc/init.d/tmanagershell> rm /etc/init.d/treplicator
Removing a Composite Datasource/Cluster from an Existing Deployment
There are really three different ways to remove an entire composite datasource (cluster) service from an existing composite cluster, (CAP, DAA or CAA):
-
Using command
tools/tpm update --replace-releaseSee "Removing a Composite Datasource/Cluster from an Existing Deployment Using tpm update"
-
Using command
tpm delete-serviceSee "Removing a Composite Datasource/Cluster from an Existing Deployment Using tpm delete-service"
-
Manually using individual commands for each required step
See "Removing a Composite Datasource/Cluster from an Existing Deployment Manually"
Internal Operations Reference
Below are the internal operations taken during the script processing, presented for clarity.
Do NOT perform any step below by hand.
-
For Composite Active/Passive,
tpm updateandtpm delete-serviceboth run the Manager Cleanup Steps on each node. -
For Composite Active/Active,
tpm updateandtpm delete-serviceboth run the Manager Cleanup Steps and the Replicator Cleanup Steps on each node -
Manager Cleanup Steps
- Manager Cleanup Steps performed on a node in a service not being deleted
- Delete the dataservice from the Manager layer using cctrl
- Remove the matching service line from
cluster-home/conf/dataservices.properties
- Manager Cleanup Steps performed on a node in service to be removed
- Stop all Tungsten services
- Run the
tpm uninstallcommand
- Manager Cleanup Steps performed on a node in a service not being deleted
-
Replicator Cleanup Steps
- Replicator Cleanup Steps performed on a node in a service not being deleted.
- Offline all Tungsten Replicator services
- Remove the two
tungsten/tungsten-replicator/conf/static-from{service}.propertiesfiles - Restart the Tungsten Replicator process
- Online all Tungsten Replicator services
- Delete the service-specific thl and relay subdirs
- Replicator Cleanup Steps performed on a node in service to be removed
- Offline all Tungsten Replicator services
- Remove the two
tungsten/tungsten-replicator/conf/static-from{service}.propertiesfiles
- Replicator Cleanup Steps performed on a node in a service not being deleted.
Removing a Composite Datasource/Cluster from an Existing Deployment Using tpm update
To remove an entire composite datasource (cluster) from an existing deployment using the tpm update command, you must
perform the following steps on every node in the composite cluster, including the ones to be removed
- Edit the
/etc/tungsten/tungsten.inifile on every node in the composite cluster you are keeping. - Delete the entire stanza for the cluster service you wish to remove.
- Delete the cluster name from the composite service definition.
- Save and exit the
/etc/tungsten/tungsten.inifile. - Execute the
./tools/tpm update --replace-releasecommand from the staging directory. For more information about runningtpm updateplease see "The tpm update Command".
Once the procedure is complete on all nodes, the service will no longer be visible in cctrl.
Removing a Composite Datasource/Cluster from an Existing Deployment Using tpm delete-service
To remove an entire composite datasource (cluster) from an existing deployment using the tpm delete-service command, you
must perform the following steps on every node in the composite cluster, including the ones to be removed.
- Execute the
tpm delete-service {service_name_here}command. - During the execution of the tpm command on every node in the composite cluster that you are keeping, you will be prompted to
edit the
/etc/tungsten/tungsten.inifile. This step will not be called if the node is due to be de-commissioned (i.e. the service has been deleted). - Delete the entire stanza for the cluster service you wish to remove.
- Delete the cluster name from the composite service definition.
- Save and exit the
/etc/tungsten/tungsten.inifile. - tpm will complete the service deletion based on your edits. Once this is done on all of the nodes, the service will be gone from cctrl.
Removing a Composite Datasource/Cluster from an Existing Deployment Manually
While it is possible to manually remove a service from a Composite Cluster, there are many steps involved. Continuent recommends using
either tpm update or tpm delete-service to do so.
- For
tpm update, see "The tpm update Command". - For
tpm delete-service, see "The tpm delete-service Command".
To manually remove an entire composite datasource (cluster) from an existing deployment there are two primary stages, removing the child service from the composite parent cluster inside cctrl, and then removing the Tungsten software from the nodes to be decommissioned in the cluster service being deleted.
For Composite Active/Active clusters, additional manual steps at the replicator layer will also be required.
For example, to remove cluster west from a composite dataservice:
Check the current service state:
shell> cctrl -multi[LOGICAL] / > ls+----------------------------------------------------------------------------+|DATA SERVICES: |+----------------------------------------------------------------------------+eastglobalwest[LOGICAL] / > use global[LOGICAL] /global > lsCOORDINATOR[db1:AUTOMATIC:ONLINE]DATASOURCES:+----------------------------------------------------------------------------+|east(composite master:ONLINE) ||STATUS [OK] [2017/05/16 01:25:31 PM UTC] |+----------------------------------------------------------------------------++----------------------------------------------------------------------------+|west(composite slave:ONLINE) ||STATUS [OK] [2017/05/16 01:25:30 PM UTC] |+----------------------------------------------------------------------------+Switch to MAINTENANCE policy mode:
[LOGICAL] /global > set policy maintenancepolicy mode is now MAINTENANCERemove the composite member cluster from the composite service using the
dropcommand.[LOGICAL] /global > drop composite datasource westCOMPOSITE DATA SOURCE 'west@global' WAS DROPPED[LOGICAL] /global > lsCOORDINATOR[db1:AUTOMATIC:ONLINE]DATASOURCES:+----------------------------------------------------------------------------+|east(composite master:ONLINE) ||STATUS [OK] [2017/05/16 01:25:31 PM UTC] |+----------------------------------------------------------------------------+[LOGICAL] /global > cd /[LOGICAL] / > ls+----------------------------------------------------------------------------+|DATA SERVICES: |+----------------------------------------------------------------------------+eastglobalIf the removed composite datasource still appears in the top-level listing, then you will need to clean up by hand. For example:
[LOGICAL] /global > cd /[LOGICAL] / > ls+----------------------------------------------------------------------------+|DATA SERVICES: |+----------------------------------------------------------------------------+eastglobalwestStop all managers on all nodes at the same time
shell > manager stopshell > vim $CONTINUENT_HOME/cluster-home/conf/dataservices.propertiesBefore:east=db1,db2,db3west=db4,db5,db6After:east=db1,db2,db3Start all managers one-by-one, starting with the current primary
shell> manager startOnce all managers are running, check the list again:
shell> cctrl -multi[LOGICAL] / > ls+----------------------------------------------------------------------------+|DATA SERVICES: |+----------------------------------------------------------------------------+eastglobalSwitch to AUTOMATIC policy mode:
[LOGICAL] / > set policy automaticpolicy mode is now AUTOMATIC
Now the cluster has been removed from the composite dataservice, the services on the old nodes must be stopped and then removed from the configuration.
Stop the running services on all nodes in the removed cluster:
shell> stopallNow you must remove the node from the configuration, although the exact method depends on which installation method used with
tpm:If you are using staging directory method with
tpm:Change to the staging directory. The current staging directory can be located using
tpm query-staging:shell> tpm query stagingtungsten@host1:/home/tungsten/tungsten-clustering-8.0.4-132shell> cd /home/tungsten/tungsten-clustering-8.0.4-132Update the configuration, omitting the cluster datasource name from the list of members of the dataservice:
shell> tpm update global --composite-datasources=east
If you are using the INI file method with
tpm:Remove the INI configuration file:
shell> rm /etc/tungsten/tungsten.ini
Stop the replicator/manager from being started again.
If this is all the services on this node, replicator, manager and connector are being removed, remove the Tungsten Cluster installation entirely:
Remove the startup scripts from your server:
shell> sudo /opt/continuent/tungsten/cluster-home/bin/undeployallRemove the installation directory:
shell> rm -rf /opt/continuent
If the replicator/manager has been installed on a host but the connector is not being removed, remove the start scripts to prevent the services from being automatically started:
shell> rm /etc/init.d/tmanagershell> rm /etc/init.d/treplicator
Additional Replicator Cleanup Steps for Composite Active/Active Clusters
- Replicator Cleanup Steps performed on a node in a service not being deleted.
- Offline all Tungsten Replicator services
- Remove the two
tungsten/tungsten-replicator/conf/static-from{service}.propertiesfiles - Restart the Tungsten Replicator process.
- Online all Tungsten Replicator services.
- Delete the service-specific thl and relay subdirs.
- Replicator Cleanup Steps performed on a node in service to be removed
- Offline all Tungsten Replicator services.
- Remove the two
tungsten/tungsten-replicator/conf/static-from{service}.propertiesfiles
Removing a Connector from an Existing Deployment
Removing a connector involves only stopping the connector and removing the configuration. When the connector is stopped, the manager will automatically remove it from the dataservice. Note that applications that have been configured to talk to the connector must be updated to point to another connector.
For example, to remove host4 from the current dataservice:
Login to the host running the connector.
Stop the connector service:
shell> connector stopRemove the connector from the configuration, the exact method depends on which installation method used with
tpm:If you are using staging directory method with
tpm:Change to the staging directory. The current staging directory can be located using
tpm query-staging:shell> tpm query stagingtungsten@host1:/home/tungsten/tungsten-clustering-8.0.4-132shell> cd /home/tungsten/tungsten-clustering-8.0.4-132Update the configuration, omitting the host from the list of members of the dataservice:
shell> tpm update alpha --connectors=host1,host2,host3 --members=host1,host2,host3
If you are using the INI file method with
tpm:Remove the INI configuration file:
shell> rm /etc/tungsten/tungsten.ini
Stop the connector from being started again. If the connector is restarted, it will connect to the previously configured primary and begin operating again.
If this is a standalone Connector installation, remove the Tungsten Cluster installation entirely:
Remove the startup scripts from your server:
shell> sudo /opt/continuent/tungsten/cluster-home/bin/undeployallRemove the installation directory:
shell> rm -rf /opt/continuent
If the connector has been installed on a host with replicator and/or managers, remove the start script to prevent the connector from being automatically started:
shell> rm /etc/init.d/tconnector