load balancing using keepalived

Gerry Reno greno at verizon.net
Tue May 22 04:46:10 BST 2007


I'm a new LVS user.  I posted a shorter version over on the keepalived-devel
list but there doesn't seem to be much traffic over there so I thought
it might be better to move my questions over to the lvs-users list.

I've got a basic two realserver configuration running.  I setup the 
config to balance port 22 SSH connections between the two realservers 
equally weighted.  The problem is that I'm not seeing any load balancing 
occurring.  All the SSH connections are going to the first realserver.  
I'm using 'rr' scheduling.  I've looked through the forum and google and 
I see other entries with similar situation of no load balancing 
occurring.  Can this be fixed?  I was expecting that the connections 
would alternate between the two realservers when using the 'rr' 
scheduler.  Also, does it ever balance at any time or load level?   

I am not using any persistence (at least that I know of).

Here is ipvsadm:
# ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 192.168.1.215:ssh rr
-> 192.168.1.26:ssh Masq 1 0 1
-> 192.168.1.25:ssh Local 1 3 0
#


### keepalived.conf:
global_defs {
  lvs_id lvs01  # MASTER
}

vrrp_sync_group G1 {  # yes, I know this is superfluous
  group {
    VI_1
  }
}

vrrp_instance VI_1 {
  state                         MASTER
  interface                     eth0
  lvs_sync_daemon_interface     eth0 
  virtual_router_id             51
  priority                      100
  advert_int                    1

  authentication {
    auth_type PASS
    auth_pass xxxxx
  }
  virtual_ipaddress {
    192.168.1.215   # default CIDR mask is /32
  }
}

virtual_server 192.168.1.215 22 {
  delay_loop 6
  lb_algo rr
  lb_kind NAT
  #  persistence_timeout 50
  protocol TCP

  #   sorry_server 192.168.1.16 22

  real_server 192.168.1.25 22 {
    weight 100
    TCP_CHECK {
      connect_timeout 3
      connect_port 22
    }

  }

  real_server 192.168.1.26 22 {
    weight 100
    TCP_CHECK {
      connect_timeout 3
      connect_port 22
    }
  }

}




Search lvs-users Archives
Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort

More information about the lvs-users mailing list