472,119 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

replication error after promoting slave to master

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
0 3132

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jason McCormick | last post: by
reply views Thread by I.P. | last post: by
3 posts views Thread by muldoon | last post: by
2 posts views Thread by David Parker | last post: by
3 posts views Thread by Juan Antonio Villa | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.