Error Failed To Open The Relay Log Relay_log_pos 4
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, but this time, I kept getting hung up on error that looked like this: 071118 16:44:10 [ERROR] Failed could not find target log during relay log initialization to open the relay log './-relay-bin.003525' (relay_log_pos 22940879) 071118 16:44:10 [ERROR] Could not find target failed to initialize the master info structure 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,
Mysql Delete Relay Logs
http://forums.mysql.com/read.php?26,112490,223025#msg-223025 Which 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
My.cnf Relay-log
from the master? I think that article would more accurately be called "Making a slave of a slave" or some such, because "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 could not find target log file mentioned in relay log info in the index file 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 at 5:22 am Thanks you made my Friday. My instance pointed to the default relay log, even though I had defined a different one. Deleting them worked for me too. Sam says: February 7, 2012 at 11:30 am That worked great for me, after I searched several other places trying to figure out why my replication was no longer working. Thanks so much for posting it! Frank says: April 2, 2012 at 2:18 am Thanks for th hint. Smoking brain before. Chileno says: September 25, 2013 at 7:33 am Cool! Save my time Brandon says: September 29, 2013 at 4:53 pm This saved my bacon. I've added this to our SOP
Connectors More MySQL.com Downloads Developer Zone Section Menu: Documentation Home MySQL 5.7 Reference Manual Preface
Mysql Relay Log Read Failure
and Legal Notices General Information Installing and Upgrading MySQL error reading master configuration Using MySQL as a Document Store Tutorial MySQL Programs MySQL Server Administration Security Backup error counting relay log space and Recovery Optimization Language Structure Globalization Data Types Functions and Operators SQL Statement Syntax The InnoDB Storage Engine Alternative Storage Engines High Availability http://dev.nuclearrooster.com/2009/03/06/relay-log-issues-when-starting-mysql-replication-slave/ and Scalability Replication Configuring Replication Binary Log File Position Based Replication Configuration Overview Setting Up Binary Log File Position Based Replication Setting the Replication Master Configuration Creating a User for Replication Obtaining the Replication Master Binary Log Coordinates Choosing a Method for Data Snapshots Setting Up https://dev.mysql.com/doc/refman/5.7/en/slave-logs-relaylog.html Replication Slaves Adding Slaves to a Replication Environment Replication with Global Transaction Identifiers GTID Concepts Setting Up Replication Using GTIDs Using GTIDs for Failover and Scaleout Restrictions on Replication with GTIDs MySQL Multi-Source Replication MySQL Multi-Source Replication Overview Multi-Source Replication Tutorials Multi-Source Replication Monitoring Multi-Source Replication Error Messages Changing Replication Modes on Online Servers Replication Mode Concepts Enabling GTID Transactions Online Disabling GTID Transactions Online Verifying Replication of Anonymous Transactions 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 Logging Options and Variables Global Transaction ID Options and Variables Common Replication Administration Tasks Checking Replication Status Pausing Replication on the Slave Replication Implementation Replication Formats Advantages and Disadvantages of Statement-Based and Row-Based Replication Usage of Row-Based Logging and Replicatio
Databases, mySQL Add comments So you woke up, because your mysql http://hoschie.org/2008/02/mysql-failed-to-open-the-relay-log/ replication failed suddenly with an error like: Feb 15 07:41:06 rdb-sl http://stackoverflow.com/questions/9711551/moving-a-mysql-slave-to-new-hard-drives-do-i-need-mysqld-relay-bin-logs mysqld[18223]: 080215 7:41:06 [ERROR] Failed to open log (file './db-sl-relay-bin.000030', errno 2)
Feb 15 07:41:06 db-sl mysqld[18223]: 080215 7:41:06 [ERROR] Failed to open the relay log './db-sl-relay-bin.000030' (relay_log_pos 75527094)
Feb 15 07:41:06 db-sl mysqld[18223]: 080215 7:41:06 [ERROR] Could not open log relay log file before you consider making a mysqldump -masterdata on the master database and reimport the entire dump.. try this: -> stop mysql on the slave server -> find the directory that contains the relay logs (usually /var/lib/mysql) -> delete all relay logs called hostname-relay-bin.XXX, hostname-relay-bin.index and relay-log.info -> restart mysql Your mysql will start could not find with fresh relay logs and is getting the missing data directly from the master server, as there will be probably still bin logs! Note: This is a kind of last resort action, no guarantees here 🙂 Leave a Reply Click here to cancel reply. You must be logged in to post a comment. Home About & Contact Useful Stuff GPG Key Free WordPress Themes Tagsapp Backup database Dovecot freebsd server imap India iOS iphone ipv6 iTunes linux Mac mediatomb mkv mySQL ping proxy PS3 squid Topics Databases (1) mySQL (1) Games (1) PS3 (1) Music (1) Operating Systems (11) FreeBSD (4) General Linux (6) Gentoo Linux (4) iOS (2) OS X (1) Ubuntu Linux (3) Traveling (11) India (11) Uncategorized (1) Meta Register Log in Entries (RSS) Comments (RSS) WordPress Tagtastic..app Backup database Dovecot freebsd server imap India iOS iphone ipv6 iTunes linux Mac mediatomb mkv mySQL ping proxy PS3 squid Links Knobelbecher Networks Holidays in Thuringia Schnitzelkuchen.de
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 down vote I don't think you need the relay bin loge files to