본문 바로가기

Linux/Mysql

Last_Error: Could not parse relay log event entry.

mysql  slave 에서 리플리케이션이 깨지는 문제가 발생했다. error 로그는 다음과 같았다

Last_Error: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.

단순히 포지션을 증가 시키는 것으로 문제가 해결 되지 않을 것 같기에 구글형님에게 도움을 요청 하였고 다음과 같은 답변을 받을 수 있었다.

Investigating is what you do later but how do you fix the problem first ? The important question you need to have answered - are logs corrupted on the master ? If logs on the master are OK you can just run SHOW SLAVE STATUS on slave experiencing error and use CHANGE MASTER TO to re-point replication to Relay_Master_Log_File:Exec_Master_Log_Pos:

음~ 역시 세상에 천재들이 즐비 하는것 같다. 여하튼 나와있는 내용대로 적용 해 보았다.

mysql > slave stop; 
Query OK, 0 rows affected (0.00 sec) 
CHANGE master TO master_log_file='binlog.000562',master_log_pos=140;
Query OK, 0 rows affected (1.16 sec) 
mysql > slave start; 
Query OK, 0 rows affected (0.00 sec)

자 이로써 slave 가 다시 릴레리 로그를 실행 할수 있도록 되었다. 하지만~ 나의 경우 위와 같은 방법을 통해서도
해결 되지 않는 문제가 있었다. 슬레이브 상태를 보면 로그를 가져 오지 못하고 timeout 이 걸리는 현상이 발생 했는데 이것은 max_allowed_packet 와 관련된 현상인듯 하다.


'Linux > Mysql' 카테고리의 다른 글

mysql 이 사용할 물리적 메모리 총합 공식  (0) 2009.07.16
FEDERATED Tables  (0) 2008.10.09
Replication  (0) 2008.10.09