Professional Documents
Culture Documents
book
calendar_today
Products
CA API Gateway
Issue/Introduction
The CA API Gateway uses MySQL replication to provide database failover and
availability should one Gateway appliance or database server become unavailable or
degraded.
MySQL replication will ensure that a duplicated copy of a database object is
maintained in one or more locations. The Gateway uses a master-master
implementation in
a multi-node environment to ensure that database changes to one host are replicated
to the other database host.
The following data may be visible when running the SHOW SLAVE STATUS query against
the local MySQL database:
Slave_IO_Running: No
Slave_SQL_Running: No
The following log entries may be present in the Gateway log files:
Cause
MySQL replication can break for a multitude of reasons, which falls outside the
scope of this KB article.
Environment
Resolution
Important notes:
The processes below assume that the primary node contains the most accurate/up-to-
date database. Accommodations will be needed if up-to-date database is on
secondary node instead of the primary node.
KB 42874 - Deleting old audit events from the local Gateway database
KB 42833 - Removing audit records from the Gateway database in a multi-node cluster
without downtime
Make sure the appropriate process is chosen below for the Gateway version
appliances
If running MySQL on an API Gateway 9.x appliance, then this process applies. If you
are running on a Gateway 10.x appliance, please skip this section and
start at the Gateway 10.x process heading.
Backup the database on the PRIMARY node first as a precaution: mysqldump --all-
databases > ~/all_databases_`date '+%Y%m%d_%T'`.sql
Make sure that the last line of the newly created SQL file contains "-- Dump
completed <date-time>"
Store the file for future use in case the database needs to be restored.
Consider also taking a VM snapshot if possible to most easily restore a virtual
appliance.
Reset the slave configuration on both nodes: mysql -e "reset slave; reset slave
all"
Stop the API Gateway 'ssg' service on both nodes: service ssg stop
Enter yes to the prompt "Do you want to clone a database from $Master (yes or no)?"
Enter no to the prompt "Do you want to clone a database from $Master (yes or no)?"
Start the Gateway 'ssg' service on both nodes: service ssg start
Query the status of the replication on both nodes: mysql -e "show slave status\G"
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Seconds_Behind_Master: 0
If running MySQL on an API Gateway 10.x appliance, then this process applies. If
you are running on a Gateway 9.x appliance, please start at the Gateway 9.x
process heading above instead.
Make sure that the last line of the newly created SQL file contains "-- Dump
completed <date-time>"
Store the file for future use in case the database needs to be restored.
Reset the slave configuration on both nodes: mysql -e "reset slave; reset slave
all"
Stop the API Gateway 'ssg' service on both nodes: service ssg stop
Enter yes to the prompt "Do you want to clone a database from $Master (yes or no)?"
On the secondary node after step 6 is completed, reset the master configuration one
more time: mysql -e "reset master"
Enter no to the prompt "Do you want to clone a database from $Master (yes or no)?"
Start the Gateway 'ssg' service on both nodes: service ssg start
Query the status of the replication on both nodes: mysql -e "show slave status\G"
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Seconds_Behind_Master: 0