473,419 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 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 3229

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jason McCormick | last post by:
Hello all, I was wondering if someone could shed some light on this problem I'm having. I have 3 slave MySQL servers replication from a master machine. The master machine is running only MySQL...
0
by: I.P. | last post by:
Hi, it's my story. I have two 4.0.14 mysql server on one machine with win XP Professional polish version. First acts as master: on port 3300 Second acts as slave: on port 3301 below my...
0
by: I.P. | last post by:
No one has replied to my post. ----- Original Message ----- From: "I.P." <jancio_wodnik@wp.pl> To: <mysql@lists.mysql.com> Sent: Monday, August 18, 2003 1:01 PM Subject: mysql 4.0.14 +...
0
by: I.P. | last post by:
------=_NextPart_000_03FF_01C368A4.75720DC0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Hi, it's my story. I have two 4.0.14 mysql server on...
3
by: Sander Smeenk | last post by:
Hello! I'm trying to set up replication between two servers and even though I did everything according to the documentation, the slave keeps failing to connect to the master like this: |...
0
by: Mike | last post by:
Hello, We are using mysql v4.0.24 on Linux machines. I'm trying to set up replication with a master and only one slave database. The syncronization seems to work well, the relay file on slave...
3
by: muldoon | last post by:
I'm having quite a fuss with my two MySQL DB servers lately. I'm trying to establish replication between a MySQL 4.0.20 server (master) and a MySQL 4.1.11 server (slave). From what I read,...
2
by: David Parker | last post by:
Hi. I'm new to postgresql in general, and have been tasked with coming up with a replication solution for our postgresql based application. Assuming we don't bite off trying to roll our own...
3
by: Juan Antonio Villa | last post by:
Hello, I'm having a problem replicating a simple database using the binary log replication, here is the problem: When the master sends an update to the slave, an example update reads as follows:...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.