In Cloud


Objective

Load balancing Word press http traffic using ha-proxy

Prerequisites

  • Two or more word press configured instances
  • Word press db need to be kept in sync among all the instances.
  • HA-Proxy installed instance.

Steps

  1. To install and configure WordPress in an instance,click here.
    Follow the above link to setup multiple similar instances of word press
  2. To install and configure ha-proxy in an instance,click here.
  3. After successfull installation of ha-proxy,edit the config file in /etc/haproxy/haproxy.cfg

 

Let’s Assume:

WordPress_Instance_A_IP  = 10.11.12.100 webserver port :80

WordPress_Instance_B_IP   = 10.11.12.101 webserver port :80

HA-Proxy_Instance_PublicIP  =  x.x.x.x    port:80

Update the below entry in haproxy.cfg

listen application 0.0.0.0:80

balance roundrobin

server A 10.11.12.100:80 weight 1 maxconn 100 check

server B 10.11.12.101:80 weight 1 maxconn 100 check

To tune ha-proxy  for custom settings and port refer  http://haproxy.1wt.eu/download/1.2/doc/haproxy-en.txt

Leave a Comment

Start typing and press Enter to search