LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: LVS-DR where Directors are also Realservers

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: LVS-DR where Directors are also Realservers
From: Shaun McCullagh <shaun.mccullagh@xxxxx>
Date: Wed, 07 Dec 2005 16:13:38 +0100
Hi,

Some time ago Ken Price mailed a nice solution describing how to setup a 2 node Keepalived Apache cluster (well it was MySQL really) on two PCs connected to the same network.

I'm trying to do the same thing but I cannot figure out what to put in
/etc/keepalived/ip_localhost

I have tried

#!/bin/bash
if [ $1 = "del" ] ; then
       ip addr del 192.168.0.54/24 dev lo
fi

if [ $1 = "add" ] ; then
       ip addr add 192.168.0.54/24 dev lo
fi

But the problem is whenever 192.168.0.54/24 is added to the loopback interface on either machine eth0 stops responding to all arp requests.

Could somebody explain the correct way to add 192.168.0.54/24 so that the host not repsond to ARP requests but allowing eth0 to respond to arp requests?

Many Thanks

Shaun
======================================================================
! 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
               }
       }
}
}

--
Shaun McCullagh
Senior System Engineer

XB
Televisieweg 2
1322 AC ALMERE
T +31 (0)36 546 2459
F +31 (0)36 546 2220
M +31 (0)614 800 421
U www.xb.nl



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