Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

first of all sorry If I don't write properly, I have got a bad english.

Well I have got these servers:

enter image description here

The server number 1 has got so much work so I want to setup a cluster system joining 4 virtual machines.

I don't know how to start, at this moment I have got servers 3, 4, 5 and 6 only with the OS.

Which cluster software could I use?

Can I install apache and mysql normally on the VMs? or I must install a specific version of these software?

share|improve this question
add comment

migrated from stackoverflow.com Aug 9 '12 at 12:07

This question came from our site for professional and enthusiast programmers.

4 Answers

I would suggest something as simple as Percona XtraDB Cluster for MySQL. It's an optimized version of MySQL, free still, with clustering in mind.

For Apache, I would just rsync the httpd.conf or whichever config files are active to your alternate hosts.

Are you trying to go for a load-balanced effect or active/passive standby?

share|improve this answer
add comment

So basically you need to use some tools to ease your setup for apache you could have a look at peacemaker or Heartbeat-Ha, for mysql i am not an expert but i think it can be done either with peacemaker or via mysql it self , have look here : http://www.mysql.com/products/cluster/

Goodluck

share|improve this answer
add comment

I think you need to ask yourself a few more questions in order to determine exactly the setup you need or want. There are a large number of possible configurations that will depend on your application and requirements:

  • Do you want a load balanced system, a high availability (HA) system, or both? From your question I would guess you are looking for just load balancing to reduce the load on server 1 and distribute it to servers 3-6. A simple load balanced system will be much easier to setup than an HA one.
  • What is your current load distribution on server 1? Are you CPU limited, disk IO limited, memory limited, something else? For example, if you have Apache/MySQL configured poorly on server 1 then having 4 misconfigured servers won't help that much. If you are IO limited then splitting a single server into 4 VMs may not help that much either.
  • Is Apache, MySQL, or both consuming the majority of resources? if MySQL is taking 90% then load balancing Apache may not be worth it (or vice versa).
  • Is your application easily load balanced? If it isn't this may limit what you can easily do.
  • Do you have any caching layers or can you add any? This includes things like Squid, MemCached, Varnish, etc.... Depending on your application you may be able to get a huge load reduction on the Apache/MySQL side (for example, in my case 80-90% of page views use the Squid cache which is a potential 5-10x reduction in load).

Without knowing more about your specific situation I would suggest something like:

  • Server 3: Squid/Varnish cache and main entry point (assuming your application is cacheable at all)
  • Server 1: MySQL Master (all db writes)
  • Server 5: MySQL Slave (all db reads)
  • Server 6: Apache
  • Server 4: Apache
share|improve this answer
add comment

Pacemaker for clustering database

Keepalive or nginx (proxy) for load balance apache with type sharing/failedover

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.