Hello, please sign in or register
You are here: Home

Restoring a broken slave

Found a problem with initiating slave. I ran {{{RESET SLAVE;}}} and then {{{START SLAVE:}}}.

This created relay files in /var/run/mysqld/ which filled up the whole of the partition and caused errors in the logs. To repair the problem i ran {{{RESET MASTER}}} on the master db server and removed the relay files from the slave. This didn't have the desired affect.

>Start slave;
"Error reading slave log configuration"

I then banged my head against the wall. A blog documented a similar problem whereby the files master.info and relay-bin.info were both empty. And to delete them

Gung-Ho

I deleted the following

sudo rm /var/lib/mysql/relay-log.info 
sudo rm /var/lib/mysql/master.info 
sudo rm /var/runmysqld/*

Restarted slave and everything was back to normal.... apart from the data loss.

See Mysqldump and restore slave from master using bash

 

Handling other Errors

Error "ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log"

I opened the syslog where the message said

>sudo less /var/log/syslog
[ERROR] Failed to open the relay log '/var/run/mysqld/mysqld-relay-bin.000040' (relay_log_pos 202987)

I opened up the relay-log.info file

>sudo nano /var/lib/mysql/relay-log.info
/var/run/mysqld/mysqld-relay-bin.000040
...

In the directory /var/run/mysqld/ and the  mysql directory log file mysqld-relay-bin.index there were only three files mentioned, which did not include mysqld-relay-bin.000040.

I deleted the the relay-log.info file

sudo rm /var/lib/mysql/relay-log.info

And restarted mysql slave successfully.

Error: "Slave_IO_Running: No"

I got this another day

mysql> SHOW SLAVE STATUS\G
...
Slave_IO_Running: No
Slave_SQL_Running: Yes
...

 The log file defined in "my.cnf"

err-log=/data/logs/mysqld/mysqld.log

Looking in err-log=/data/logs/mysqld/mysqld.log contained the following lines.

080718 10:35:34 [Note] Slave I/O thread: connected to master 'replicateuser@1.2.3.4:3306',  replication started in log 'db1-bin.000125' at position 920655371
080718 10:35:34 [ERROR] Error reading packet from server: log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master (server_errno=1236)
080718 10:35:34 [ERROR] Got fatal error 1236: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master' from master when reading data from binary log
080718 10:35:34 [ERROR] Slave I/O thread exiting, read up to log 'db1-bin.000125', position 920655371

It tells us what to do Update the mysql parameter on the master. So edit my.cnf with...

max_allowed_packet=16M

Comments

great
great information!
Created 05/11/09
willow315
I am attempting to resolve an issue with mySQL timing out and bringing my site down....about every 4 hours, and sometimes more often. Back-story - this site was created and configured by someone who is no longer with the firm. We are running a Drupa...
Created 12/04/11
Well done posting this
This was a huge help for a replication newbie like myself.
Created 03/06/11
Good post
Thank you, this article helped me to solve my problem.
Created 13/03/13
kunwar.ali
if you face problem master to master replication follow below step for Xampp problem1.#1201 - Could not initialize master info structure; more error messages can be found in the MySQL error log in master to master replication problem2.#errcode 13 - ...
Created 09/10/14
Mysql SLave Crashed
My mysql Slave crashed & i built new slave from getting image of mysql master . But when i look to start slave, slave io is not getting started..Can you please help me in identifying the issue.
Created 13/08/15
chenyan
Bond grinned. pandora-bracciali.it "We bcbgmax.in.net only chaussure...
Created 15/06/16
chenyan
Bond grinned. pandora-bracciali.it "We bcbgmax.in.net only chaussure...
Created 15/06/16
chenyan
Bond grinned. pandora-bracciali.it "We bcbgmax.in.net only chaussure...
Created 15/06/16
chenyan
Bond grinned. pandora-bracciali.it "We bcbgmax.in.net only chaussure...
Created 15/06/16
chenyan
Bond grinned. pandora-bracciali.it "We bcbgmax.in.net only chaussure...
Created 15/06/16
wanglili
kate spade outlet online store ugg boots polo ralph...
Created 21/08/17
Title*
Comment

Prove you are not a robot

To prove you are not a robot, please type in the six character code you see in the picture below
Security confirmation codeI can't see this!
Contact
Name*
Email never shown*
Home Page

Author

Andrew Dodson
Since:Feb 2007

Comment | flag

Categories

Bookmark and Share