On 03/10/2014 07:39 AM, yang feng电话 wrote:
> I want to set up a keepalive + LVS system.
>
> I can use
> /sbin/ipvsadm -A -t $VIP:0 -s wrr -p 60
> /sbin/ipvsadm -a -t $VIP:0 -r $RIP1:0 -g
>
> to foward all connections from VIP to realserver.
>
> But if I use keepalive to monitor the ports, how to write the
> keepalived.conf file?
>
> virtual_server <VIP> 0 {
> delay_loop 6
> lb_algo wrr
> lb_kind DR
> nat_mask 255.255.255.0
> persistence_timeout 10
> protocol TCP
>
> real_server <RIP1> 0 {
> weight 1
> TCP_CHECK {
> connect_timeout 3
> nb_get_retry 3
> delay_before_retry 3
> }
> }
Assuming you only want to check a few ports, you could use the
MISC_CHECK option in keepalived. This allows you to write your own check
script, where you could loop through all the ports that you care about.
See
https://github.com/acassen/keepalived/blob/master/doc/keepalived.conf.SYNOPSIS
for details.
--
Khosrow
_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/
LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://lists.graemef.net/mailman/listinfo/lvs-users
|