Replication stop – Relay log file corrupt

Monday, February 9th, 2009

Okay it’s the second time this problem arise, so I’ll put a blog here just incase it happen again in near future. The replication on slave server just stop working with 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.

Googling up and check several paramters:

on master server:

mysql> show master status\G;
*************************** 1. row ***************************
File: replication.011
Position: 130848689
Binlog_do_db:
Binlog_ignore_db:
1 row in set (0.00 sec)

on slave server:

mysql> show slave status\G;
*************************** 1. row ***************************
Master_Host: 10.10.105.11
Master_User: repl
Master_Port: 3306
Connect_retry: 60
Master_Log_File: replication.011
Read_Master_Log_Pos: 91831752
Relay_Log_File: dragon-relay-bin.183
Relay_Log_Pos: 3551175
Relay_Master_Log_File: replication.011
Slave_IO_Running: No
Slave_SQL_Running: No
Replicate_do_db:
Replicate_ignore_db:
Last_errno: 0
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.
Skip_counter: 0
Exec_master_log_pos: 74359528
Relay_log_space: 21023399

[root@dragon mysql]# tail -f dragon.rpxholding.com.err
081129  0:54:24 Error in Log_event::read_log_event(): 'read error',
 data_len: 148, event_type: 2 081129  0:54:24 Error reading relay
log event: slave SQL thread aborted because of I/O error 081129 0:54:24
Slave: 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_code: 0

Slave IO and SQL are not running. What caused the problem  ? binlog file at master is not corrupted. That’s great and very good news. But relay log file at slave is corrupted. That’s what make replication can’t read it. Fixing the problem:

(more…)

SocialTwist Tell-a-Friend

Skip Replication Error

Monday, February 9th, 2009

This is happen long time ago when Mysql Replication stop due to duplicate error, Kumay has the log. But I don’t want to do a manual labor. So to skip a duplicate error on A MySQL Replication Server (SLAVE) automatically. Added this line on /etc/my.cnf

Note: Make sure you know what cause a duplicate error and does it really not important so that you can skip inserting that query.
(more…)

SocialTwist Tell-a-Friend

MySQL 5 access via old MySQL-Front 2.5

Thursday, August 7th, 2008

Old mysqlfront access to mysql5

Kusma!!!, Now I know how to make old mysql front ver 2.5 which created on 2002 and using libmysql from mysql 3.23 accessing mysql5 server. I just realized this when Andry complaining and whining can’t access Ivory DB on new server which also mysql5 using his old mysql-front. He said, he can use mysql-front 2.5 accessing Mysql server 5 on his localhost and BOX server.

Now, if I can make sure old mysql-front program accessing mysql server 5 this will make major leap!!!
old zeos component (which also based on libmysql from mysql 3.23) for delphi 5 now can access Mysql 5 server. God know what happen when mysql5 take control, replacing old and dull mysql4. We can make master-master replication, clustering mysql server or make mysql serve faster by running mysql proxy. But it depend on how much the company will spend money for investing on hardware (and pay me of course to execute it)

Kusma, do you want to know how to enable Mysql server 5 to acknowledge old mysql-front program to access it? if so comment to this article please :D

SocialTwist Tell-a-Friend

Running MySQL 4 and MySQL 5 Concurrently

Friday, June 20th, 2008

From Howtoforge.com’s article: Running MySQL 4 And MySQL 5 Concurrently

But I did in another way, because current release of CentOS / RHEL 5 already include MySQL 5 and I install MySQL 4 manually. I need a server with 2 MySQL version for development purpose: as current development is using MySQL 4 so I’ll configure it to use default port 3306 and for MySQL 5 will use port 3307.

First install CentOS with MySQL 5, afterthat configure MySQL 5 to use port 3307

# cp /usr/share/doc/mysql-server-5.0.22/my-medium.cnf /etc/my.cnf
# vi /etc/my.cnf
...
[client]
#password       = your_password
port            = 3307
socket          = /var/lib/mysql/mysql.sock

# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port            = 3307
socket          = /var/lib/mysql/mysql.sock
...
# chkconfig mysqld on
# service mysqld start

To add new mysql user you can read “Adding mysql users“, to change mysql’s root password use:

# /usr/bin/mysqladmin -u root password 'newpassword'

Now we are going to install MySQL 4

(more…)

SocialTwist Tell-a-Friend

Running MySQLd as standalone application on Windows

Saturday, May 3rd, 2008

My friend asked me how to get MySQL running as Windows standalone application. So he can execute the mysql start-up command by putting it inside his application. So every time his application run, it also start up mysql daemon. He doesn’t want MySQL running as service every time Windows starts as someone can access the data from outside his program. So after couple of times trying, here it is.

Note:

  • I am using 3.23.58 version because it’s the simplest mysql binaries for Windows. But for enhanced feature and security, I think it can be done on newest mysql version.
  • I assume you save the zip file on drive C:\> and extract it there.

(more…)

SocialTwist Tell-a-Friend