Skip to main content
Tungsten Clustering

Deploying a Composite Active/Passive (CAP) Cluster

Tungsten Cluster supports the creation of composite clusters. This includes multiple active/passive dataservices tied together. One of the dataservices is identified as the active, containing the primary node and all other dataservices (passive) replicate from it.

Topologies: Composite Active/Passive Cluster
Topologies: Composite Active/Passive Cluster

Prepare

Before continuing with deployment you will need the following:

  1. The cluster name for each Active/Passive Cluster and a Composite cluster name to group them.
  2. The list of datasources in each cluster. These are the servers which will be running MySQL.
  3. The list of servers that will run the connector. Each connector will be associated with a preferred cluster but will have access to the primary regardless of location.
  4. The username and password of the MySQL replication user.
  5. The username and password of the first application user. You may add more users after installation.

All servers must be prepared with the proper prerequisites. See "Installation Prerequisites" for additional details.

Install

  1. Install the Tungsten Cluster RPM package or download the tarball, and unpack it:

    shell> cd /opt/continuent/software
    shell> tar zxf tungsten-clustering-8.0.4-132.tar.gz
  2. Change to the staging directory:

    shell> cd tungsten-clustering-8.0.4-132
  3. Create the /etc/tungsten/tungsten.ini using the example below as a template. Once created to suit your needs, run the tpm to perform the installation.

    Example tungsten.ini
    [defaults]
    user=tungsten
    install-directory=/opt/continuent
    profile-script=~/.bash_profile
    replication-user=tungsten
    replication-password=secret
    replication-port=13306
    application-user=app_user
    application-password=secret
    application-port=3306
    rest-api-admin-user=apiuser
    rest-api-admin-password=secret
    connector-rest-api-address=0.0.0.0
    manager-rest-api-address=0.0.0.0
    replicator-rest-api-address=0.0.0.0

    [alpha]
    topology=clustered
    master=host1.alpha
    members=host1.alpha,host2.alpha,host3.alpha
    connectors=host1.alpha,host2.alpha,host3.alpha

    [beta]
    topology=clustered
    relay=host1.beta
    members=host1.beta,host2.beta,host3.beta
    connectors=host1.beta,host2.beta,host3.beta
    relay-source=alpha

    [gamma]
    composite-datasources=alpha,beta
    Show argument definitions
    user=tungstenOS System User, for example tungsten. DO NOT use root.
    profile-script=~/.bash_profileAppend commands to include env.sh in this profile script.
    replication-user=tungstenUser for database connection.
    application-user=app_userDatabase username for the connector.
    application-password=secretDatabase password for the connector.
    application-port=3306Port for the connector to listen on.
    rest-api-admin-user=apiuserSpecify the initial Admin Username for API access.Available from v7.0.0
    rest-api-admin-password=secretSpecify the initial Admin User Password for API access. rest-api-admin-password alias only available from version 7.1.2 onwards.Available from v7.0.0
    connector-rest-api-address=0.0.0.0Address for the API to bind too.Available from v7.0.0
    manager-rest-api-address=0.0.0.0Address for the API to bind too.Available from v7.0.0
    replicator-rest-api-address=0.0.0.0Address for the API to bind too.Available from v7.0.0
    From v7.0.0

    If you plan to make full use of the REST API (which is enabled by default) you will need to also configure a username and password for API Access. This must be done by specifying the following options in your configuration:

    rest-api-admin-user=tungsten
    rest-api-admin-pass=secret

    From v7.2.0 the alias rest-api-admin-password can also be used.

    Run tpm to validate the installation. Providing no errors are returned, you can then continue to install the software.

    shell> ./tools/tpm validate
    shell> ./tools/tpm install

    During the startup and installation, tpm will notify you of any problems that need to be fixed before the service can be correctly installed and started. If the service starts correctly, you should see the configuration and current status of the service.

  4. Initialize your PATH and environment.

    shell > source /opt/continuent/share/env.sh

The Composite Active/Passive Cluster should be installed and ready to use.

Adding a remote Composite Cluster

Adding an entire new cluster provides significant level of availability and capacity. The new cluster nodes that form the cluster will be fully aware of the original cluster(s) and communicate with existing managers and datasources within the cluster.

The following steps guide you through updating the configuration to include the new hosts and services you are adding.

  1. On the new host(s), ensure the "Installation Prerequisites" have been followed.

  2. Let's assume that we have a composite cluster dataservice called global with two clusters, east and west, with three nodes each.

    In this worked exmple, we show how to add an additional cluster service called north with three new nodes.

  3. Set the cluster to MAINTENANCE mode using cctrl:

    shell> cctrl
    [LOGICAL] / > use global
    [LOGICAL] /global > set policy maintenance
  4. Using the following as an example, update the /etc/tungsten/tungsten.ini on the existing nodes to include the new cluster and update the additional composite service block. Then, copy the ini file to all the new nodes in the new cluster.

    Example tungsten.ini
    [north]
    connectorsdb7,db8,db9
    relay-source=east
    relay=db7
    members=db7,db8,db9
    topology=clustered

    [global]
    composite-datasources=east,west,north
    Show argument definitions
    relay-source=eastDataservice name to use as a relay source.
    relay=db7Hostname of the primary (or relay) host within this service.
    members=db7,db8,db9Hostnames for the dataservice members.
    topology=clusteredReplication topology for the dataservice.
  5. Using the --no-connectors option updates the current deployment without restarting the existing connectors.

  6. On all nodes in the new cluster, download and unpack the software, and install

    shell> cd /opt/continunent/software
    shell> tar zxvf tungsten-clustering-8.0.4-132.tar.gz
    shell> cd /opt/continuent/software/tungsten-clustering-8.0.4-132
    shell> tools/tpm install
  7. On every node in the original clusters, make sure all replicators are online:

    shell> trepctl online; trepctl services
  8. On all nodes in the new cluster start the software

    shell> startall
  9. The next steps will involve provisioning the new cluster nodes. An alternative approach to using this method would be to take a backup of a replica from the existing cluster, and manually restoring it to ALL nodes in the new cluster PRIOR to issuing the install step above. If you take this approach then you can skip the next two re-provision steps.

  10. Go to the relay (primary) node of the new cluster (i.e. db7) and provision it from any replica in the original cluster (i.e. db2):

    shell> tprovision -s db2 -m xtrabackup
  11. Go to a replica node of the new cluster (i.e. db8) and provision it from the relay node of the new cluster (i.e. db7):

    shell> tprovision -s db7 -m xtrabackup
  12. Repeat the process for the remaining replica nodes in the new cluster.

    Note

    For a full explanation of using tprovision see "The tprovision Command"

  13. Set the composite cluster to AUTOMATIC mode using cctrl:

    shell> cctrl
    [LOGICAL] / > use global
    [LOGICAL] /global > set policy automatic
  14. If you used the --no-connectors option, then during a period when it is safe to restart the connectors, issue the following against each connector:

    shell> tpm promote-connector