Solved

Apache + MySql load balancing

Posted on 2011-03-18
2
489 Views
Last Modified: 2012-06-27
Good Morning,

I am currently looking into viable options for creating a much better network setup (HA) for my apache/mysql servers.

The configuration i am looking into is  two Apache servers and two MySql servers running behind a load balancer

I am just a bit confused on the best methods for keeping both the MySql databases and the Apache servers in sync with each other. I would need both databases to be identical all the time as well as the Apache servers.

For the Apache servers I was considering setting up a Git server to control the versions on each servers as well as pushing updates to each server but I am not sure if this would be the best method.

Any suggestions or help would be greatly appreciated.

Thanks.
0
Comment
Question by:Defunct-Exodus
2 Comments
 
LVL 1

Expert Comment

by:crazyn3wf
ID: 35167723
0
 
LVL 2

Accepted Solution

by:
matstein earned 500 total points
ID: 35975744
Recently developed a similar system for MySQL. Look into replication if you are only considering two machines to be synced. Each machine should be set up to be the Master AND slave of the other machine. We ran those machines in a production environment for months with no problems.

Another alternative would be a MySQL cluster but only do this if you are thinking of implementing more than two SQL servers otherwise it is overkill.

On the Apache side it depends what kind of content you are looking to synch. The ideal situation in my opinion would be to migrate file data to the database and let replication handle the synch issues. This may require some porting but it will save you a huge headache in the long run. E.G move files/pics etc. to the SQL database and have both sites access them from there.

Other considerations: Replication also means you have redundancy so consider implementing a switchover mechanism on the Apache side should one database fail. Also note should a DB go down it will automatically bring itself back up to speed with the other database once it comes up again.

Potential Hazards: Replication is broken when a database attempts to run a command that it does not have privileges for create a replication user for each database and grant sufficient privileges to each.
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question