On 7 Apr 2008, at 11:09, Kaushal Shriyan wrote:
> is this a correct documentation
> http://howtoforge.com/mysql_master_master_replication for Master Slave
> Replication
Well, it's for master-master, not master-slave. Also see
http://www.onlamp.com/pub/a/onlamp/2006/04/20/advanced-mysql-replication.html
> My requirement was if the Master goes down, the slave should take
> care and
> act as Master. the Master should acts as slave and reversing of this
> role.
> is this possible
Yes. With master-master, neither machine is considered a slave
(actually they are both slaves too). However, there are good practical
reasons to treat one as a master, for example it may be on superior
hardware, or you need to ensure transactional integrity which you
can't do spread across servers.
When you have master-master up and running, you need to deal with
failover at the application level - so your app needs to know about
both servers and know to try the other one if its default connection
fails.
> Also how can i test this setup from the MySQL client. Any test cases
> available would be of great help to test out this MySQL Database
> Master and
> Slave Server
It's easy to test - log into each instance. Do an insert on one and it
should be available pretty much immediately from the other, then test
it in the other direction. Then try the same thing for deletes. After
that, you just need to monitor the 'seconds_behind_master' field in
the output from "show slave status" on each.
Most guides neglect to tell you about:
mysqldump -u root -p --opt --quick --single-transaction --master-data
mydb > mydb.sql
If you're using InnoDB everywhere, this will get you a data dump in a
consistent state without having to lock tables or otherwise block
access to your DB while you're setting up the replication.
Marcus
--
Marcus Bointon
Synchromedia Limited: Creators of http://www.smartmessages.net/
UK resellers of info@hand CRM solutions
marcus@stripped | http://www.synchromedia.co.uk/
Attachment: [application/pkcs7-signature] smime.p7s