LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: LVS-DR where Directors are also Realservers (WORKING)

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx, keepalived-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: Re: LVS-DR where Directors are also Realservers (WORKING)
From: ken <lists@xxxxxxxxxxxx>
Date: Tue, 26 Aug 2003 11:07:40 -0400
I simply want to throw a quick thanks to everyone involved with this thread.  
I've got it working using HTTP as my test service.  I'm now prepping the 
databases for phase2 testing.  The last few emails on the LVS list discussing 
fwmarks and alternative routing will give more than enough ammo should my 
current method fail me.  Many thanks to Joe and Horms!!!

Since I can't imagine I'm the only one out there with this need, here's the 
final Keepalived config.

GOAL:  To provide [near] transparent database failover for HA at both the 
database-instance level, as well as the server IP level using VRRP.  I use an 
external script to add/del the VIP::192.168.0.54 from localhost.  Remember, I'm 
using HTTP for ease testing and explanation.  This will go live with a RDBMS 
configured with MASTER/MASTER replication ... that could be MySQL 4.0.13+, DB2, 
Oracle8/9i, etc.  And before you start screaming, yes MySQL can be configured 
in MASTER/MASTER.  It's simply a bastardization of the MASTER/SLAVE setup. 
(Hint: A->B->C->A)  If you look closely at this config, only one server is 
active at a time to avoid database sequencing conflicts during replication.
#
#Primary Director/Server:  /etc/keepalived/keepalived.conf
#
! KEEPALIVED CONFIGURATION FILE (snippet)
vrrp_sync_group VG1 { 
   group {
      ATT_DEVLAN
   }
   notify_master "/etc/keepalived/ip_localhost del"
   notify_backup "/etc/keepalived/ip_localhost add"
   notify_fault "/etc/keepalived/ip_localhost add"
}
vrrp_instance ATT_DEVLAN { 
        state MASTER 
        interface eth0
        lvs_sync_daemon_inteface eth0
        virtual_router_id 5
        priority 150
        advert_int 1 
        smtp_alert 
        authentication { 
                auth_type PASS
                auth_pass test
        } 
        virtual_ipaddress { 
                192.168.0.54/24
        } 
} 
virtual_server 192.168.0.54 80  {
        delay_loop 5
        lb_algo rr
        lb_kind DR
        protocol TCP
        sorry_server 192.168.0.97 80
        real_server 192.168.0.96 80 {
                weight 1
                inhibit_on_failure
                TCP_CHECK {
                        connect_port 80
                        connect_timeout 5
                }
        }
}
#
#Secondary Director/Server:  /etc/keepalived/keepalived.conf
#
! KEEPALIVED CONFIGURATION FILE (snippet)
vrrp_sync_group VG1 { 
   group {
      ATT_DEVLAN
   }
   notify_master "/etc/keepalived/ip_localhost del"
   notify_backup "/etc/keepalived/ip_localhost add"
   notify_fault "/etc/keepalived/ip_localhost add"
}
vrrp_instance ATT_DEVLAN { 
        state BACKUP
        interface eth0
        lvs_sync_daemon_inteface eth0
        virtual_router_id 5
        priority 100
        advert_int 1 
        smtp_alert 
        authentication { 
                auth_type PASS
                auth_pass test
        } 
        virtual_ipaddress { 
                192.168.0.54/24
        } 
} 
virtual_server 192.168.0.54 80  {
        delay_loop 5
        lb_algo rr
        lb_kind DR
        protocol TCP
        sorry_server 192.168.0.96 80
        real_server 192.168.0.97 80 {
                weight 1
                inhibit_on_failure
                TCP_CHECK {
                        connect_port 80
                        connect_timeout 5
                }
        }
}

Again, thanks to everyone who helped!

-Ken

<Prev in Thread] Current Thread [Next in Thread>