Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a master-master setup which I want to move to a new pair of servers (from linux to opensolaris). linux boxes names are shard1-1 and shard1-2, and osol boxes names are shard1-1-osol and shard1-2-osol.

this is what I did: 1. took down mysql server on both linux boxes, copied the data to the osol boxes. 2. edited on each of the osol boxes, changed master from shard1-1 to shard1-1-osol and vice versa on both machines.

when I started mysql on the first osol machine, I see this in the error log: looks like mysql does not like the host name change, and it's bitching about it. the mysqld-relay-bin.000707 file exists in the datadir, so it's not clear what mysql is whining about.

090902  2:26:03  InnoDB: Started; log sequence number 246 3528553673
090902  2:26:03 [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=shard1-1-osol-relay-bin' to avoid this problem.
090902  2:26:03 [ERROR] Failed to open the relay log './mysqld-relay-bin.000707' (relay_log_pos 19653396)
090902  2:26:03 [ERROR] Could not find target log during relay log initialization
090902  2:26:03 [ERROR] Failed to initialize the master info structure
share|improve this question
up vote 2 down vote accepted

The server can't find the relay logs because they are named based in part upon the host name. You are going to have ALL KINDS of problems trying to bring the slave up using that technique. I suggest reinitializing the slave from the new master. Just drop all the databases on the slave, take a dump from the master using mysqldump, import it onto the slave and then use CHANGE MASTER TO in order to set up replication from the new master. It is WAY easier then trying to troubleshoot all the problems you are going to run into.

share|improve this answer
that's exactly what I ended up doing already. – Omry Sep 2 '09 at 13:21

I have to disagree to an extent. You can rename the log files and update the, relevant .index file and/or set 'log-bin' set in my.cnf to make it work.

share|improve this answer

A useful guide to a problem which has similar effects to yours is Watch out for hostname changes when using replication!, by Trent from Sun/MySQL.

share|improve this answer
thanks, also pretty useful. I took a more brute force approach for restarting the replication - I simply nuked the relay logs and index and started clean. – Omry Sep 2 '09 at 16:03

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.