最新已經到0.4了,安裝也比較簡單,可惜家裡就一台,那位兄弟給測試一下,給大家說一下效果。
LVS on FreeBSD Version 0.4.0
Install:
1. Patch the FreeBSD kernel:
cp patch/OS-RELEASE/* /usr/src;
cd /usr/src;
patch -p0 < uipc_socket.c.patch
patch -p0 < ip_input.c.patch
patch -p0 < socketvar.h.patch
patch -p0 < sys_conf_options.patch
patch -p0 < sys_i386_conf_GENERIC.patch
2. Rebuilding FreeBSD kernel:
cd /usr/src/sys/arch/i386/conf;
config GENERIC;
cd ../compile/GENERIC;
make depend;
make;
make install;
3. Compile ipvs module:
cd ipvs/
make;
cd ipvsadm/
make install;
4. Compile ipvs scheduler module:
cd ipvs/
cd schedulers/
cd SCHEDULER-NAME/
make
5. Reboot with new kernel:
reboot;
Let's assume your cluster has the following configuration:
Workstation with address:192.168.1.23 runs as dispatcher(FE:front end),
Workstations with address:192.168.1.33 and 192.168.1.38 run as real server(BE:back end).
Thay all share address:192.168.1.36,which is saw by client.
Start:
Assume using 'rr' schedule algorithm(optional: dh, lblc, lblcr, lc, nq, rr,
sed, sh, wlc, wrr).
LVS/DR:
1. kldload ./ipvs.ko
2. kldload schedulers/rr/ip_vs_rr.ko
3. ./ipvsadm -A -t 192.168.1.36:80 -s rr
4. ./ipvsadm -a -t 192.168.1.36:80 -r 192.168.1.33:80 -g
5. ./ipvsadm -a -t 192.168.1.36:80 -r 192.168.1.38:80 -g
LVS/TUN:
1. kldload ./ipvs.ko
2. kldload schedulers/rr/ip_vs_rr.ko
3. ./ipvsadm -A -t 192.168.1.36:80 -s rr
4. ./ipvsadm -a -t 192.168.1.36:80 -r 192.168.1.33:80 -i
5. ./ipvsadm -a -t 192.168.1.36:80 -r 192.168.1.38:80 -i
Stop:
1. ./ipvsadm -C
2. kldunload ip_vs_rr
3. kldunload ipvs
Note:Do not use other commands of ipvsadm,for maybe it is not implemented.
Feedback