>From what you are writing here it looks as though you are porting a database
to the slave that has already been bin logging.
If your master has been logging the database in question, and you are
copying that database over to the slave, then of course when it reads the
bin logs from the master the data is already in there. When you port the
database into the slave it should be a copy of the master database just at
the instance you started the bin logging.
My Slave-Master Setup
( at this time if you want to start over, stop the slave and the master)
1. Dump master database ( perhaps you should lock all the tables from
writing at this time ) Or stop the master server and tar/gzip the master
database directory and send it to the slave server to use later
2. Set master settings( if possible at this time, remove the bin logs and
index file from master HOSTNAME-bin.### and HOSTNAME-bin.index)
3. Create database on slave and load it with the master dump ( remove the
master.info if starting over )
4. Set slave settings
5. Restart the master server so it starts the fresh bin logging ( unlock
your tables if you locked them before )
6. Restart the slave server so it starts its replication process
You could combine a couple of the steps 1-3 by using this on the slave db
mysqladmin -p create databasename
mysqldump -p -h0.0.0.0 -c -q themasterdb | mysql -p databasename
^^^
host ip address
this will dump right into the database on the slave ( again you might want
to lock the master from writing at this time )
don't know, this might be your problem
OR
you could lock the master from writing, note the position and bin file it is
on, copy the master as is, send it to the slave and use the MASTER CHANGE
command to set up the binlog and position on the slave, then start up the
slave and unlock the master of course
hmm what else
GRANT FILE on *.* to replicant@'slaveIP' identified by 'passwd';
This must be FILE and the *.* must be *.* not database.* ( FILE is a
global grant option and is not available to database, table, column
permissions)
-----Original Message-----
From: John Hunter [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 11:23 AM
To: [EMAIL PROTECTED]
Cc: MySQL mailing list
Subject: Re: replication through port forwarded firewall
>>>>> "Van" == Van <[EMAIL PROTECTED]> writes:
Van> This means you need to re-initialize the slave; i.e. stop the
Van> master and slave; copy the data dir to the slave; start the
Van> slave (ensure the perms on the slave are correct first);
Van> start the master. If the error above had been
Van> connectivity-related you'd have received different ERROR
Van> messages in the log.
Ok, thanks for all you detailed help. Unfortunately, I am still
having the same problem, so I want to provide a few more details.
1) I shut down the master and shut down the slave with
'/etc/init.d/mysqld stop' on the master and slave
2) I changed all the ownership on the master to be mysql.mysql with
chown -R /path/to/data/dir
3) I cd'd into the slave data dir. This is the dir that has
subdirs for the various mysql databases, which contain the *.MYD,
*.MYI, *.frm files. I updated the slave data dir with
rsync -avz --delete -e ssh root@nitace:/path/to/data/dir/ .
This also copied all the mother-001.bin, mother-002.bin etc... files
from the data dir of the master
4) I restarted the slave and got saw the message in the log that the
slave could not connect to the master. This was expected, because
you said to restart the slave before the master (which I found
confusing because the manual section 'Replication HOWTO' says to
restart the master first
5) I restarted the master
6) After the 60 sec wait on the slave, it reattempted a connect to the
master, which was by then alive, and I got the same error message
(posted below) about the duplicate insertion from mother-002.bin.
Although this is a binary file, I did 'less' on it and it has text
that you can read. The first command in that file is
INSERT INTO multifile VALUES (
2472160,
'2001-3-9',
'101.bmp',
2
Which is the line that the slave is complaining about.
When I sync my data dirs, the slave dir also has the mother-bin.*
files on it and it gets the mysql user dir from the master. Is this
correct?
Stumped.
Thanks,
John Hunter
Master mysql version: 3.23.37
Slave mysql version: 3.23.36
Error message:
020315 9:30:52 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
020315 9:30:52 Slave: error running query 'INSERT INTO multifile VALUES (
2472160,
'2001-3-9',
'101.bmp',
2
)'
020315 9:30:52 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
020315 9:30:52 Slave thread exiting, replication stopped in log
'mother-bin.002' at position 73
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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 <mysql-unsubscribe-##L=##[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php