1

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 master.info 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

4 Answers 4

2

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.

1
  • that's exactly what I ended up doing already.
    – Omry
    Sep 2, 2009 at 13:21
3

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

1

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.

1
  • 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, 2009 at 16:03
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .