Configure database replication on your Layer 7 Gateway servers by creating a Master-Master configuration.
- SSH into both Gateways.
- 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.
- Enter the following command on both Gateways:
cd ~/download; chmod +x add_slave_user.sh; chmod +x create_slave.sh
- On Gateway 1, run the following command:
./add_slave_user.sh
- For the slave hostname, enter the fully qualified system name of Gateway 2.
- For the replication user, enter the MySQL database account that is used for replication. The default name is repluser.
- For the root user password, enter 7layer.
Important! Enter known or default values for configurations that are not specified in this section.
- For the slave hostname, enter the fully qualified system name of Gateway 2.
- Set the node to primary (1).
- On Gateway 2, run the following command:
./add_slave_user.sh
Respond to the questions as follows:
- For the slave hostname, enter the fully qualified system name of Gateway 1.
- For the replication user, enter the MySQL database account that is used for replication. The default name is repluser.
- For the root user password, enter 7layer.
Important! Enter known or default values for configurations that are not specified in this section.
- For the slave hostname, enter the fully qualified system name of Gateway 1.
- Set the node to secondary (2).
- On Gateway 1, run the following command:
./create_slave.sh
Note: This script uses port 3306. If required, change the port to 3307.
- For the replication user, enter the MySQL database account that is used for replication. The default name is repluser.
- Enter the hostname of Gateway 2 for MASTER
Important! Do not clone the database.
- On Gateway 2, run the following command:
./create_slave.sh
Note: This script uses port 3306. If required, change the port to 3307.
- For the replication user, enter the MySQL database account that is used for replication. The default name is repluser.
- Enter the hostname of Gateway 1 for MASTER.
Important! Do not clone the database.
- 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.
- For Gateway 1, MASTER is Gateway 2.
- For Gateway 2, MASTER is Gateway 1.