Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2007
    Location
    India
    Posts
    431

    HA Proxy Cluster - How to?

    Folks, for my own learning, I want to learn how to configure and use HA Proxy. I want a simple setup like this:

    One load balancer running HA Proxy and behind it are two webservers - A and B -both running Apache, Pressflow and Wordpress on each along with MariaDB databases on each.

    What is the easiest way of setting this up as a load balanced failover cluster?

    Also I have the following questions:

    1. How will the databases and the contents on the servers be synchronized? - For e.g. if one adds a post with an attachment in A, how will server B pick it up? Will it be automatic?

    2. Any guides to configure this? I want to learn how to do this.

    3. What is the best OS to do this? Debian, Centos or FreeBSD?

    Experts please help.

    Thanks and God bless
    Michael.
    "For I know the plans I have for you" declares our Lord Jesus Christ, "they are plans to prosper you, to give you a hope and a future and not to destroy you." - Jeremiah 29:11

  2. #2
    Join Date
    Mar 2009
    Location
    Austin, TX
    Posts
    935
    I've done couple projects involved what you wanted to do. It is possible with little time researching and testing. To answer your questions...

    1. How will the databases and the contents on the servers be synchronized? - For e.g. if one adds a post with an attachment in A, how will server B pick it up? Will it be automatic?
    I use Unison minutely and prefer a 'source'. Same can be achived with rsync. If it's not suitable you can always write compilable binaries to be triggered based. DB can be done with (MySQL) replication. Please take note it is not recommended running Replication over geographical area. When I did it, both backend servers are within same datacenter with the purpose of more leaning toward load balancer type setup and some resilience. The nice thing about HAProxy is you can do 'weights' so backend server don't really need to match in terms of processing power.

    2. Any guides to configure this? I want to learn how to do this.
    Google HAProxy tutorials. You can figure things out pretty easily. HAProxy syntax is EASIER than Varnish VCL (not like a language of its own). Just make sure it's set up to properly forward source IP or else you'll log transaction IPs all from your HAProxy server(s).

    3. What is the best OS to do this? Debian, Centos or FreeBSD?
    Some distro still uses version 1.3. There are some syntax changes between 1.3 and 1.4. I've used on both Debian and CentOS, there is no difference. Honestly, the OS selection really comes down to your personal preference.

    Good lucks!
    SysAdmin.xyz
    Having severs with customer data on it without proper monitoring is like having one night stand without using protections - eventually, there will be an 'oh s**t!' moment.

  3. #3
    Join Date
    Oct 2007
    Location
    India
    Posts
    431
    Sorry for my very late reply. I have been having some personal problems and hence could not find the time to do this yet.

    Will try it out shortly and let you know.

    Thanks again for all the help.

    Michael

    Quote Originally Posted by quad3datwork View Post
    I've done couple projects involved what you wanted to do. It is possible with little time researching and testing. To answer your questions...

    I use Unison minutely and prefer a 'source'. Same can be achived with rsync. If it's not suitable you can always write compilable binaries to be triggered based. DB can be done with (MySQL) replication. Please take note it is not recommended running Replication over geographical area. When I did it, both backend servers are within same datacenter with the purpose of more leaning toward load balancer type setup and some resilience. The nice thing about HAProxy is you can do 'weights' so backend server don't really need to match in terms of processing power.

    Google HAProxy tutorials. You can figure things out pretty easily. HAProxy syntax is EASIER than Varnish VCL (not like a language of its own). Just make sure it's set up to properly forward source IP or else you'll log transaction IPs all from your HAProxy server(s).

    Some distro still uses version 1.3. There are some syntax changes between 1.3 and 1.4. I've used on both Debian and CentOS, there is no difference. Honestly, the OS selection really comes down to your personal preference.

    Good lucks!
    "For I know the plans I have for you" declares our Lord Jesus Christ, "they are plans to prosper you, to give you a hope and a future and not to destroy you." - Jeremiah 29:11

Similar Threads

  1. Replies: 14
    Last Post: 11-29-2011, 02:27 PM
  2. Replies: 0
    Last Post: 05-31-2008, 08:25 PM
  3. Replies: 1
    Last Post: 05-14-2008, 01:38 PM
  4. Replies: 0
    Last Post: 04-24-2008, 04:53 PM
  5. Replies: 1
    Last Post: 07-22-2006, 02:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •