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


Configure Gateway 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 service had not been 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 one, run the following command:
    ./add_slave_user.sh
    
  5. For the root user password, enter 7layer.

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

  6. For the slave hostname, enter the fully qualified machine name of Gateway two.
  7. Set the node to primary (1).
  8. On Gateway two, run the following command:
    ./add_slave_user.sh
    
  9. For the root user password, enter 7layer.

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

  10. For the slave hostname, enter the fully qualified machine name of Gateway one.
  11. Set the node to secondary (2).
  12. On Gateway one, run the following command:
    ./create_slave.sh
    

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

  13. Enter the hostname of Gateway two.
  14. Enter the hostname of Gateway one for MASTER.

    Important! Do not clone the database.

  15. On Gateway two, run the following command:
    ./create_slave.sh
    

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

  16. Enter the hostname of Gateway one.
  17. Enter the hostname of the second gateway for MASTER.

    Important! Do not clone the database.

  18. 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.