3.3. Deploying a Composite (SOR) Cluster

Tungsten Clustering supports the creation of composite, or Statement of Record (SOR). This includes multiple master/slave dataservices tied together. One of the dataservices is identified as the master and all other dataservices replicate from it.

Figure 3.3. Topologies: Composite (SOR) Cluster

Topologies: Composite (SOR) Cluster

3.3.1. Prepare: Composite (SOR) Cluster

Before continuing with deployment you will need the following:

  1. The cluster name for each Master/Slave 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 master 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 Section 2.6, “Prepare Hosts” and Appendix B, Prerequisites for additional details.

3.3.2. Install: Composite (SOR) Cluster

3.3.2.1. Installing a Composite Configuration (Staging Use Case)

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

    shell> cd /opt/continuent/software
    shell> tar zxf tungsten-clustering-5.2.2-275.tar.gz
  2. Change to the Tungsten Clustering directory:

    shell> cd tungsten-clustering5.2.2-275
  3. Run tpm to perform the installation. This method assumes you are using the Section 9.3, “tpm Staging Configuration” method:

    shell> ./tools/tpm configure defaults \
    --user=tungsten \
    --install-directory=/opt/continuent \
    --replication-user=tungsten \
    --replication-password=secret \
    --replication-port=13306 \
    --application-user=app_user \
    --application-password=password \
    --application-port=3306 \
    --profile-script="~/.bashrc" \
    --start-and-report
    
    shell> ./tools/tpm configure alpha \
    --topology=clustered \
    --members=host1.alpha,host2.alpha,host3.alpha \
    --connectors=host1.alpha,host2.alpha,host3.alpha \
    --master=host1.alpha
    
    shell> ./tools/tpm configure beta \
    --topology=clustered \
    --members=host1.beta,host2.beta,host3.beta \
    --connectors=host1.beta,host2.beta,host3.beta \
    --relay=host1.beta \
    --relay-source=alpha
    
    shell> ./tools/tpm configure gamma \
    --composite-datasources=alpha,beta

    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.

    Note

    Do not include --start-and-report if you are taking over for MySQL native replication. See Section 3.9.1, “Migrating from MySQL Native Replication 'In-Place'” for next steps after completing installation.

  4. Run tpm to install the software with the configuration.

    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.

  5. Initialize your PATH and environment.

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

3.3.2.2. Installing a Composite Configuration (INI Use Case)

  1. Install the Tungsten Clustering™ package (.rpm), or download the compressed tarball and unpack it:

    shell> cd /opt/continuent/software
    shell> tar zxf tungsten-clustering-5.2.2-275.tar.gz
  2. Change to the Tungsten Clustering directory:

    shell> cd tungsten-clustering5.2.2-275
  3. Create /etc/tungsten/tungsten.ini with the appropriate configuration:

    [defaults]
    user=tungsten
    install-directory=/opt/continuent 
    replication-user=tungsten 
    replication-password=secret 
    replication-port=13306 
    application-user=app_user 
    application-password=password 
    application-port=3306 
    profile-script="~/.bashrc" 
    start-and-report
    
    [alpha]
    topology=clustered 
    members=host1.alpha,host2.alpha,host3.alpha 
    connectors=host1.alpha,host2.alpha,host3.alpha 
    master=host1.alpha
    
    [beta]
    topology=clustered 
    members=host1.beta,host2.beta,host3.beta 
    connectors=host1.beta,host2.beta,host3.beta 
    relay=host1.beta 
    relay-source=alpha
    
    [gamma]
    composite-datasources=alpha,beta

    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.

    Note

    Do not include start-and-report if you are taking over for MySQL native replication. See Section 3.9.1, “Migrating from MySQL Native Replication 'In-Place'” for next steps after completing installation.

  4. Run tpm to install the software with the INI-based configuration:

    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.

  5. Initialize your PATH and environment.

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

The Composite cluster should be installed and ready to use.

3.3.3. Best Practices: Composite (SOR) Cluster

Follow the guidelines in Section 2.5, “Best Practices”.