HAProxy Config for Load balancing the servers

by Balasundaram

I tried using HAPRoxy for load balancing between the app servers as well as the database slaves.

The generic config for the HAPRoxy is

global
pidfile /tmp/haproxy-queue.pid

defaults
mode tcp
balance roundrobin
option httpclose
option forwardfor

listen redis 0.0.0.0:8011
server server5 127.0.0.1:6379 maxconn 1 check
server server6 127.0.0.1:6380 maxconn 1 check

 

For getting realtime statistics

the below config is used and the port can be used to get the statistics

listen stats :1936
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri /

Advertisements