By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,610 Members | 1,989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,610 IT Pros & Developers. It's quick & easy.

replication error after promoting slave to master

P: n/a
After a failure, we promoted a slave to master. This included renaming the
server to the old master's name and ip address, but leaving the server id
alone.

The new master works fine.

We repaired the old server, gave it a different name and ip address but
leaving the server id the same.

I get the following error on the slave:

051101 08:01:39 mysqld started
051101 8:01:40 InnoDB: Started; log sequence number 0 1920097
/usr/libexec/mysqld: ready for connections.
Version: '4.1.12' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source
distribution
051101 8:01:40 [Note] Slave SQL thread initialized, starting replication
in log 'FIRST' at position 0, relay log './battleship-relay-bin.000002'
position: 4
051101 8:01:40 [Note] Slave I/O thread: connected to master
'slaveuser@firstrate:3306', replication started in log 'FIRST' at position
4
051101 8:01:40 [ERROR] The slave I/O thread stops because master and slave
have equal MySQL server ids; these ids must be different for replication to
work (or the --replicate-same-server-id option must be used on slave but
this does not always make sense; please check the manual before using it).
051101 8:01:40 [ERROR] Slave I/O thread exiting, read up to log 'FIRST',
position 4
-----------------------------------------------
my.cnf on master
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
server-id=1
#master-host=firstrate
#master-user=slaveuser
#master-password=****
log-bin=/var/lib/mysql/binlog
max_connections=500

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

-----------------------------------------------------------------------
my.conf on slave

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
server-id=2
master-host=firstrate
master-user=slaveuser
master-password=****
#log-bin=/var/lib/mysql/binlog
max_connections=500

[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
-----------------------------------------------------------
physical setup
Old setup:
MySQL Master
server Id = 2
Hostname= firstrate
ip= 192.168.10.254
physical machine #2

MySQL slave
server ID = 1
Hostname = oldfirstrate
ip = 192.168.10.253
physical machine #1

New setup
MySQL Master
server ID = 1
Hostname = firstrate
ip= 192.168.10.254
physical machine #1

MySQL slave
server ID = 2
Hostname = battleship
ip = 192.168.10.253
physical machine #2

I suspect that somewhere internally MySQL stores Hostname and ID. When we
changed masters, this data was no longer correct.

I've tried changing server ids and re-installing mysql on the slave. We've
tried the Change Master command. We've removed the master.info file, as
well.

Any ideas on how we fix it?
Visit www.sexystuff.net/ssis.html Adult Friendly Webhosting done cheap!
Nov 3 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.