3.4. Replicating Data Out of an Existing Cluster

If you have an existing cluster and you want to replicate the data out to a separate standalone server using Tungsten Replicator then you can create a cluster alias, and use a master/slave topology to replicate from the cluster. This allows for THL events from the cluster to be applied to a separate server for the purposes of backup or separate analysis.

The deployment works by creating an alias into the Tungsten Clustering cluster, and then uses this as the source information for configuring a separate service from the alias into the standalone replicator.

Figure 3.4. Topologies: Master/Slave with Replicator

Topologies: Master/Slave with Replicator

In order to configure this, there are three steps:

  1. Setup a new server to hold the Tungsten Replicator service

  2. Configure an alias to the existing Tungsten Clustering service

  3. Configure a replicator that points to the alias acting as a slave

There are also the following requirements:

  • The host on which you want to replicate to must have Tungsten Replicator 2.1.2 or later

  • Hosts on both the replicator and cluster must be able to communicate with each other.

  • Replicator must be able to connect as the tungsten user to the databases within the cluster

The tpm command to create the service on the replicator is as follows:

  1. On your staging server, download the release package.

  2. Unpack the release package:

    shell> tar zxf tungsten-replicator-3.0.0-500.tar.gz
  3. Change to the unpackaged directory:

    shell> cd tungsten-replicator-3.0.0-500
  4. Execute the tpm command to configure the installation:

    shell> ./tools/tpm configure defaults \
        --install-directory=/opt/replicator \
        '--profile-script=~/.bashrc' \
        --replication-password=secret \
        --replication-port=13306 \
        --replication-user=tungsten \
        --start-and-report=true \
        --user=tungsten

    The description of each of the options is shown below; click the icon to hide this detail:

    Click the icon to show a detailed description of each argument.

  5. Now the defaults are configure, first we configure a cluster alias that points to the masters and slaves within the current Tungsten Clustering service that you are replicating from:

    shell> ./tools/tpm configure beta \
        --master=hostA \
        --slaves=hostB \
        --topology=cluster-alias

    This creates a configuration that specifies that the topology should be a cluster alias, and that the cluster configuration of the cluster from which you are replicating, the master is hostA and the slave is hostB.

  6. Now, the service that will replicate from the cluster alias into the database on hostC can be created:

    shell> ./tools/tpm configure gamma \
        --master=hostC \
        --relay-source=beta \
        --topology=cluster-slave

    This creates the configuration that will replicate into the database on the Tungsten Replicator. In this example:

    • --master=hostC

      Specifies the hostname of the database into which data will be replicated.

    • --relay-source=beta

      Specifies the name of the relay source for data that will be used to read events to be replicated.

  7. If the installation process fails, check the output of the /tmp/tungsten-configure.log file for more information about the root cause.

    Once the configuration has been completed, you can perform the installation to set up the services using this configuration:

    shell> ./tools/tpm install

The cluster should be installed and ready to use.