Skip to main content

Posts

Showing posts from April, 2017

Configuring Failover and Load Balancing with HAproxy using Keepalived

Network Scenario: LB1: 192.168.10.10 LB2: 192.168.10.11 Virtual IP: 192.168.10.12 APP_Server1: 192.168.10.20 APP_Server2: 192.168.10.21 Load Balancing: STEP 1 - Install HAProxy: HAProxy package is available under default yum repository for CentOS, Redhat systems. Use the following yum package manager command to install HAProxy on your system.   # yum install haproxy   STEP 2 - Configure HAProxy : Update your HAProxy configuration file /etc/haproxy/haproxy.cfg as per your requirement, You may also use below given configuration file as an example of setup and modify it. Keep the config file same of both servers i.e. LB1 and LB2.   ----------------------------------------------------------------------------------------------------------- global         log /dev/log    local0         log /dev/log    local1 notice     ...

HAProxy automatic failover

HAProxy automatic failover HAProxy is a TCP load balancing tool with some useful features, including ACLs and SSL termination support. I’ve been using it for a while now on a number of load-balanced sites where scalability is key. What I haven’t yet looked at, however, is automated failover capabilities. My aims were simple: If a server fails, stop using it. If said server starts working again (i.e. because the problem is fixed) start using it again. If all servers in the load balancer pool fail, serve a temporary static page from another location. But first: Some basic HAProxy concepts HAProxy as a load balancer is fairly simple, and works on the basis of defined frontends and backends. A frontend is simply an IP and port declaration that you want the load balancer to listen on. A backend is the set of servers that requests to a frontend are sent to. Your HAProxy configuration lists the frontends and their respective backends, as well as the load balancing algorithm ...