Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jan 2008 18:31:19 +0200 (EET)
From:      "Dennis Pashutinsky" <k-unker@fbsd.kiev.ua>
To:        freebsd-cluster@freebsd.org
Cc:        k-unker@fbsd.kiev.ua
Subject:   RE: ipvs + keepalived questions
Message-ID:  <63088.194.140.237.67.1201019479.squirrel@mail.fbsd.kiev.ua>

index | next in thread | raw e-mail

[-- Attachment #1 --]
Hi.

I have tested ipvs & keepalived on FreeBSD 6.2. It works, but later box
will cath the kernel panic. So, ipvs can't be used on FreeBSD 6x :-(
Also, you will catch a kernel panic id you do `reboot` or `shutdown -r
now` and kernel modules ipvs.ko and and one of other modules (wlc or
other) are loaded. So, you must unload them first.

My friend Alexey Tsvetnov pleasantly wrote for me rcNG starting script to
avoid such kind of problems.


P.S. see this script in attach. Also, if there are people who interested
in ipvs & keepalived, I have written mini-howto (on russian). So, I can
translate this howto to english if anybody needs it.

-- 
Regards,
Dennis Pashutinsky
[-- Attachment #2 --]
#!/bin/sh
#
# ipvs rcNG script
# (c) Alexey Tsvetnov, vorakl@fbsd.kiev.ua
#
#---------------------------------------------------------------------------------
#
# Define these ipvs_* variables in one of these files:
#       /etc/rc.conf
#       /etc/rc.conf.local
#       /etc/rc.conf.d/ipvs
#
# ipvs_enable (bool):         		Set it to "YES" to enable ipvs.
#			      		Default is "NO".
# ipvs_${shedmethod}_enable (bool):     Set it to "YES" to enable sheduling method
#			      		Default is "NO".
#
# List of ${shedmethod} you can get by run command:
#    ls -1 /boot/modules/ | egrep 'ip_vs.*ko' | sed 's/^.*vs_//;s/\.ko//'
#
# Example:
#    ipvs_enable="YES"
#    ipvs_wlc_enable="YES"
#    ipvs_wrr_enable="YES"
#
#---------------------------------------------------------------------------------
#
# PROVIDE: ipvs
# REQUIRE: NETWORKING SERVERS
# BEFORE:  keepalived
# KEYWORD: shutdown


. /etc/rc.subr

name="ipvs"
rcvar=`set_rcvar`

# reload standart function
start_cmd="ipvs_start"
stop_cmd="ipvs_stop"
status_cmd="ipvs_status"
extra_commands="status"

# load parameters with $name prefix
load_rc_config $name

# get modules list
shedmethod=$(ls -1 /boot/modules/ | egrep 'ip_vs.*ko' | sed 's/^.*vs_//;s/\.ko//')

# set default value
: ${ipvs_enable:="NO"}
for i in ${shedmethod}
do
   eval : \${ipvs_${i}_enable:="NO"}
done

ipvs_start() 
{
    if checkyesno ipvs_enable
    then
	kldstat -n ipvs.ko > /dev/null 2>&1 || kldload ipvs.ko

	for i in ${shedmethod}
	do
	   if checkyesno ipvs_${i}_enable 
	   then
		kldstat -n ip_vs_${i}.ko > /dev/null 2>&1 || kldload ip_vs_${i}.ko 
	   fi
	done
    fi
}

ipvs_stop() 
{
    if checkyesno ipvs_enable
    then
	for i in ${shedmethod}
	do
	   if checkyesno ipvs_${i}_enable
	   then
	        kldstat -n ip_vs_${i}.ko > /dev/null 2>&1 && kldunload ip_vs_${i}.ko
	   fi
	done

	kldstat -n ipvs.ko > /dev/null 2>&1 && kldunload ipvs.ko
    fi
}

ipvs_status() 
{
    if checkyesno ipvs_enable
    then
	kldstat -n ipvs.ko > /dev/null 2>&1 && echo "Kernel module [ipvs.ko]: is loaded." || { echo "Kernel module [ipvs.ko]: not loaded!"; return 1; }

	for i in ${shedmethod}
	do
	   if checkyesno ipvs_${i}_enable
	   then
	        kldstat -n ip_vs_${i}.ko > /dev/null 2>&1 && echo "Kernel module [ip_vs_${i}.ko]: is loaded." || { echo "Kernel module [ip_vs_${i}.ko]: not loaded!"; return 1; }
	   fi
	done
    fi
}

run_rc_command "$1"
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?63088.194.140.237.67.1201019479.squirrel>