The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Socket Error for LAMP on Fedora 7 umja345 Linux 8 08-04-2008 02:08 AM
Setting up LAMP on FreeBSD iBot UNIX and Linux RSS News 0 07-31-2008 04:10 AM
directories failover prvnrk UNIX for Advanced & Expert Users 3 04-20-2008 03:46 PM
LAMP configuration izua UNIX for Dummies Questions & Answers 1 01-04-2007 09:26 AM
Upgrade PHP (LAMP) to support cURL. Anyone? Neo UNIX for Advanced & Expert Users 1 01-14-2005 01:54 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-07-2008
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 669
LAMP Server Failover

How does everyone else handle this?

My Setup:
Server A:
CentOS 5.x
10.0.0.1
Apache
MySQL Master

Server B:
CentOS 5.x
10.0.0.2
Apache
MySQL Slave

My Domains:
dom1.com A record: 10.0.0.1
A Record: 10.0.0.2
dom2.com A record: 10.0.0.1
A Record: 10.0.0.2
.
.
.

Since you CANNOT write to the slave, and have master updated, I have heard that 2 way replication will cause problems. I have setup all writes to goto master (write.dom1.com) and reads goto slave (read.dom1.com) via hosts file on each server.

If Server A goes down Server B detects this and rewrited hosts file to (writes.dom1.com) to its self so everything works great.

But if the script on Server B acts to quickly and takes over writes and Server A starts responding now the databases are not consistant anymore.

I guess I could have the script that changes the hosts file to reverse the MASTER and SLAVE computers and reestablish the replication but thats a PITA.

Is there a better way to handle this?

Keep in mind I only have 2 Dual P4 servers. These are just my personal websites and if they go down its not really a big deal but I still would like to know how everyone else would handle this if they were 'somewhat' missioan critical with limited resources.

Thanks...
  #2 (permalink)  
Old 08-08-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
Solutions like Linux Heartbeat can do the job, too.

Our setup involves 150+ RH boxes. This is not just LAMP webservers but all of the MySQL apps servers - we are on a SAN so failing over for several unrelated apps can be relegated to one server, since if all the servers servers failed at once we would be in disaster mode, failing to a remote site.

You must have an I/O problem with your setup - relegating reads ands writes to separate boxes.
  #3 (permalink)  
Old 08-08-2008
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 669
Quote:
Originally Posted by jim mcnamara View Post
Solutions like Linux Heartbeat can do the job, too.
Heartbeast is one optionj I did find but im limited to these 2 servers.

Quote:
Originally Posted by jim mcnamara View Post
You must have an I/O problem with your setup - relegating reads ands writes to separate boxes.
The system I have is working OK, im just trying to find if there is a better solution for the MySQL redundancy than having scripts rewriting hosts files and switching MASTER and SLAVE MySQL servers. It just seem there has to be a better solution.
  #4 (permalink)  
Old 08-08-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
For what you want you need a disk server/linux cluster box of some kind, maybe with high availability raid.

Then, allow both servers to process read & write. When one fails the other is there by default. The disks are already there, mounted, served out by another box, so they do not have a failover problem.

This also solves the 'out of sync' problem.

This is almost exactly what everybody with a SAN is doing right now. Except for orders of magnitude lower cost. Our SAN costs us $US40 per MB; a PC with SATA can have a MB of raid for 2 orders of magnitude less. Circa $US1.00 - $US2.00 per MB.
Sponsored Links
Closed Thread

Bookmarks

Tags
apache, failover, mysql, replication

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:22 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0