ipvsadm介绍:IPVS是lvs集群的核心。主要用于完成如何将请求发送给Real Server 节点。
显示以上错误请安装如下包: apt-get install libnl-dev libpopt-dev
1、检查系统环境是否支持IPVS:(我用的是debian)
modprobe -l | grep ipvs
kernel/net/netfilter/ipvs/ip_vs.ko
kernel/net/netfilter/ipvs/ip_vs_rr.ko
kernel/net/netfilter/ipvs/ip_vs_wrr.ko
kernel/net/netfilter/ipvs/ip_vs_lc.ko
kernel/net/netfilter/ipvs/ip_vs_wlc.ko
kernel/net/netfilter/ipvs/ip_vs_lblc.ko
kernel/net/netfilter/ipvs/ip_vs_lblcr.ko
kernel/net/netfilter/ipvs/ip_vs_dh.ko
kernel/net/netfilter/ipvs/ip_vs_sh.ko
kernel/net/netfilter/ipvs/ip_vs_sed.ko
kernel/net/netfilter/ipvs/ip_vs_nq.ko
kernel/net/netfilter/ipvs/ip_vs_ftp.ko
有以上输出就表明支持。
2、从www.linuxvirtualserver.org官网下载对应版本。
tar zxvf ipvsadm-1.26.tar.gz
cd ipvsadm-1.26
make
make -C libipvs
make[1]: Entering directory `/tmp/ipvsadm-1.26/libipvs'
gcc -Wall -Wunused -Wstrict-prototypes -g -fPIC -DLIBIPVS_USE_NL -DHAVE_NET_IP_VS_H -c -o libipvs.o libipvs.c
In file included from libipvs.h:13,
from libipvs.c:23:
ip_vs.h:15:29: error: netlink/netlink.h: 没有那个文件或目录
ip_vs.h:16:31: error: netlink/genl/genl.h: 没有那个文件或目录
ip_vs.h:17:31: error: netlink/genl/ctrl.h: 没有那个文件或目录
In file included from libipvs.h:13,
from libipvs.c:23:
ip_vs.h:520: error: array type has incomplete element type
ip_vs.h:521: error: array type has incomplete element type
ip_vs.h:522: error: array type has incomplete element type
ip_vs.h:523: error: array type has incomplete element type
ip_vs.h:524: error: array type has incomplete element type
ip_vs.h:525: error: array type has incomplete element type
显示以上错误请安装如下包: apt-get install libnl-dev libpopt-dev
3、从新
make (就ok)
make install
4、ipvsadm --help
如果看到帮助提示,表明已经安装成功。
原创地址: