MySQL Replication encounters Got fatal error 1236 from master repair

Source: Internet
Author: User


Usually encountered this situation, are Slave binlog bad, on the Slave DB of the data to solve, but this encounter is Master's Binlog bad, a little bitter ~

The error message is as follows:

last_io_errno:1236
Last_io_error:got fatal Error 1236 from master while reading data from binary log: ' Client requested Master to start REPL Ication from impossible position; The "mysql-bin.003583 ' at 45997491," the last event read from "/mysql-bin.003583 ' at 4," last byte read fro M './mysql-bin.003583 ' at 4. '

MySQL Replication encounters Got fatal error 1236 from master repair
Mysql> Show SLAVE STATUSG

The error message is as follows: (already removed without need)

master_log_file:mysql-bin.003583
read_master_log_pos:45997491
relay_log_file:mysqld-relay-bin.006789
relay_log_pos:103569723
relay_master_log_file:mysql-bin.003361
Slave_io_running:no
Slave_sql_running:yes
last_errno:0
skip_counter:0
last_io_errno:1236 Last_io_error:got fatal Error 1236 from master when reading data from binary log: ' Client requested M Aster to start replication from impossible position; The "mysql-bin.003583 ' at 45997491," the last event read from "/mysql-bin.003583 ' at 4," last byte read fro M './mysql-bin.003583 ' at 4. '

?: Debian/ubuntu Linux preset MySQL data path:/var/lib/mysql, so the following binlog can be found on this path.

Slave Binlog The Broken Solution

1. Generally common is Slave binlog is broken, so will go to Slave to find mysql-bin.003583 file first.
2. mysql-bin.003583 the data with Mysqlbinlog dump, point to the next position can be.
3.slave:ls/var/lib/mysql/mysql-bin.003583 # not found.
4.Slave There is no file, only to find that the bad is Master.
Master Binlog The Broken Solution
Master: # mysqlbinlog/var/lib/mysql/mysql-bin.003583 > ~/3583

Error:error in Log_event::read_log_event (): ' Read Error ', data_len:27, event_type:16

The most bitter condition is that Master's binlog is broken, so all the Slave are dead. Xd
There are several ways to consider this:

1. All Slave (most insured, no data lost)
2. First let Replication can start, and then rewind/sync must be synchronized data. (Cache ...) You don't have to ignore him.
the following is 裼 Mei 诙?

1.mysql> STOP SLAVE;
2.mysql> change MASTER to Master_log_file = ' mysql-bin.003584 ', master_log_pos = 0; # First point to the next Binlog file, pos means 0 or 4 , all the same meaning.
3.mysql> START SLAVE; The
4.mysql> show SLAVE STATUS G should be restored.
5. Then fill in the Pt-table-sync for the important Table. (apt-get install Percona-toolkit)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.