Yeah, yeah .. I know, it’s weekend. But I usually can think much better when no one is rattling my cage. So I had another look at my replication problems.
Don’t you never ever change InnoDB settings when migrating between hardware,
because InnoDB is rather sensitive regarding those parameters.
When you’re setting up the replication (don’t ask me why) and copying over the database to the second replication partner, be aware if you’re using wild cards you’re gonna get seriously bitten in the back.
Now, let’s look at the constellation.
mysql-nodes
As you can see on the graph above (hah, sometimes Visio is rather useful 😛 ), we do have two MySQL nodes, each serving as master (as in we’re doing “normal” master-master replication).
Here’s what we’re gonna do first:
Setup the user mysql_repl for mysql%.home.barfoo.org, granting REPLICATION SLAVE.
Setup the user mysql_slave for mysql1.home.barfoo.org and mysql2.home.barfoo.org, also granting REPLICATION SLAVE.
Afterwards, we’re gonna copy the mysql database (either via tar and scp, or just via rssh – which is rsync via ssh) to both nodes.
mysql1> GRANT REPLICATION SLAVE ON *.* TO
'mysql_slave'@'mysql1.home.barfoo.org' IDENTIFIED BY 'hans';
mysql1> GRANT REPLICATION SLAVE ON *.* TO
'mysql_slave'@'mysql2.home.barfoo.org' IDENTIFIED BY 'hans';
mysql1> GRANT REPLICATION SLAVE ON *.* TO
'mysql_repl'@'mysql%.home.barfoo.org' IDENTIFIED BY 'hans';
Now, then lets copy the database over to the second node, and start the MySQL daemon there too.
090216 9:30:01 [ERROR] Slave I/O thread: error connecting to master
'mysql_repl@mysql2.home.barfoo.org:3306': Error: 'Access denied for user
'mysql_repl'@'mysql2.home.barfoo.org' (using password: YES)' errno: 1045
retry-time: 60 retries: 86400
At this point, I don’t have the slightest clue, why MySQL is behaving this way. I’m completely out of ideas, as to why so I’m just gonna do it using what I described in turn #1.