3.1. Deploying a Master/Slave Cluster

Within a master/slave service, there is a single master which replicates data to the slaves. The Tungsten Connector handles connectivity by the application and distributes the load to the datasources in the dataservice.

Figure 3.1. Topologies: Master/Slave Cluster

Topologies: Master/Slave

3.1.1. Prepare: Master/Slave Cluster

Before continuing with deployment you will need the following:

  1. The name to use for the cluster.

  2. The list of datasources in the cluster. These are the servers which will be running MySQL.

  3. The list of servers that will run the connector.

  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 C, Prerequisites for additional details.

3.1.2. Install: Master/Slave Cluster

3.1.2.1. Installing a Master/Slave Cluster (Staging Use Case)

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

    shell> cd /opt/continuent/software
    shell> tar zxf continuent-tungsten-2.0.5-11.tar.gz
  2. Change to the Continuent Tungsten directory:

    shell> cd continuent-tungsten2.0.5-11
  3. Run tpm to perform the installation. This method assumes you are using the Section 9.3, “tpm Staging Configuration” method:

    shell> ./tools/tpm install alpha \
      --user=tungsten \
      --install-directory=/opt/continuent \
      --members=host1,host2,host3 \
      --connectors=host1,host2,host3 \
      --master=host1 \
      --replication-user=tungsten \
      --replication-password=password \
      --replication-port=13306 \
      --application-user=app_user \
      --application-password=password \
      --application-port=3306  \
      --start-and-report=true \
      --profile-script=~/.bash_profile

    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.8.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.1.2.2. Installing a Master/Slave Cluster (INI Use Case)

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

    shell> cd /opt/continuent/software
    shell> tar zxf continuent-tungsten-2.0.5-11.tar.gz
  2. Change to the Continuent Tungsten directory:

    shell> cd continuent-tungsten2.0.5-11
  3. Create /etc/tungsten/tungsten.ini with the configuration. Replace host4 with the connector system's full hostname.

    [defaults]
    user=tungsten
    install-directory=/opt/continuent
    replication-user=tungsten
    replication-password=password
    replication-port=13306
    application-user=app_user
    application-password=secret
    application-port=3306
    start-and-report=true
    profile-script=~/.bash_profile
    
    [alpha]
    topology=clustered
    members=host1,host2,host3
    connectors=host4
    master=host1

    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.

    See Section 9.4, “tpm INI File Configuration” for more information.

    Note

    Do not include start-and-report if you are taking over for MySQL native replication. See Section 3.8.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 start-and-report is set and 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.1.3. Best Practices: Master/Slave Cluster

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