Hi folks,

I am trying to setup a two box lvs as described in section
9.3 of the howto (the version with a single nic and 2 marks).
For testing I have setup a telnet service.

The first telnet session picks up the master, the second
telnet is sent to the backup, as expected. Problem: If the
telnet session to the backup is terminated, then the backup
gets horrible slow. The master is as fast as usual (as it
seems).

I got the same problem for using Apache, so I would assume
that telnet is innocent.


Attached you can find the keepalived.conf files and the
script to run iptables. Here is the usual data

VIP=172.19.96.33
RIP1=172.19.96.19       ("node08")
RIP2=172.19.96.21       ("node09")
MAC1=00:30:48:9b:42:c2
MAC2=00:30:48:99:b8:72

sysctl.conf says

        net.ipv4.conf.eth0.arp_announce = 2
        net.ipv4.conf.eth1.arp_announce = 2
        net.ipv4.conf.all.arp_announce  = 2
        net.ipv4.conf.eth0.arp_ignore   = 1
        net.ipv4.conf.eth1.arp_ignore   = 1
        net.ipv4.conf.all.arp_ignore    = 1

There _is_ a second interface, but this is supposed to be
the connection to the database server only.

Any helpful comment would be highly appreciated.


Regards

Harri
#!/bin/bash

export PATH=/usr/sbin:/usr/bin:/sbin:/bin

IPTABLES=/sbin/iptables

MAC_NODE08=00:30:48:9b:42:c2
MAC_NODE09=00:30:48:99:b8:72
MARK08=6
MARK09=7
VIP=172.19.96.33
VPORT=80

case `uname -n` in
    node08|node08.*)
        RMAC=${MAC_NODE09}
        MARK=${MARK08}
        ;;
    node09|node09.*)
        RMAC=${MAC_NODE08}
        MARK=${MARK09}
        ;;
    *)
        exec 2>&1
        echo "this script is not supposed to be run on host `uname -n`"
        exit 1
        ;;
esac

$IPTABLES -t mangle -F
$IPTABLES -t mangle -I PREROUTING -d $VIP -p tcp -m tcp --dport $VPORT -m mac 
\! --mac-source $RMAC -j MARK --set-mark 0x${MARK} 
# Configuration File for Keepalived

# Global Configuration
global_defs {
  notification_email {
    harald.dun...@aixigo.de
  }
  notification_email_from keepali...@aixigo.de
  smtp_server mailhost
  smtp_connect_timeout 30
  router_id LVS_MASTER          # string identifying the machine
}

# describe virtual service ip
vrrp_instance VI_1 {
  # initial state
  state MASTER
  interface eth0
  # arbitary unique number 0..255
  # used to differentiate multiple instances of vrrpd
  virtual_router_id 1
  # for electing MASTER, highest priority wins.
  # to be MASTER, make 50 more than other machines.
  priority 100
  authentication {
    auth_type PASS
    auth_pass dwoeiodmewfivlqoijwmcldm93492oeiwwnn
  }
  virtual_ipaddress {
    172.19.96.33/23
  }
}

# describe virtual telnet server
virtual_server fwmark 6 {
  delay_loop 15
  lb_algo rr
  lb_kind DR
  protocol TCP
#  persistence_timeout 5

  real_server 172.19.96.19 23 {
    TCP_CHECK {
      connect_timeout 5
    }
  }
  real_server 172.19.96.21 23 {
    TCP_CHECK {
      connect_timeout 5
    }
  }
}
--- keepalived.conf.node08	2010-03-25 17:00:17.000000000 +0100
+++ keepalived.conf.node09	2010-03-25 17:06:37.000000000 +0100
@@ -8,20 +8,20 @@
   notification_email_from keepali...@aixigo.de
   smtp_server mailhost
   smtp_connect_timeout 30
-  router_id LVS_MASTER		# string identifying the machine
+  router_id LVS_BACKUP		# string identifying the machine
 }
 
 # describe virtual service ip
 vrrp_instance VI_1 {
   # initial state
-  state MASTER
+  state BACKUP
   interface eth0
   # arbitary unique number 0..255
   # used to differentiate multiple instances of vrrpd
   virtual_router_id 1
   # for electing MASTER, highest priority wins.
   # to be MASTER, make 50 more than other machines.
-  priority 100
+  priority 50
   authentication {
     auth_type PASS
     auth_pass dwoeiodmewfivlqoijwmcldm93492oeiwwnn
@@ -32,7 +32,7 @@
 }
 
 # describe virtual telnet server
-virtual_server fwmark 6 {
+virtual_server fwmark 7 {
   delay_loop 15
   lb_algo rr
   lb_kind DR
_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
Send requests to lvs-users-requ...@linuxvirtualserver.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

Reply via email to