MySQL Master-Master Replication Error: “Error Connecting to Master” Error 2003
I’m migrating a MySQL 5.7.42 database from an existing external (to AWS) CentOS 7 server to a new private subnet Ubuntu 22 AWS EC2. Due to the nature of the surrounding architecture, I require a temporary master-master sync.
The databases are identical (as one is a restored Percona XtraBackup of the other), bar their server id and id offset. The only noticeable difference is their base OS.
Both servers communicate over a single outbound reverse port-mapped SSH connection from the EC2 through a Bastion. The SSH config maps outbound connections hitting port 3307 over the tunnel from either server to the recipient’s port 3306.
Replication with CentOS as primary and Ubuntu as secondary works.
Problem:
BUT Replication with Ubuntu as primary and CentOS as secondary fails, resulting in this CentOS SHOW SLAVE STATUS\G
output:
Slave_IO_Running: Connecting
Slave_SQL_Running: Yes
error connecting to master 'replicatorEC2@127.0.0.1:3307' - retry-time: 60 retries: 1
There is no denied connection log on the Ubuntu machine, and the error log on CentOS is as follows:
[ERROR] Slave I/O for channel '': error connecting to master 'replicatorEC2@127.0.0.1:3307' - retry-time: 60 retries: 1, Error_code: 2003