Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[MySQL] Server-id causes Slave_IO_Running: No master-slave replication failure

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

[problem description]:

After master downtime maintenance starts the service, the Slave_IO_Running status of slave is set to NO

Slave_SQL_Running is Yes, guess it should be master's pot.

It is still unavailable after continuing to check the network, permissions and other issues.

And try again.

Change master to....

Master_log_file = 'master-bin.034555'

Master_log_pos = 98

Still unavailable

160322 9:42:51 [Note] Slave SQL thread initialized, starting replication in log 'master-bin.034555' at position 98, relay log'. / mysqld-relay-bin.000001' position: 4160322 9:43:01 [Note] Slave Slave O thread: connected to master 'repl@*.*:3306' Replication started in log 'master-bin.034555' at position 98160322 9:43:01 [ERROR] Error reading packet from server: Misconfigured master- server id was not set (server_errno=1236) 160322 9:43:01 [ERROR] Got fatal error 1236:' Misconfigured master- server id was not set' from master when reading data from binary log160322 9:43:01 [Note] Slave I Grey O thread exiting, read up to log 'master-bin.034555', position 98160322 9:43:07 [Note] Error reading relay log event: slave SQL thread was killed

Check the configuration file and find that # server-id = xxx is commented

[solution]:

Because server_id is "Dynamic Variable"

Therefore, it is executed manually in master.

Mysql > SET GLOBAL server_id=3028

Query OK, 0 rows affected (0.00 sec)

Finally, add to the configuration file

Server-id=3028

Check on slave:

Mysql > SHOW SLAVE STATUS\ G

* * 1. Row *

Slave_IO_State: Waiting for master to send event

Master_Host: 192.168.30.28

Master_User: repl

Master_Port: 3306

Connect_Retry: 60

Master_Log_File: master-bin.034556

Read_Master_Log_Pos: 59312658

Relay_Log_File: mysqld-relay-bin.000002

Relay_Log_Pos: 64698308

Relay_Master_Log_File: master-bin.034555

Slave_IO_Running: Yes

Slave_SQL_Running: Yes

... Seconds_Behind_Master: 10071

1 row in set (0.00 sec)

Solve it.

Similarly, sometimes "The server is not configured as slave" is wrong in the start slave Times.

It is also likely that it is because of server-id, which only needs to be executed manually on the master and slave libraries:

SET GLOBAL server_id = xxx, and make sure that the two server-id are not the same, and finally write it into my.cnf.

Author's official account on Wechat (continuously updated)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report