Could Not Initialize Master Info Structure More Error Messages
Contents |
At times I've received this message when restarting error reading master configuration a mysql slave server: Could not initialize master info
Error Counting Relay Log Space
structure; more error messages can be found in the MySQL error log This could not find target log during relay log initialization often occurs when changing the hostname of the slave (ie, master failover) and relay-log is not set in the my.cnf. The
Failed To Open The Relay Log
answer here is to simply issue ‘show slave status\G' and record the current master log file and position. Then reset the slave, and change master back to exactly where it was. Not that this requires the replication credentials. 1. display current replication information error 1202 SHOW SLAVE STATUS\G Note the Master_Log_File and Read_Master_Log_Pos. 2. Reset the slave - note that this will completely reset the slave, removing all master info - do not do this if you do not have your master info noted. RESET SLAVE ALL; 3. Setup replication again by issuing a change master statement. CHANGE MASTER TO MASTER_HOST='master_ip', MASTER_USER='replicationuser', MASTER_PASSWORD='replicationpass', MASTER_LOG_FILE='(from above)', MASTER_LOG_POS= (from above); Then start the slave and you should be good. START SLAVE; Posted on June 10, 2013Author JoshCategories Open Source Software Leave a Reply Cancel reply Your email address will not be published. Required fields are marked *Comment Name * Email * Website Post navigation Previous Previous post: MySQL - Large Dataset Dump and RestoreNext Next post: EBS Volumes - deleteOnTermination ? Proudly powered by WordPress
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
Got Fatal Error 1236 From Master When Reading Data From Binary Log
MASTER}}} on the master db server and removed the relay files from
Change Master To
the slave. This didn't have the desired affect. >Start slave; "Error reading slave log configuration" I then banged could not find first log file name in binary log index file 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 https://itsecureadmin.com/2013/06/could-not-initialize-master-info-structure-more-error-messages-can-be-found-in-the-mysql-error-log/ /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 http://perplexed.co.uk/301_restoring_a_broken_slave.htm 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. S
| Software RAID in Ubuntu Karmic 9.10 > MySQL replication dies with ERROR 1201 (HY000): Could not initialize master info structure Posted by Admin • Friday, February http://tech.akom.net/archives/50-MySQL-replication-dies-with-ERROR-1201-HY000-Could-not-initialize-master-info-structure.html 12. 2010 • Category: Linux On a fine happy morning I am http://forums.mysql.com/read.php?26,259192 greeted with an alert that slave is not running. Running start slave yields this: ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log Enabling the log yielded nothing. Googling yielded This Page that helped me a lot, but I could not didn't have to do quite as much work all over again. Here is what I did. First, I saved my "SHOW SLAVE STATUS\G" output: ************************** 1. row ************************** Slave_IO_State: Master_Host: 127.0.0.1 Master_User: replication Master_Port: 3307 Connect_Retry: 60 Master_Log_File: mysqld-bin.000401 Read_Master_Log_Pos: 98 Relay_Log_File: mysqld-relay-bin.006135 Relay_Log_Pos: 242 Relay_Master_Log_File: mysqld-bin.000401 Slave_IO_Running: No Slave_SQL_Running: No Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 could not find Exec_Master_Log_Pos: 98 Relay_Log_Space: 0 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: NULL 1 row in set (0.00 sec) Next I followed instructions from the blog I mentioned above: STOP SLAVE; RESET SLAVE; Instead of fully reconfiguring I simply tried to start slave. This is a bad idea because it seems to just try to start slaving off the front of the first binlog file it finds, getting conflicts (or worse). So I tried something simple: mysql> CHANGE MASTER TO MASTER_LOG_POS=98 , MASTER_LOG_FILE = 'mysqld-bin.000401'; Query OK, 0 rows affected (0.04 sec) mysql> start slave; Query OK, 0 rows affected (0.00 sec) The position comes from the output I saved before It's working fine again. Still don't know what caused this - possibly random remote server power cycling... 0 Trackbacks Trackback specific URI for this entry No Trackbacks 2 Comments Display comments as (Linear | Threaded) Anonymous on 2010-12-22 09:15: dude you are awesome..thanks alot Anonymous on 2011-06-07 08:34: You just saved me a lot of time and a lot of Advil. Thanks! Add Comment Name Email Homepage [ Top
Community Podcasts MySQL.com Downloads Documentation Section Menu: MySQL Forums :: Replication :: Can't restart slave - Could not initialize master info structure New Topic Advanced Search Can't restart slave - Could not initialize master info structure Posted by: Rasmus U () Date: April 23, 2009 07:03AM Hi, I've set up replication for backup/logging/statistics purposes. Everything is working okay, EXCEPT if the slave server i down more than a few hours/days, I can't restart the slave process. The error message is ERROR 1201 (HY000): Could not initialize master info structure; and [ERROR]Failed to open the relay log '/var/run/mysqld/....' [ERROR] Could not find target log during relay log initialization As I understand, the logs get flushed after prolonged downtime/reboot. Is it any way I can configure the slave server, so that it'll catch up with the master server, without me having to get a new snapshot/master position etc (which is a cumbersome process). - The slave already knows the last position it has reached at the master, so I do not understand the significance of the relay log... Does it make a difference whether the slave is STOPped before stopping the mysqld service? Thanks for your help! Edited 1 time(s). Last edit at 04/23/2009 07:03AM by Rasmus U. Navigate:Previous Message•Next Message Options:Reply•Quote Subject Views Written By Posted Can't restart slave - Could not initialize master info structure 8435 Rasmus U 04/23/2009 07:03AM Re: Can't restart slave - Could not initialize master info structure 4001 Rick James 04/24/2009 10:44PM Re: Can't restart slave - Could not initialize master info structure 3191 Rasmus U 04/28/2009 03:11AM Re: Can't restart slave - Could not initialize master info structure 2970 Rick James 04/28/2009 10:44PM Re: Can't restart slave - Could not initialize master info structure 2819 Rasmus U 04/29/2009 09:19AM Re: Can't restart slave - Could not initialize master info structure 2939 Rick James 04/29/2009 08:39PM Re: Can't restart slave - Could not initialize master info structure 3537 Rasmus U 04/30