Solved

Apache + MySql load balancing

Posted on 2011-03-18
2
487 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

803 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