The API Gateway uses MySQL with the InnoDB engine to store configuration data, audits, and published service policies. This implementation uses a single database tablespace object (the ibdata file) to store all binary data within the database. The MySQL server is configured to prevent this file from exceeding a certain size. If the file must grow to store more data but cannot grow due to the upper limit then the ibdata file will need to be shrunk and certain data within the database must be discarded. This article prescribes removing all audit data from the database as audit records tend to consume the most storage space in the Gateway database.
This procedure consists of several smaller steps (Note: For a single node cluster, only step 2 and 3 is required):
iptables -I INPUT -i eth0 -p tcp -m tcp -s SECONDARY-IP --dport 3306 -j REJECT
iptables -I INPUT -i eth0 -p tcp -m tcp -s SECONDARY-IP --dport 3307 -j REJECT
iptables -I INPUT -i eth0 -p tcp -m tcp -s PRIMARY-IP --dport 3306 -j REJECT
iptables -I INPUT -i eth0 -p tcp -m tcp -s PRIMARY-IP --dport 3307 -j REJECT
SET FOREIGN_KEY_CHECKS = 0;
truncate table audit_admin;
optimize table audit_admin;
truncate table audit_detail;
optimize table audit_detail;
truncate table audit_detail_params;
optimize table audit_detail_params;
truncate table audit_main;
optimize table audit_main;
truncate table audit_message;
optimize table audit_message;
truncate table audit_system;
optimize table audit_system;
SET FOREIGN_KEY_CHECKS = 1;
exit
iptables -D INPUT -i eth0 -p tcp -m tcp -s SECONDARY-IP --dport 3306 -j REJECT
iptables -D INPUT -i eth0 -p tcp -m tcp -s SECONDARY-IP --dport 3307 -j REJECT
iptables -D INPUT -i eth0 -p tcp -m tcp -s PRIMARY-IP --dport 3306 -j REJECT
iptables -D INPUT -i eth0 -p tcp -m tcp -s PRIMARY-IP --dport 3307 -j REJECT
Verify successful initialization of replication: mysql -e "show slave status\G" | grep ": Yes"
The console or terminal should return with the following information exactly as depicted
Slave_IO_Running: Yes
Slave_SQL_Running: Yes