>I'd try using mysqldump instead of copying the data if in doubt, or
>tar up the entire data dir, not just the DB subdirs.
And thanks for your reply! What I've done is:
1) Stopped the mysqld service on both master and slave.
2) completely deleted the contents of /var/lib/mysql/* on the slave
3) rsync'd the entire contents of /var/lib/mysql/ from the master to the same directory
on the slave
4) started up the service on both machines again
5) logged into the master and got the master info
6) put all that info that into the slave with the CHANGE MASTER TO command
7) start slave on the slave host
Now what happens is the same thing as before. Replication works for a little while. Then
it just quietly stops working and I have to issue STOP SLAVE and START SLAVE on the slave
host again in order for the slave to 'catch up' with the Read_Master_Log_Pos.
The only warnings/errors from the mysql logs that I see on the server are these:
110415 6:40:37 [Note] Slave SQL thread initialized, starting replication in log
'mysqlmaster.000013' at position 106, relay log './mysqld-relay-bin.000012' position: 4
110415 6:40:37 [ERROR] Slave I/O: error connecting to master
'repl@stripped:0' - retry-time: 3306 retries: 86400, Error_code: 2013
And these are the logs from the slave:
110415 10:40:58 [Note] Slave SQL thread initialized, starting replication in log
'mysqlmaster.000024' at position 479614, relay log './mysqld-relay-bin.000028' position:
110415 10:40:58 [Note] Slave I/O thread: connected to master
'repl@stripped:3306',replication started in log 'mysqlmaster.000024' at
110415 10:40:58 [Note] Event Scheduler: Loaded 0 events
110415 10:40:58 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.56' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server
(GPL) by Remi
110415 12:07:34 [Note] Error reading relay log event: slave SQL thread was killed
110415 12:07:34 [Note] Slave I/O thread killed while reading event
110415 12:07:34 [Note] Slave I/O thread exiting, read up to log 'mysqlmaster.000025',
110415 12:07:37 [Note] Slave SQL thread initialized, starting replication in log
'mysqlmaster.000025' at position 770474, relay log './mysqld-relay-bin.000032' position:
110415 12:07:37 [Note] Slave I/O thread: connected to master
'repl@stripped:3306',replication started in log 'mysqlmaster.000025' at
The last things you see here are me restarting slave replication on the slave host.
I would certainly appreciate any input I can get on why this is happening and how to
Thanks in advance!
----- Original Message -----
From: "a smith" <a.smith@stripped>
To: "Tim Dunphy" <bluethundr@stripped>
Sent: Wednesday, April 13, 2011 4:02:45 PM
Subject: Re: replication is not automatic
Quoting Tim Dunphy <bluethundr@stripped>:
> I have tarred up each database in /var/lib/mysql and scp'd it to the
> same location on the replication slave.
I'd try using mysqldump instead of copying the data if in doubt, or
tar up the entire data dir, not just the DB subdirs.