5.10.5. Rebuilding a Lost Datasource

If a datasource has been lost within the dataservice, for example, a complete hardware failure or disk crash, the datasource can be added back to the cluster once the operating system and other configuration have been completed. Essentially, the process is the same as when initially setting up your node, with the node being re-confirmed as part of the running service, installing and configuring only the returning node to the cluster.

In the following steps, the host host3 is being recovered into the cluster:

  1. Setup the host with the pre-requisites, as described in Appendix B, Prerequisites .

  2. Restore a snapshot of the data taken from another slave into the dataserver. If you have existing backups of this slave or another, they should be used. If not, take a snapshot of an existing slave and use this to apply the data to the slave. This will need to be performed outside of the Tungsten Clustering service using the native restore method for the backup method you have chosen. The backup must include the entire schema of your database, including the tungsten schemas for your services.

  3. The next steps depend on the availability of the hostname. If the hostname of the datasource that was lost can be reused, then the host can be reconfigured within the existing service. If the hostname is not available, the service must be reconfigured to remove the old host, and add the new host.

    Reusing an Existing Hostname

    1. Login in to the server used for staging your Tungsten Clustering installation, and change to the staging directory. To determine the staging directory, use:

      shell> tpm query staging
    2. Repeat the installation of the service on the host being brought back:

      shell> ./tools/tpm update svc_name --hosts=host3

      The update process will re-install Tungsten Clustering on the host specified without reacting to the existence of the tungsten schema in the database.

    Removing and Adding a new Host

    1. Remove the existing (lost) datasource from the cluster using cctrl . First switch to administrative mode:

      [LOGICAL] /alpha > admin

      Remove the host from the dataservice:

      [ADMIN] /alpha > rm host3
      
      WARNING: This is an expert-level command:
      Incorrect use may cause data corruption
      or make the cluster unavailable.
      
      Do you want to continue? (y/n)>
    2. Login in to the server used for staging your Tungsten Clustering installation, and change to the staging directory. To determine the staging directory, use:

      shell> tpm query staging
    3. Update the dataservice configuration with the new datasource, the example below uses host4 as the replacement datasource. The --dataservice-master-host should be used to specify the current master in the cluster:

      shell> ./tools/tpm configure svc_name --dataservice-hosts=host1,host2,host4 \
        --dataservice-connectors=host1,host2,host4 \
        --dataservice-master-host=host4
    4. Update the installation across all the hosts:

      shell> ./tools/tpm update svc_name
  4. Use cctrl to check and confirm the operation of the restore datasource.

The restored host should be part of the cluster and accepting events from the master as configured.