IPVS

http://www.linuxvirtualserver.org/software/index.html

[root@localhost ipvsadm-1.26]# make
make -C libipvs
make[1]: Entering directory `/root/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:0,
                 from libipvs.c:23:
ip_vs.h:15:29: fatal error: netlink/netlink.h: No such file or directory
 #include
                             ^
compilation terminated.
make[1]: *** [libipvs.o] Error 1
make[1]: Leaving directory `/root/ipvsadm-1.26/libipvs'
make: *** [libs] Error 2

yum install -y libnl* popt*

make && make install

-------------------

[root@localhost ~]# /usr/sbin/ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
[root@localhost ~]# lsmod | grep ip_vs
ip_vs                 145497  0 
nf_conntrack          133095  7 ip_vs,nf_nat,nf_nat_ipv4,nf_nat_ipv6,xt_conntrack,nf_conntrack_ipv4,nf_conntrack_ipv6
libcrc32c              12644  4 xfs,ip_vs,nf_nat,nf_conntrack

[root@localhost ~]# ipvsadm -C
[root@localhost ~]# ipvsadm --set 30 5 60
[root@localhost ~]# ipvsadm -A -t 192.168.1.100:80 -s rr -p 20
[root@localhost ~]# ipvsadm -a -t 192.168.1.100:80 -r 192.168.1.104 -g -w 1
[root@localhost ~]# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.1.100:80 rr persistent 20
  -> 192.168.1.104:80             Route   1      0          0 

===================

/usr/src/kernels/ # 为空

yum install kernel-devel 

ln -s /usr/src/kernels/3.10.0-1062.12.1.el7.x86_64/ /usr/src/linux

 

你可能感兴趣的:(LVS)