How to Solve gtid master-slave replication connecting Issue

Project scenario:

Master slave connection method


Problem Description:

Last_IO_Errno: 2003 Last_IO_Error: error connecting to master '[email protected]:3306' - retry-time: 60 retries: 7

Cause analysis:

    1. when trying to log in to the master database to copy users from the server, an error of 113 is found

[ root@localhost mysql]# mysql -urepl -p123 -h 192.168.8.131 -P 3306 mysql: [Warning] Using a password on the command line interface can be insecure. Error 2003 (HY000): can't connect to MySQL server on '192.168.8.131' (113)

    1. check whether the main server firewall is closed. It is found that it is closed. It is speculated that the port is not open

systemctl status firewalld service

    1. 3. Check whether the 3306 port of the main database is open to the public. It is found that it is no

firewall CMD -- zone = public -- Query port = 3306/TCP

    1. 4 Open 3306 port

firewall CMD -- zone = public -- add port = 3306/TCP -- permanent

    1. 5 Update firewall

firewall CMD -- reload

 

Solution:

The master-slave replication connecting problem is mainly caused by the master and slave libraries can not be connected, after this problem found that although the firewall has been closed, but the port is not necessarily open to the public state, you need to set their own.

Read More: