CA API Gateway: Replication is not working on port 3307

Document ID : KB000095173
Last Modified Date : 17/05/2018
Show Technical Document Details
Question:
The MySQL replication between the gateway nodes doesn't work. The setup script /opt/SecureSpan/Appliance/bin/create_slave.sh sets the replication port to 3307, but communication on these ports is not possible. Communication on the standard mysql port 3306 is possible.

Checking on the replication status of the 2 nodes will show the following:

$ mysql -e "SHOW SLAVE STATUS\G"
...
Slave_IO_State: Connecting to master
...
Master_Port: 3307
...
Last_IO_Errno: 2003
Last_IO_Error: error connecting to master 'repluser@<hostname>:3307' - retry-time: 10 retries: 86400 
...
 
Answer:
Root cause for this is a change in the firewall rules. The file /etc/sysconfig/iptables should contain:
# Redirect used for startup of replication 
[0:0] -A PREROUTING -i eth0 -p tcp -m tcp --dport 3307 -j REDIRECT --to-ports 3306 

If it is not possible/wanted to have this the scripts create_slave.sh and restart_replication.sh in the folder /opt/SecureSpan/Appliance/bin/ can be changed to use 3306 instead of 3307
Find the line
    MASTER_PORT=3307,
in the files mentioned above and change them to
    MASTER_PORT=3306,

Than follow the steps as outlined in