On Wed, Mar 20, 2002 at 04:48:11PM +0100, Danny Kruitbosch wrote: > Hi, > > I'd like to setup two database servers in a dual master/slave > config. So both machines will be each others master and slave. Only > one server will be queried (selects, inserts/updates and > deletes). In case of failure of one master a network switch will > handle failover. The failed machine should then (manually) reboot > and the database should start to catch up with be new master.
Makes sense. > - Are the any of you that have experience with this kind of setup? Yes. > How did you do it? Simply configured both servers to slave off of each other. All the fun comes in making absolutely sure that updates can't go to the non-master when the real master is running. If you have auto_increment ids, that can be a real problem. How are you planning to do it at the switch to avoid race conditions? There is a hosting company which offers redundant MySQL service via a configuration like this (thanks to a hardware load-balancer). It works pretty well once we got it all working right. I've yet to find a hardware-based load balancer that will use the algorithm I'd REALLY like in this situation. I need to bug the guys at Foundry Networks about this. What I want is a load-balancer where you can say: (1) Send all connections to host A. It is master. (2) If host A is down, send all connections to host B. (3) Even if host A comes back up, keep sending connections to B. (4) Only when B dies should A become the master again. The key realization is that database connections (unlike most HTTP) are persistent, so if you're not careful you can end up with applications that have connections to BOTH servers and they believe they're connected to "the" master. Most load-balancers have a "master/slave" configuration, but it always gives preference to a particular host. IF that host comes back up, it becomes master again. That's where you can get bitten hard. This can probably be solved with LVS, but I really want a hardware solution. Jeremy -- Jeremy D. Zawodny, <[EMAIL PROTECTED]> Technical Yahoo - Yahoo Finance Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 685-5936 MySQL 3.23.47-max: up 41 days, processed 1,231,810,451 queries (345/sec. avg) --------------------------------------------------------------------- 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