Keepalived的安装

官网下载:点击直达

 yum install -y libnl
yum install -y libnl-devel
下载
cd /usr/local/src/ wget http://www.keepalived.org/software/keepalived-1.2.21.tar.gz
tar -zxvf keepalived-1.2..tar.gz
cd keepalived-1.2.
./configure --sysconf=/etc/ --with-kernel-dir=/usr/src/kernels/2.6.-431.23..el6.x86_64/ make && make install
ln -s /usr/local/sbin/keepalived /sbin/
chkconfig --add keepalived
chkconfig --level keepalived on

其中会遇到如下错误:

 checking for openssl/err.h... yes
checking whether ETHERTYPE_IPV6 is declared... yes
checking for crypt in -lcrypt... yes
checking for MD5_Init in -lcrypto... yes
checking for SSL_CTX_new in -lssl... yes
checking for nl_socket_alloc in -lnl-... no
checking for nl_socket_modify_cb in -lnl... yes
checking libnfnetlink/libnfnetlink.h usability... no
checking libnfnetlink/libnfnetlink.h presence... no
checking for libnfnetlink/libnfnetlink.h... no
configure: error:
!!! Please install libnfnetlink headers.

解决办法:
yum install -y libnfnetlink-devel

最后安装完成之后如下:

Keepalived configuration
------------------------
Keepalived version : 1.2.
Compiler : gcc
Compiler flags : -g -O2 -DFALLBACK_LIBNL1
Extra Lib : -lssl -lcrypto -lcrypt -lnl
Use IPVS Framework : Yes
IPVS sync daemon support : Yes
IPVS use libnl : Yes
fwmark socket support : Yes
Use VRRP Framework : Yes
Use VRRP VMAC : Yes
Use VRRP authentication : Yes
SNMP keepalived support : No
SNMP checker support : No
SNMP RFCv2 support : No
SNMP RFCv3 support : No
SHA1 support : No
Use Debug flags : No
libnl version :
Use IPv4 devconf : No
Use libiptc : No
Use libipset : No

说明如下

Use IPVS Framework 使用IPVS框架,也就是负载均衡模块

IPVS sync daemon support 启用IPVS的同步功能。

Use VRRP Framework 实现高可用必须的模块

IPVS use libnl 表示使用新版的libnl,libnl是NTTLINK的一个实现。

ok到此Keepalived编译安装完成

05-11 22:15