This procedure will explain how to reinitialize failed replication in a multi-node cluster during a maintenance window.
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.
MySQL replication is capable of repairing itself if the other database node is unavailable. Replication can repair itself after a node in the cluster experiences a graceful shutdown, MySQL server shutdown, or a network outage. Replication will fail if a data consistency error is experienced.
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:
2380 WARNING "Error accessing host/database
2381 WARNING "Replication failing for host/database
This article applies to all supported API Gateway versions.
MySQL replication can break for a multitude of reasons, which falls outside the scope of this KB article.
Important notes:
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.
The following procedure should be executed on Gateway 10.x appliances in order to reinitialize replication in a multi-node cluster:
# mysqladmin stop-slave
WARNING: stop-slave is deprecated and will be removed in a future version. Use stop-replica instead.
Replication stopped
Replication should be re-initialized at this point. The above output above indicates that the master/slave relationship is functioning.
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.
The following procedure should be executed on Gateway 9.x appliances in order to reinitialize replication in a multi-node cluster:
Replication should be re-initialized at this point. The above output above indicates that the master/slave relationship is functioning.