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.
ERROR 1201: Could not initialize master info structure, more error messages can be found in the MySQL error log
Feb 15 07:41:06 rdb-sl mysqld[18223]: 080215 7:41:06 [ERROR] Failed to open log (file './db-sl-relay-bin.000030', errno 2) Feb 15 07:41:06 db-sl mysqld[18223]: 080215 7:41:06 [ERROR] Failed to open the relay log './db-sl-relay-bin.000030' (relay_log_pos 75527094) Feb 15 07:41:06 db-sl mysqld[18223]: 080215 7:41:06 [ERROR] Could not open log file
before you consider making a mysqldump –masterdata on the master database and reimport the entire dump.. try this:
-> stop mysql on the slave server -> find the directory that contains the relay logs (usually /var/lib/mysql) -> delete all relay logs called hostname-relay-bin.XXX, hostname-relay-bin.index and relay-log.info -> restart mysql
Your mysql will start with fresh relay logs and is getting the missing data directly from the master server, as there will be probably still bin logs!
The simplest way to restart replication from this point is to re-enter the mater.info data manually. Do the following:
1.STOP SLAVE 2.RESET SLAVE 3.CHANGE MASTER TO MASTER_HOST=’your_master’, MASTER_USER=’your_login’, MASTER_PASSWORD=’your_password’, MASTER_LOG_FILE=’log_file’, MASTER_LOG_POS=log_position 4.START SLAVE At this point you want to execute ‘SHOW SLAVE STATUS’ and check to see if everything is running. Most times MySQL will stop since it tried to replay a duplicate record from the logs. We need to tell MySQL to skip that record and continue:
1.SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1 2.START SLAVE That should get replication up and running again.
What is interesting to note is that, under the same circumstances, my MySQL 4 servers had no problems continuing replication.
|