Keepalived的安装
官网下载:
1 yum install -y libnl 2 yum install -y libnl-devel 3 下载 4 cd /usr/local/src/ 5 6 wget http://www.keepalived.org/software/keepalived-1.2.21.tar.gz 7 tar -zxvf keepalived-1.2.21.tar.gz 8 cd keepalived-1.2.21 9 ./configure --sysconf=/etc/ --with-kernel-dir=/usr/src/kernels/2.6.32-431.23.3.el6.x86_64/10 11 make && make install12 ln -s /usr/local/sbin/keepalived /sbin/13 chkconfig --add keepalived14 chkconfig --level 35 keepalived on
其中会遇到如下错误:
1 checking for openssl/err.h... yes 2 checking whether ETHERTYPE_IPV6 is declared... yes 3 checking for crypt in -lcrypt... yes 4 checking for MD5_Init in -lcrypto... yes 5 checking for SSL_CTX_new in -lssl... yes 6 checking for nl_socket_alloc in -lnl-3... no 7 checking for nl_socket_modify_cb in -lnl... yes 8 checking libnfnetlink/libnfnetlink.h usability... no 9 checking libnfnetlink/libnfnetlink.h presence... no10 checking for libnfnetlink/libnfnetlink.h... no11 configure: error: 12 !!! Please install libnfnetlink headers.
解决办法:yum install -y libnfnetlink-devel
最后安装完成之后如下:
Keepalived configuration------------------------Keepalived version : 1.2.21Compiler : gccCompiler flags : -g -O2 -DFALLBACK_LIBNL1Extra Lib : -lssl -lcrypto -lcrypt -lnl Use IPVS Framework : YesIPVS sync daemon support : YesIPVS use libnl : Yesfwmark socket support : YesUse VRRP Framework : YesUse VRRP VMAC : YesUse VRRP authentication : YesSNMP keepalived support : NoSNMP checker support : NoSNMP RFCv2 support : NoSNMP RFCv3 support : NoSHA1 support : NoUse Debug flags : Nolibnl version : 1Use IPv4 devconf : NoUse libiptc : NoUse libipset : No
说明如下
Use IPVS Framework 使用IPVS框架,也就是负载均衡模块
IPVS sync daemon support 启用IPVS的同步功能。
Use VRRP Framework 实现高可用必须的模块
IPVS use libnl 表示使用新版的libnl,libnl是NTTLINK的一个实现。
ok到此Keepalived编译安装完成