Solved

Apache + MySql load balancing

Posted on 2011-03-18
2
485 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
Comment Utility
0
 
LVL 2

Accepted Solution

by:
matstein earned 500 total points
Comment Utility
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now