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?


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?

| improve this answer | |

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/


| improve this answer | |

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
| improve this answer | |

Pacemaker for clustering database

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy