Error Initializing Relay Log Position
Contents |
into a little issue setting up a MySQL slave. I have done this a least a have dozen times before, and it is always pretty painless, failed to open the relay log but this time, I kept getting hung up on error that
Could Not Find Target Log During Relay Log Initialization
looked like this: 071118 16:44:10 [ERROR] Failed to open the relay log './-relay-bin.003525' (relay_log_pos 22940879) 071118 16:44:10 [ERROR] could not initialize master info structure Could not find target log during relay log initialization 071118 16:44:10 [ERROR] Failed to initialize the master info structure Googling a little turned up this mysql forum, http://forums.mysql.com/read.php?26,112490,223025#msg-223025 Which
Mysql Purge Relay Logs
then led me to this mysql doc page http://dev.mysql.com/doc/refman/5.0/en/replication-howto-additionalslaves.html This was confusing, and didn't really seem like it got to the root of the problem. Why would one slave care about another, if they were both reading from the master? I think that article would more accurately be called "Making a slave of a slave" or some such, because could not find target log file mentioned in relay log info in the index file "Introducing Additional Slaves to an Existing Replication Environment" does not convey that they are talking about a slave of a slave (which I think they are). Anyway, long and short of it, I removed the ‘master.info' ‘mysqld-relay-bin.*' ‘relay-log.info' ‘relay-log-index.*' from the MySQL data directory, restarted mysql (‘/etc/init.d/mysql restart'), and off to the races. Sometimes, depending on the order you do edit the configs or restart mysql, you can get bad data in those files, and it can lead to crpytic errors. Remove those, and you can always start fresh. This entry was posted in Uncategorized. Bookmark the permalink. 6 thoughts on “Relay log issues when starting MySQL replication slave” Akom says: May 2, 2011 at 1:33 pm That really helped - mine broke with a 5.0 to 5.1 upgrade on the slave (master is still 5.0). Deleted files, started, (it tried to play from beginning of relay logs, with duplicate errors), stop slave, change master to previously shown master position, start slave - and it's all good. Whew DR.J says: September 9, 2011 a
Connectors More MySQL.com Downloads Developer Zone Section Menu: Documentation Home MySQL 5.6 Reference Manual Preface and Legal
Mysql Relay Log Read Failure
Notices General Information Installing and Upgrading MySQL Tutorial MySQL
Mysql Reset Relay Log
Programs MySQL Server Administration Security Backup and Recovery Optimization Language Structure Globalization Data Types mysql relay log vs binlog Functions and Operators SQL Statement Syntax The InnoDB Storage Engine Alternative Storage Engines High Availability and Scalability Replication Replication Configuration How to Set Up http://dev.nuclearrooster.com/2009/03/06/relay-log-issues-when-starting-mysql-replication-slave/ Replication Setting the Replication Master Configuration Setting the Replication Slave Configuration Creating a User for Replication Obtaining the Replication Master Binary Log Coordinates Creating a Data Snapshot Using mysqldump Creating a Data Snapshot Using Raw Data Files Setting Up Replication with New Master and Slaves Setting Up Replication https://dev.mysql.com/doc/refman/5.6/en/slave-logs-relaylog.html with Existing Data Introducing Additional Slaves to an Existing Replication Environment Setting the Master Configuration on the Slave Replication Formats Advantages and Disadvantages of Statement-Based and Row-Based Replication Usage of Row-Based Logging and Replication Determination of Safe and Unsafe Statements in Binary Logging Replication with Global Transaction Identifiers GTID Concepts Setting Up Replication Using GTIDs Using GTIDs for Failover and Scaleout Restrictions on Replication with GTIDs Replication and Binary Logging Options and Variables Replication and Binary Logging Option and Variable Reference Replication Master Options and Variables Replication Slave Options and Variables Binary Log Options and Variables Global Transaction ID Options and Variables Common Replication Administration Tasks Checking Replication Status Pausing Replication on the Slave Replication Implementation Replication Implementation Details Replication Relay and Status Logs The Slave Relay Log Slave Status Logs How Servers Evaluate Replication Filtering Rules Evaluation of Database-Level Replication
replication on slave (version 5.1.61) has stopped. Slave_IO_Running was marked as Yes, but Slave_SQL_Running http://www.redips.net/mysql/replication-slave-relay-log-corrupted/ as No. Simple stop/start slave didn't help so further problem http://stackoverflow.com/questions/9711551/moving-a-mysql-slave-to-new-hard-drives-do-i-need-mysqld-relay-bin-logs analysis was needed. It seemed that current slave's relay log was corrupted because testing with "mysqlbinlog" has printed out an error. Therefore, the solution was to discard current relay binlogs and to point slave to the last master binlog relay log position. Here is complete output from show slave status\G on stopped slave server: Slave_IO_State: Waiting for master to send event Master_Host: 10.1.79.48 Master_User: replica Master_Port: 3306 Connect_Retry: 60 Master_Log_File: mysql-bin.002046 Read_Master_Log_Pos: 639600842 Relay_Log_File: triton-relay-bin.001957 Relay_Log_Pos: 243 Relay_Master_Log_File: mysql-bin.002045 Slave_IO_Running: Yes Slave_SQL_Running: No Replicate_Do_DB: pretinac_radio,web Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: web.logging_www,web.logging_raspored,web.web_korisnik Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: could not find Last_Errno: 1594 Last_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. Skip_Counter: 0 Exec_Master_Log_Pos: 103641119 Relay_Log_Space: 983411603 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 Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 1594 Last_SQL_Error: [the same error description as in Last_Error] To fix the error, current binlog files on slave should be discarded and set new position. Before setting n
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Moving a MySQL slave to new hard drives - do I need mysqld-relay-bin logs? up vote 1 down vote favorite I am moving a MySQL slave from one set of HDs to another. The configuration of the machine denies me the ability to have both old and new hard drives on it at the same time. So I rsync'ed the data directory to another machine. Whe the new hard drives came online, I rsyn'ed the data dir back. This worked fine. However, I cannot start replication. This is the error I get. 120314 4:23:07 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=mysqld-relay-bin' to avoid this problem. 120314 4:23:07 [ERROR] Failed to open the relay log '/var/lib/mysqllogs/mysqld-relay-bin.000273' (relay_log_pos 677043943) 120314 4:23:07 [ERROR] Could not find target log during relay log initialization 120314 4:23:07 [ERROR] Failed to initialize the master info structure I found this comment: http://serverfault.com/questions/61471/moving-a-mysql-slave-to-a-new-host-failed-to-open-the-relay-log If it is just complaining about the relay logs, in most cases, they are disposable if the master still has the binary logs around. You can just run CHANGE MASTER TO on the slave and it will flush the existing relay logs and start anew. You don't need to make a new fresh copy. This seems to suggest that I do not need these log files. The host name is not changing. My Questions: Do I need these log files? If not, what do I need to do to get replication started? Will it remember where it left off? If I do need these log files, is there anything else I'm forgetting? mysql replication slave share|improve this question asked Mar 14 '12 at 22:55 Chris Stewart 63 add a comment| 1 Answer 1 active oldest votes up vote 4 dow