下一个版本的Easy-CDN可能要用到LVS,所以这些天一直恶补LVS,今天没事,就编译一下LVS吧!
说干就干了,
先下载源码包
wget
tar -zxvf ipvsadm-1.24.tar.gz
cd ipvsadm-1.24
make
出错,郁闷呀呀,,原来centos没有内核文件,,没办法,网上下载吧,看一下版本号
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.18-8.el5 #1 SMP Thu Mar 15 19:57:35 EDT 2007 i686 i686 i386 GNU/Linux
到网上下了一个2.6.18.8的
wget
bzip2 -dc linux-2.6.18.8.tar.bz2 | tar xvf -
mv mv linux-2.6.18.8/ /usr/src/
ln -s linux-2.6.18.8/ linux
再完成后,再到
[root@localhost ipvsadm-1.24]# make
make -C libipvs
make[1]: Entering directory `/root/ipvsadm-1.24/libipvs'
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -I/usr/src/linux/include -DHAVE_NET_IP_VS_H -c -o libipvs.o libipvs.c
ar rv libipvs.a libipvs.o
ar: creating libipvs.a
a - libipvs.o
make[1]: Leaving directory `/root/ipvsadm-1.24/libipvs'
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -I/usr/src/linux/include -I.. -I. -DVERSION=\"1.24\" -DSCHEDULERS=\""rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq"\" -DHAVE_POPT -DHAVE_NET_IP_VS_H -c -o ipvsadm.o ipvsadm.c
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -I/usr/src/linux/include -I.. -I. -DVERSION=\"1.24\" -DSCHEDULERS=\""rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq"\" -DHAVE_POPT -DHAVE_NET_IP_VS_H -c -o config_stream.o config_stream.c
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -I/usr/src/linux/include -I.. -I. -DVERSION=\"1.24\" -DSCHEDULERS=\""rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq"\" -DHAVE_POPT -DHAVE_NET_IP_VS_H -c -o dynamic_array.o dynamic_array.c
gcc -Wall -Wunused -Wstrict-prototypes -g -O2 -o ipvsadm ipvsadm.o config_stream.o dynamic_array.o libipvs/libipvs.a -L/usr/lib -lpopt
没错,继续安装
[root@localhost ipvsadm-1.24]# make install
make -C libipvs
make[1]: Entering directory `/root/ipvsadm-1.24/libipvs'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/ipvsadm-1.24/libipvs'
if [ ! -d /sbin ]; then mkdir -p /sbin; fi
install -m 0755 -s ipvsadm /sbin
install -m 0755 ipvsadm-save /sbin
install -m 0755 ipvsadm-restore /sbin
[ -d /usr/man/man8 ] || mkdir -p /usr/man/man8
install -m 0644 ipvsadm.8 /usr/man/man8
install -m 0644 ipvsadm-save.8 /usr/man/man8
install -m 0644 ipvsadm-restore.8 /usr/man/man8
if [ -d /etc/rc.d/init.d ]; then \
install -m 0755 ipvsadm.sh /etc/rc.d/init.d/ipvsadm; \
fi
完成了,检测一下,通过。完成!!!!
[root@localhost ipvsadm-1.24]# ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
阅读(1671) | 评论(0) | 转发(0) |