Previous Topic: Deploy the Second Layer 7 GatewayNext Topic: Create an Internal Database


Configure Database Replication

Configure database replication on your Layer 7 Gateway servers by creating a Master-Master configuration.

Follow these steps:

  1. SSH into both Gateways.
  2. Stop the Gateway process on both servers by entering the following command:
    service ssg stop
    

    Note: You may see the following message:

    Shutting down Gateway Services: [FAILED]

    This simply means that the Gateway services were not started. Continue with database replication.

  3. Enter the following command on both Gateways:
    cd ~/download; chmod +x add_slave_user.sh; chmod +x create_slave.sh
    
  4. On Gateway 1, run the following command:
    ./add_slave_user.sh
    
    1. For the slave hostname, enter the fully qualified system name of Gateway 2.
    2. For the replication user, enter the MySQL database account that is used for replication. The default name is repluser.
    3. For the root user password, enter 7layer.

      Important! Enter known or default values for configurations that are not specified in this section.

    4. For the slave hostname, enter the fully qualified system name of Gateway 2.
    5. Set the node to primary (1).
  5. On Gateway 2, run the following command:
    ./add_slave_user.sh
    

    Respond to the questions as follows:

    1. For the slave hostname, enter the fully qualified system name of Gateway 1.
    2. For the replication user, enter the MySQL database account that is used for replication. The default name is repluser.
    3. For the root user password, enter 7layer.

      Important! Enter known or default values for configurations that are not specified in this section.

    4. For the slave hostname, enter the fully qualified system name of Gateway 1.
    5. Set the node to secondary (2).
  6. On Gateway 1, run the following command:
    ./create_slave.sh
    

    Note: This script uses port 3306. If required, change the port to 3307.

    1. For the replication user, enter the MySQL database account that is used for replication. The default name is repluser.
    2. Enter the hostname of Gateway 2 for MASTER

      Important! Do not clone the database.

  7. On Gateway 2, run the following command:
    ./create_slave.sh
    

    Note: This script uses port 3306. If required, change the port to 3307.

    1. For the replication user, enter the MySQL database account that is used for replication. The default name is repluser.
    2. Enter the hostname of Gateway 1 for MASTER.

      Important! Do not clone the database.

  8. Verify replication with the following command:
    mysql -p -e "show slave status\G"
    

    Note: -p is required to prompt for root password.

    Enter 7layer for the password.