0
votes

I used keepalived+proxy+mysql.
Master:192.168.10.1
Slave:192.168.10.2
Master-VIP:192.168.10.100
When I use CHANGE MASTER TO MASTER_HOST='192.168.10.1'..., replication is OK, when I use CHANGE MASTER TO MASTER_HOST='192.168.10.100'..., Slave I/O can't connect to master, and I got error like this:

150522 15:21:50 [ERROR] Slave I/O: error connecting to master '[email protected]:3307' - retry-time: 60 retries: 86400, Error_code: 2003
150522 15:21:50 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000001' at position 107, relay log './mmm-relay-bin.000001' position: 4

In slave, I use mysql -urepl -pslavepass -h192.168.10.100 -P3307, I can login the db, why does Slave I/O can't connect to master?

2
I'm facing a similar issue when replicating from RDS to a standalone instance. Were you able to fix this? - Kishore Bandi

2 Answers

1
votes

You may need to unblock port 3306 on the master server. http://www.liquidweb.com/kb/opening-ports-in-your-firewall/

0
votes

You may need to tune SELinux for non-standard ports like 3307. At first check allowed ports (install policycoreutils-python package if semanage command is not found):

# semanage port -l | grep 3306
mysqld_port_t                  tcp      1186, 3306

There's no 3307 port there. Add it:

# semanage port -a -t mysqld_port_t -p tcp 3307
# semanage port -l | grep 3306
mysqld_port_t                  tcp      3307, 1186, 3306

Source: http://dossy.org/2011/11/mysql-replication-connection-error-on-non-standard-ports/