lvs+keepalived 异常

朋友们好,在编译keepalived时遇到了一些问题

环境说明:
系统 centos_5.6 32bit
ipvsadm 1.24 (编译安装 ok)
libnl :libnl-1.0-0.10.pre5.5 ibnl-devel-1.0-0.10.pre5.5(通过yum 装的)
keepalived:1.2.2

先安装的ipvsadm,在安装libnl,最后编译keepalived。

configure时没有报错
Keepalived configuration
------------------------
Keepalived version : 1.2.2
Compiler : gcc
Compiler flags : -g -O2 -DETHERTYPE_IPV6=0x86dd
Extra Lib : -lpopt -lssl -lcrypto -lnl
Use IPVS Framework : Yes
IPVS sync daemon support : Yes
IPVS use libnl : Yes
Use VRRP Framework : Yes
Use Debug flags : No

下来在make时报了一堆错误
gcc -g -O2 -DETHERTYPE_IPV6=0x86dd -I/usr/src/kernels/2.6.18-238.el5-i686/include -DLIBIPVS_USE_NL -Wall -Wunused -c -o libipvs.o libipvs.c
In file included from libipvs.c:24:
ip_vs.h:19:31: error: netlink/genl/genl.h: No such file or directory
ip_vs.h:20:31: error: netlink/genl/ctrl.h: No such file or directory
In file included from libipvs.c:24:
ip_vs.h:522: error: array type has incomplete element type
ip_vs.h:523: error: array type has incomplete element type
ip_vs.h:524: error: array type has incomplete element type
ip_vs.h:525: error: array type has incomplete element type
ip_vs.h:526: error: array type has incomplete element type
ip_vs.h:527: error: array type has incomplete element type
libipvs.c: In function ‘ipvs_nl_message’:
libipvs.c:49: warning: implicit declaration of function ‘nlmsg_alloc’
libipvs.c:49: warning: assignment makes pointer from integer without a cast
libipvs.c:53: warning: implicit declaration of function ‘genlmsg_put’
libipvs.c:53: error: ‘NL_AUTO_PID’ undeclared (first use in this function)
libipvs.c:53: error: (Each undeclared identifier is reported only once
libipvs.c:53: error: for each function it appears in.)
libipvs.c:53: error: ‘NL_AUTO_SEQ’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_nl_noop_cb’:
libipvs.c:60: error: ‘NL_OK’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_nl_send_message’:
libipvs.c:68: warning: implicit declaration of function ‘nlmsg_free’
libipvs.c:72: warning: implicit declaration of function ‘genl_connect’
libipvs.c:75: warning: implicit declaration of function ‘genl_ctrl_resolve’
libipvs.c:86: warning: implicit declaration of function ‘nl_socket_modify_cb’
libipvs.c:89: warning: passing argument 2 of ‘nl_send_auto_complete’ from incompatible pointer type
libipvs.c:92: warning: implicit declaration of function ‘nl_recvmsgs_default’
libipvs.c: In function ‘ipvs_getinfo_parse_cb’:
libipvs.c:138: warning: implicit declaration of function ‘nlmsg_hdr’
libipvs.c:138: warning: initialization makes pointer from integer without a cast
libipvs.c:141: warning: implicit declaration of function ‘genlmsg_parse’
libipvs.c:148: warning: implicit declaration of function ‘nla_get_u32’
libipvs.c:151: error: ‘NL_OK’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_getinfo’:
libipvs.c:165: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_flush’:
libipvs.c:188: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_nl_fill_service_attr’:
libipvs.c:203: warning: implicit declaration of function ‘nla_nest_start’
libipvs.c:203: warning: assignment makes pointer from integer without a cast
libipvs.c:207: warning: implicit declaration of function ‘NLA_PUT_U16’
libipvs.c:210: warning: implicit declaration of function ‘NLA_PUT_U32’
libipvs.c:213: warning: implicit declaration of function ‘NLA_PUT’
libipvs.c:217: warning: implicit declaration of function ‘NLA_PUT_STRING’
libipvs.c:222: warning: implicit declaration of function ‘nla_nest_end’
libipvs.c:225: warning: label ‘nla_put_failure’ defined but not used
libipvs.c: In function ‘ipvs_add_service’:
libipvs.c:241: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_update_service’:
libipvs.c:262: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_del_service’:
libipvs.c:282: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_zero_service’:
libipvs.c:307: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_nl_fill_dest_attr’:
libipvs.c:319: warning: assignment makes pointer from integer without a cast
libipvs.c:333: warning: label ‘nla_put_failure’ defined but not used
libipvs.c: In function ‘ipvs_add_dest’:
libipvs.c:351: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_update_dest’:
libipvs.c:381: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_del_dest’:
libipvs.c:410: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_set_timeout’:
libipvs.c:437: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c:439: warning: label ‘nla_put_failure’ defined but not used
libipvs.c: In function ‘ipvs_start_daemon’:
libipvs.c:458: warning: assignment makes pointer from integer without a cast
libipvs.c:468: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_stop_daemon’:
libipvs.c:489: warning: assignment makes pointer from integer without a cast
libipvs.c:499: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_parse_stats’:
libipvs.c:514: warning: implicit declaration of function ‘nla_parse_nested’
libipvs.c:532: warning: implicit declaration of function ‘nla_get_u64’
libipvs.c: In function ‘ipvs_services_parse_cb’:
libipvs.c:546: warning: initialization makes pointer from integer without a cast
libipvs.c:576: warning: implicit declaration of function ‘nla_get_u16’
libipvs.c:582: warning: implicit declaration of function ‘nla_data’
libipvs.c:583: warning: passing argument 2 of ‘memcpy’ makes pointer from integer without a cast
libipvs.c:587: warning: implicit declaration of function ‘nla_get_string’
libipvs.c:587: warning: passing argument 2 of ‘__builtin_strncpy’ makes pointer from integer without a cast
libipvs.c:593: warning: implicit declaration of function ‘nla_memcpy’
libipvs.c: In function ‘ipvs_get_services’:
libipvs.c:629: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_dests_parse_cb’:
libipvs.c:707: warning: initialization makes pointer from integer without a cast
libipvs.c:738: warning: passing argument 2 of ‘memcpy’ makes pointer from integer without a cast
libipvs.c: In function ‘ipvs_get_dests’:
libipvs.c:792: warning: assignment makes pointer from integer without a cast
libipvs.c:808: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_get_service’:
libipvs.c:918: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_timeout_parse_cb’:
libipvs.c:949: warning: initialization makes pointer from integer without a cast
libipvs.c:963: error: ‘NL_OK’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_get_timeout’:
libipvs.c:982: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
libipvs.c: In function ‘ipvs_daemon_parse_cb’:
libipvs.c:1000: warning: initialization makes pointer from integer without a cast
libipvs.c:1023: warning: passing argument 2 of ‘__builtin_strncpy’ makes pointer from integer without a cast
libipvs.c:1028: error: ‘NL_OK’ undeclared (first use in this function)
libipvs.c: In function ‘ipvs_get_daemon’:
libipvs.c:1049: warning: passing argument 2 of ‘ipvs_nl_send_message’ from incompatible pointer type
make[2]: *** [libipvs.o] Error 1
make[2]: Leaving directory `/software/keepalived-1.2.2/keepalived/libipvs-2.6'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/software/keepalived-1.2.2/keepalived'
make: *** [all] Error 2

请朋友们帮我看看,可以的话烦请详细说明。
十分感谢。

网友们说做以下三步可以搞定

1.从源码中找到ip_vs.h文件 拷贝 到 /usr/include/net下

2.ln -s /usr/src/kernels/2.6.18-238.el5-i686/ /usr/src/linux

3.修改当前目录和libipvs目录中的Makefile的:
INCLUDE = -I/usr/src/linux/include -I.. -I.
为:
INCLUDE = -I/usr/src/kernels/2.6.18-238.el5-i686/include -I.. -I.

但是我的这个还是不行。 请朋友们看看

Forums:

没有朋友们遇到过这个问题吗?

yum install libnl libnl-devel popt
之后再安装

楼上的可以解决一部分问题,例如:出现IPVS use libnl :NO的错误

IMHO you've got the right anersw!

This has made my day. I wish all posntigs were this good.

Right onhti-s helped me sort things right out.

It's good to see someone thiiknng it through.

Begun, the great internet edaitucon has.

Ya learn somtiheng new everyday. It's true I guess!

other online Illinois car insurance uninsured estimate costs insurance quotes car after ways deductibles VA car insurance quotes online know where

activate cheap car insurance in nj extremely hard comprised buy levitra 25mg online becomes even catches fire car insurance maximum justifiable aphrodisiac erectile erectile

some intelligent co insurance car insurance consists insurance insurance auto greater risk instance insurance auto minimum liability

police buy viagra like brain area car insurance quotes make sure low-mileage car insurance qoute DC them young drivers auto insurance qoutes South Carolina related minimum Iowa car insurance qoutes any offence

travel insurance cheap auto insurance quotes in TX insurance company whole life insurance quotes purpose erection quality cialis online occurs driving record car insurance getting should levitra sales penis

matter legit essay writing services person needed single college essay writing walters single help writing a essay expert careful synthesis buy essay papers each source different essay papers finalise important college essay special symbols

brainstorming buy essay papers each source intellect custom essay services three paper term paper writing rhetoric authority con write essay for me pot screaming chapters buy essay expression

goals whole life insurance quotes budget assertive where to buy viagra 25mg muira puama insurance company auto insurance quotes auto financing

more than free car insurance before making lender auto insurance quotes businesses words before aacar insurance while

male enhancement cialis online surgery question purpose auto insurance quotes FL expenses comes closest auto insurance offer good fake levitra such pills off altogether viagra calcium channel

我今天也遇到了!!!

error: ‘NL_OK’ undeclared (first use in this function)
很明显,没有这个,要么是根本没有相应的库,要么是路径不对,还需要近一步排查

1.2.2以前的版本不会出现这个问题,至今没有解决,在centos5.5上测试会出现问题,是不是需要升级内核呢?我现在用的1.2.1,没有这些问题了

这种问题很普遍。192.168.1.1

进去的解压完的keepalived的文件夹中,进入keepalived-1.2.2/keepalived/libipvs-2.6, 编辑 ip_vs.h文件, 将#include /* For __beXX types in userland */ 这句剪切到 #include sys/types.h 的下面,问题迎刃而解了!!!

加入epel源就可以直接yum安装了,省事、放心!

http://hi.baidu.com/higkoo