lestrrat / mysql-master-ha

Automatically exported from code.google.com/p/mysql-master-ha
0 stars 0 forks source link

Maunal purge_relay_logs crash my replication #108

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Try to manual purge the relay log on MHA second master, my command as below:
purge_relay_logs --user=root --password=123123 --port=3306 
-disable_relay_log_purge --workdir=/usr/local/mysql/data/ >> 
/usr/local/mysql/data/purge_relay_logs.log 2>&1

after run the command, will clear all of my relay logs, then my replication 
crashed and get this error:

Last_SQL_Error: Relay log read failure: 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.

Anybody can tell me how to clear those relay logs on MHA? thanks.

Best Regards
Garey

Original issue reported on code.google.com by gb.oldga...@gmail.com on 2 Mar 2015 at 8:08

GoogleCodeExporter commented 8 years ago
I m encounter new errors,
when I run below shell command, throw me an error:

/usr/local/bin/purge_relay_logs --user=root --password=123123 
--disable_relay_log_purge >> /data/mysql/data/purge_relay_log.log 2>&1

here was the error message:

2015-03-04 11:17:26: purge_relay_logs script started.
 Found relay_log.info: /data/mysql/data/relay-log.info
 Removing hard linked relay log files twpdb21-relay-bin* under /var/tmp.. done.
 Current relay log file: /data/mysql/data/twpdb21-relay-bin.000074
 Archiving unused relay log files (up to /data/mysql/data/twpdb21-relay-bin.000073) ...
 Creating hard link for /data/mysql/data/twpdb21-relay-bin.000066 under /var/tmp/twpdb21-relay-bin.000066 ..ln: creating hard link `/var/tmp/twpdb21-relay-bin.000066' => `/data/mysql/data/twpdb21-relay-bin.000066': Invalid cross-device link
 at /usr/local/bin/purge_relay_logs line 94
        main::hardlink_relay_logs('twpdb21-relay-bin.000074') called at /usr/local/bin/purge_relay_logs line 209
        eval {...} called at /usr/local/bin/purge_relay_logs line 155
        main::main() called at /usr/local/bin/purge_relay_logs line 68

Can tell me how to fix the issue? thanks

Regards
Garey

Original comment by gb.oldga...@gmail.com on 4 Mar 2015 at 3:29

GoogleCodeExporter commented 8 years ago
Would you set --workdir in a same OS partition as MySQL relay logs (but 
different directory) and see if it works?

Original comment by Yoshinor...@gmail.com on 4 Mar 2015 at 5:05