Home > database >  Mysql5.7 master-slave synchronization, the library can't IO thread is yes
Mysql5.7 master-slave synchronization, the library can't IO thread is yes

Time:01-24

Mysql5.7 source centos7.5
From library IO thread can't be a yes state
Last_IO_Errno: 0
Last_IO_Error: The slave I/O thread stops because of a fatal error is encountered when it try to get The value of SERVER_ID variable from The master. Error:

Main library master firewall and shut down the SELinux
Main library user privilege repluser only gives a sync command
Mysql> To grant the replication slave on *. * repluser @ "%" identified by "123: QQQ... A ";
Vi/etc/my CNF
Server - id=51
Log_bin=/data/mysql5.7 master51

Mysql> Show the master status.
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
154 | | master51.000004 | | | |
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +


From slave closed firewall and closing SELinux
Vi/etc/my CNF
Server - id=52

Mysql> Change master to master_host="192.168.41.51", master_user="repluser," master_password="123: QQQ... A ", master_log_file="master51.000004", master_log_pos=154;

Mysql> Start slave;
Query OK, 0 rows affected (0.00 SEC)

Mysql> Show slave status \ G;
Last_IO_Errno: 0
Last_IO_Error: The slave I/O thread stops because of a fatal error is encountered when it try to get The value of SERVER_ID variable from The master. Error:
The main library is authorized users access only synchronization, master-slave network is connected, the main library use authorized users can log in the database,

From the library is not started start slave;
Mysql> Show slave status \ G;
Slave_IO_Running: No
Slave_SQL_Running: No
Last_IO_Errno: 0
Last_IO_Error: The slave I/O thread stops because of a fatal error is encountered when it try to get The value of SERVER_ID variable from The master. Error:
The state has the mistake, no startup errors occur, what is the solution to this problem



  • Related