John Hunter wrote: > > I have set up the master and slave now and am getting a problem. When > the slave tries to connect, it appears to be attempting to enter a > value that is already in one of my database tables, and gives the > error: > > [root@newman mysql]# tail /var/log/mysqld.log > 020314 19:37:28 Slave: connected to master '[EMAIL PROTECTED]:3306', replication >started in log 'FIRST' at position 4 > ERROR: 1062 Duplicate entry '2472160-101.bmp-2' for key 1 > 020314 19:37:28 Slave: error running query 'INSERT INTO multifile VALUES ( > 2472160, > '2001-3-9', > '101.bmp', > 2 > )' > 020314 19:37:28 Error running query, slave aborted. Fix the problem, and re-start >the slave thread with "mysqladmin start-slave". We stopped at log 'mother-bin.002' >position 73 > 020314 19:37:28 Slave thread exiting, replication stopped in log 'mother-bin.002' >at position 73
This means you need to re-initialize the slave; i.e. stop the master and slave; copy the data dir to the slave; start the slave (ensure the perms on the slave are correct first); start the master. If the error above had been connectivity-related you'd have received different ERROR messages in the log. > > I rsync'd the data dirs on master and slave and tried to follow the > directions in the mysql manual on replication. The only thing that > was different for me was that on the master the owners of some of the > subdirs and files in the mysql data dir are root.root and I needed to > change these to mysql.mysql or I got an error about not being able to > read the *.frm files on entering the slave. Very big difference depending on timing. If you started the slave and the master began replicating before the permissions allowed a write on the slave you're going to have out-of-synch data. Correct the perms while both servers are stopped. > > When I go ahead and connect to the slave mysql server, I get the > version number of the slave and not the master, and when I make You should receive the version number of the server you connected to with the mysql -h (which server) command. I'd think you'd want them to be identical in a replication situation, regardless. > changes to update the master, I do not see them on the slave. So it > appears that it is simply reading the data files that I transferred > over before restarting master and slave. Because as soon as the first record update on the master attempted to replicate to the slave the data was read-only so it couldn't have changed. Doesn't look like a port-forwarding problem, although there might still be one, but rather a replication problem. Regards, Van -- ================================================================= Linux rocks!!! http://www.dedserius.com/ ================================================================= --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php