快速业务通道

Freebsd下也有LVS了

作者 佚名技术 来源 操作系统 浏览 发布时间 2012-06-28

最新已经到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

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号