On Thursday 13 November 2003 10.41, nm wrote:
Hi there
I have a question regarding replication.
This is the situation:
Mysql-Max4.0.16
192.168.0.10 master
192.168.0.11 slave
I would like to use the slave as the backup server
and use it in case the master goes down for any reason.
I'm looking for a safe method to re-update the master when we take it up
again.
You need a way to resume operation in case your master dies, correct?
I was considering a simple dump of the database on slave,
when I have to reconnect the master server.
You should regularly do backups from your slave.
Sounds like you're a slave short, what if your master burns up in flames while
you are doing the dump from your slave?
I would:
1. disconnect the slave
Since the master just went down your slave would already be disconnected.
2. create a dump file form salve
Consider which of your hosts have the most correct data after a crash.
3. put the dump on the master
Put an exact copy of the dump on all nodes (master(s) and slave(s))
4. reconnect the master and slave
also clear the master bin-logs from the master, and the index files.
do the same for the slaves:
clear out following files from your new slave(s):
master.info
all relay-log files (index, *.bin)
This way the master will start at bin-log 001 at position 4.
And the slave(s) will start reading from the 'first' position from the master.
I know, position 4 == first looks weird but that's just the way it is.
Questions are..
a. I use innodb tables. Any problems to nofify?
I have so far recovered ok with innodb tables, anyone else are welcome to
comment.
b. Are auto_increment values correct/safe after such operations. I guess so
but I'm not 100% sure
if you start over with the exact same snapshot on all nodes you should be ok.
c. Do you have comments and suggestions regarding 2-ways replications
tricky... as Jeremy Zawodny said in a previous thread: it's a race condition
with primary keys etc.
http://www.mysql.com/doc/en/Replication_FAQ.html
These are just some primary hints, corrections are welcome.
Mikael
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]