3.2. Deploying a Master/Slave Topology

Master/slave is the simplest and most straightforward of all replication scenarios, and also the basis of all other types of topology. The fundamental basis for the master/slave topology is that changes in the master are distributed and applied to the each of the configured slaves.

Figure 3.1. Topologies: Master/Slave

Topologies: Master/Slave

This deployment style can be used against the following sources

  • MySQL Community Edition

  • MySQL Enterprise Edition

  • Percona MySQL

  • MariaDB

  • Google Cloud MySQL

This deployment assumes full access to the host, including access to Binary Logs, therefore this deployment style is not suitable for RDS or Aurora extraction. For these sources, see Section 3.3, “Deploying an Extractor for Amazon RDS/Amazon Aurora”

tpm includes a specific topology structure for the basic master/slave configuration, using the list of hosts and the master host definition to define the master/slave relationship. Before starting the installation, the prerequisites must have been completed (see Appendix C, Prerequisites). To create a master/slave using tpm:

There are two types of installation, either via a Staging Install, or via an ini file install.

To understand the differences between these two installation methods, see Section 9.1, “Comparing Staging and INI tpm Methods”

Regardless of which installation method you choose, the steps are the same, and are outlined below, using the appropriate example confguration based on your deployment style

  • Install the Tungsten Replicator package (see Section 2.1.2, “Using the RPM and DEB package files”), or download the compressed tarball and unpack it, either on the source host, or on the staging host:

    shell> cd /opt/continuent/software
    shell> tar zxf tungsten-replicator-5.0.0-0.tar.gz
  • Change to the Tungsten Replicator staging directory:

    shell> cd tungsten-replicator-5.0.0-0
  • Onboard Installation

    Configure the replicator for extraction from a locally installed and configured MySQL Installation (In this example, the service name is alpha)

    Click the link below to switch examples between Staging and INI methods

    Show Staging

    Show INI

    shell> ./tools/tpm configure defaults \
        --reset \
        --install-directory=/opt/continuent \
        --user=tungsten \
        --profile-script=~/.bash_profile \
        --mysql-allow-intensive-checks=true \
        --disable-security-controls=true
    
    
    shell> ./tools/tpm configure alpha \
        --master=offboardhost \
        --members=offboardhost \
        --enable-heterogeneous-service=true \
        --replication-port=3306 \
        --replication-user=tungsten_alpha \
        --replication-password=secret \
        --datasource-mysql-conf=/etc/my.cnf
    
    [defaults]
    install-directory=/opt/continuent
    user=tungsten
    profile-script=~/.bash_profile
    mysql-allow-intensive-checks=true
    disable-security-controls=true
    
    
    [alpha]
    master=offboardhost
    members=offboardhost
    enable-heterogeneous-service=true
    replication-port=3306
    replication-user=tungsten_alpha
    replication-password=secret
    datasource-mysql-conf=/etc/my.cnf
    

    Configuration group defaults

    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.

    Configuration group alpha

    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.

    In the above example, --datasource-mysql-conf, is optional and can be used if the MySQL configuration file cannot be located by tpm, or is in a non-default location

  • Offboard Installation

    Configure the replicator for extraction from a remotely installed and configured MySQL Installation (In this example, the service name is alpha)

    Click the link below to switch examples between Staging and INI methods

    Show Staging

    Show INI

    shell> ./tools/tpm configure defaults \
        --reset \
        --install-directory=/opt/continuent \
        --user=tungsten \
        --profile-script=~/.bash_profile \
        --mysql-allow-intensive-checks=true \
        --skip-validation-check=MySQLAvailableCheck \
        --skip-validation-check=MySQLConfFile \
        --skip-validation-check=RowBasedBinaryLoggingCheck \
        --disable-security-controls=true
    
    
    shell> ./tools/tpm configure alpha \
        --master=offboardhost \
        --members=offboardhost \
        --enable-heterogeneous-service=true \
        --privileged-master=true \
        --replication-host=dbhost \
        --replication-port=3306 \
        --replication-user=tungsten_alpha \
        --replication-password=secret
    
    [defaults]
    install-directory=/opt/continuent
    user=tungsten
    profile-script=~/.bash_profile
    mysql-allow-intensive-checks=true
    skip-validation-check=MySQLAvailableCheck
    skip-validation-check=MySQLConfFile
    skip-validation-check=RowBasedBinaryLoggingCheck
    disable-security-controls=true
    
    
    [alpha]
    master=offboardhost
    members=offboardhost
    enable-heterogeneous-service=true
    privileged-master=true
    replication-host=dbhost
    replication-port=3306
    replication-user=tungsten_alpha
    replication-password=secret
    

    Configuration group defaults

    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.

    Configuration group alpha

    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.

  • Once the prerequisites and configuring of the installation has been completed, the software can be installed:

    shell> ./tools/tpm install

In both of the above examples, enable-heterogenous-service, is only required if the target applier is NOT a MySQL database

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

Once the installation has been completed, you can now proceed to configure the slave service following the relevant step within Chapter 5, Deploying Appliers.

Following installation of the applier, the services can be started. For information on starting and stopping Tungsten Replicator see Section 2.5, “Starting and Stopping Tungsten Replicator”; configuring init scripts to startup and shutdown when the system boots and shuts down, see Section 2.6, “Configuring Startup on Boot”.

For information on checking the running service, see Section 3.2.1, “Monitoring the MySQL Extractor”.