Keepalived安装错误一例(make错误)解决方法
时间: 2024-02-27 09:55:36 浏览: 100
keepalived的安装
安装 Keepalived 如果遇到了 make 错误,可以参考以下解决方法:
1. 确认依赖包已经安装
在编译 Keepalived 之前,需要先安装一些依赖包,如 libnl、libnfnetlink、libnftnl 等。可以使用以下命令进行安装:
```
yum install -y libnl3-devel libnfnetlink-devel libnftnl-devel
```
2. 检查错误信息
当出现 make 错误时,需要先查看错误信息,确定具体出错原因。例如,出现类似以下错误信息:
```
../vrrp/.libs/libvrrp.a(vrrp_proto.o): In function `vrrp_proto_init':
vrrp_proto.c:(.text+0x21f): undefined reference to `nflog_open'
vrrp_proto.c:(.text+0x28c): undefined reference to `nflog_bind_pf'
vrrp_proto.c:(.text+0x2a3): undefined reference to `nflog_unbind_pf'
vrrp_proto.c:(.text+0x2b4): undefined reference to `nflog_close'
collect2: error: ld returned 1 exit status
make[2]: *** [keepalived] Error 1
make[2]: Leaving directory `/root/keepalived-2.1.5/keepalived'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/keepalived-2.1.5'
make: *** [all] Error 2
```
可以看到是链接错误,找不到 nflog_open、nflog_bind_pf、nflog_unbind_pf 和 nflog_close 函数。这时需要安装 libnetfilter_log-devel 包:
```
yum install -y libnetfilter_log-devel
```
3. 重新编译安装
确认依赖包已经安装,错误信息也已经解决后,可以尝试重新编译安装 Keepalived:
```
make clean
./configure
make
make install
```
这样就可以成功安装 Keepalived 了。
阅读全文