centos系统默认yum版本的keepalived是1.2.13,我尝试安装编译一下最新版本的keepalived1.2.17.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
[root@LVS2 ~]# cd /byrd/tools/ [root@LVS2 tools]# wget http://www.keepalived.org/software/keepalived-1.2.17.tar.gz [root@LVS2 keepalived-1.2.17]# ll /usr/src/ #--with-kernel-dir=DIR lrwxrwxrwx. 1 root root 43 May 1 15:34 linux -> /usr/src/kernels/2.6.32-573.22.1.el6.x86_64 Keepalived configuration ------------------------ Keepalived version : 1.2.17 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 SNMP support : No SHA1 support : No Use Debug flags : No [root@LVS2 keepalived-1.2.17]# make && make install [root@LVS2 keepalived-1.2.17]# cp /usr/local/etc/rc.d/init.d/keepalived /etc/init.d/ [root@LVS2 keepalived-1.2.17]# cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/ [root@LVS2 keepalived-1.2.17]# mkdir /etc/keepalived [root@LVS2 keepalived-1.2.17]# cp /usr/local/etc/keepalived/keepalived.conf /etc/keepalived/ [root@LVS2 keepalived-1.2.17]# which keepalived /usr/local/sbin/keepalived [root@LVS2 keepalived-1.2.17]# /etc/init.d/keepalived start Starting keepalived: /bin/bash: keepalived: command not found [FAILED] [root@LVS2 keepalived-1.2.17]# cp /usr/local/sbin/keepalived /usr/sbin/ [root@LVS2 keepalived]# tail -2 /etc/rsyslog.conf # keepalived local0.* /var/log/keepalived.log [root@LVS2 keepalived]# tail -2 /etc/sysconfig/keepalived KEEPALIVED_OPTIONS="-D -d -S 0" |
报错:
0 1 2 |
configure: error: !!! OpenSSL is not properly installed on your system. !!! !!! Can not include OpenSSL headers files. !!! |
解决方法:
0 |
yum install libnfnetlink libnfnetlink-devel openssl-devel e2fsprogs-devel |
报错:(centos7系统上,6不存在问题)
0 1 2 3 4 5 6 7 8 |
/usr/src/linux/include/linux/types.h:14:26: error: conflicting types for ‘fd_set’ /usr/src/linux/include/linux/types.h:15:25: error: conflicting types for ‘dev_t’ /usr/src/linux/include/linux/types.h:19:17: error: conflicting types for ‘nlink_t’ /usr/src/linux/include/linux/types.h:25:26: error: conflicting types for ‘timer_t’ /usr/src/linux/include/linux/types.h:45:26: error: conflicting types for ‘loff_t’ /usr/src/linux/include/linux/types.h:111:17: error: conflicting types for ‘uint64_t’ /usr/src/linux/include/linux/types.h:112:17: error: conflicting types for ‘u_int64_t’ /usr/src/linux/include/linux/types.h:113:17: error: conflicting types for ‘int64_t’ /usr/src/linux/include/linux/types.h:134:23: error: conflicting types for ‘blkcnt_t’ |
解决方法:
0 |
rm -f /usr/src/linux |
错误:
0 |
!!! Please install libnfnetlink headers. !!! |
解决方法:
0 |
yum install libnfnetlink-devel |
参考文档:
1:https://bugs.gentoo.org/show_bug.cgi?id=455418
2:http://www.keepalived.org/pdf/UserGuide.pdf
3:http://blog.csdn.net/yongsheng0550/article/details/7329339
4:https://dev.openwrt.org/ticket/12875SourceByrd's Weblog-https://note.t4x.org/environment/compile-install-keepalived/
SourceByrd's Weblog-https://note.t4x.org/environment/compile-install-keepalived/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!