2015-05-22 38 views
0

我使用了keepalived + proxy + mysql。
站長:192.168.10.1
奴隸:192.168.10.2
主-VIP:192.168.10.100
當我使用CHANGE MASTER TO MASTER_HOST='192.168.10.1'...,複製是確定的,當我使用CHANGE MASTER TO MASTER_HOST='192.168.10.100'...,從I/O無法連接到主,和我的錯誤是這樣的:mysql複製錯誤:從站I/O:錯誤連接到主

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

在奴隸,我用mysql -urepl -pslavepass -h192.168.10.100 -P3307,我可以登錄該數據庫,爲什麼從I/O無法連接到高手?

回答

-2

您可能需要調整SELinux的非標準端口像3307在第一次檢查允許的端口(安裝policycoreutils-python包,如果未找到semanage命令):

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

有沒有3307口那裏。添加:

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

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