安装keepalive错误:types.h:14: error: conflicting types for ‘fd_set’

还是在安装keepalive的时候,进行到make的时候报的错误:

[root@mysql2 keepalived-1.2.16]# make


make -C lib || exit 1;
make[1]: Entering directory `/home/keepalived-1.2.16/lib'
gcc -g -O2 -DFALLBACK_LIBNL1 -I. -Wall -Wunused -Wstrict-prototypes -D_WITHOUT_SNMP_ -c command.c
make[1]: Leaving directory `/home/keepalived-1.2.16/lib'
make -C keepalived
make[1]: Entering directory `/home/keepalived-1.2.16/keepalived'
make[2]: Entering directory `/home/keepalived-1.2.16/keepalived/core'
gcc -g -O2 -DFALLBACK_LIBNL1  -I/usr/src/linux/include -I/usr/src/linux/include -I../include -I../../lib -Wall -Wunused -Wstrict-prototypes -D_KRNL_2_6_ -D_WITH_LVS_ -D_WITH_VRRP_ -D_WITHOUT_SNMP_ -D_WITH_SO_MARK_  -c main.c
gcc -g -O2 -DFALLBACK_LIBNL1  -I/usr/src/linux/include -I/usr/src/linux/include -I../include -I../../lib -Wall -Wunused -Wstrict-prototypes -D_KRNL_2_6_ -D_WITH_LVS_ -D_WITH_VRRP_ -D_WITHOUT_SNMP_ -D_WITH_SO_MARK_  -c layer4.c
In file included from ../include/../libipvs-2.6/ip_vs.h:12,
                 from ../include/check_data.h:38,
                 from ../include/check_api.h:27,
                 from ../include/layer4.h:37,
                 from layer4.c:24:
/usr/src/linux/include/linux/types.h:14: error: conflicting types for ‘fd_set’
/usr/include/sys/select.h:78: note: previous declaration of ‘fd_set’ was here
/usr/src/linux/include/linux/types.h:15: error: conflicting types for ‘dev_t’
/usr/include/sys/types.h:61: note: previous declaration of ‘dev_t’ was here
/usr/src/linux/include/linux/types.h:19: error: conflicting types for ‘nlink_t’
/usr/include/sys/types.h:76: note: previous declaration of ‘nlink_t’ was here
/usr/src/linux/include/linux/types.h:25: error: conflicting types for ‘timer_t’
/usr/include/time.h:104: note: previous declaration of ‘timer_t’ was here
/usr/src/linux/include/linux/types.h:45: error: conflicting types for ‘loff_t’
/usr/include/sys/types.h:45: note: previous declaration of ‘loff_t’ was here
/usr/src/linux/include/linux/types.h:111: error: conflicting types for ‘uint64_t’
/usr/include/stdint.h:56: note: previous declaration of ‘uint64_t’ was here
/usr/src/linux/include/linux/types.h:112: error: conflicting types for ‘u_int64_t’
/usr/include/sys/types.h:204: note: previous declaration of ‘u_int64_t’ was here
/usr/src/linux/include/linux/types.h:113: error: conflicting types for ‘int64_t’
/usr/include/stdint.h:41: note: previous declaration of ‘int64_t’ was here
/usr/src/linux/include/linux/types.h:134: error: conflicting types for ‘blkcnt_t’
/usr/include/sys/types.h:236: note: previous declaration of ‘blkcnt_t’ was here
make[2]: *** [layer4.o] Error 1
make[2]: Leaving directory `/home/keepalived-1.2.16/keepalived/core'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/keepalived-1.2.16/keepalived'
make: *** [all] Error 2


在这之前有个操作ln -s /usr/src/kernels/3.8.13-44.1.1.el6uek.x86_64 /usr/src/linux,这个是照着文档操作的,因为我的内核版本是:

# uname -a
Linux mysql2 3.8.13-44.1.1.el6uek.x86_64 #2 SMP Wed Sep 10 06:10:25 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux

所以我执行的是link的对应版本的kernel文件目录,但是报错,后来link到ln -s /usr/src/kernels/2.6.32-504.el6.x86_64 /usr/src/linux就不报错了。

其实文档中也是link到2.6的kernel目录,没有跟内核对应,可能是不支持这个3.8的内核吧。总之,解决了问题就行了,linux内核相关的内容不太清楚。



net.ipv4.tcp_keepalive_time、net.ipv4.tcp_keepalive_intvl和net.ipv4.tcp_keepalive_probes这三个参数都是用于控制TCP的keepalive机制的参数。它们的具体含义如下: 1. net.ipv4.tcp_keepalive_time:该参数定义了TCP keepalive探测报文的发送间隔,单位为秒。当一个TCP连接空闲时间超过该参数设定的值时,内核会发送一个keepalive探测报文给对端。如果对端在一定时间内没有回应,则认为连接已经断开。该参数的默认值为7200秒(2小时)。 2. net.ipv4.tcp_keepalive_intvl:该参数定义了TCP keepalive探测报文的发送间隔,单位为秒。当一次keepalive探测报文未获得对端回应时,内核会继续发送下一次探测报文,直到达到一定次数或连接断开。该参数的默认值为75秒。 3. net.ipv4.tcp_keepalive_probes:该参数定义了TCP keepalive探测报文的最大发送次数。当一个TCP连接空闲时间超过net.ipv4.tcp_keepalive_time设定的值时,内核会发送一次keepalive探测报文给对端,如果对端未回应,则继续发送下一次探测报文,直到达到该参数设定的最大次数或连接断开。该参数的默认值为9次。 需要注意的是,这三个参数的取值应该根据具体的应用场景和网络状况进行调整,以达到最佳的效果。一般来说,建议将net.ipv4.tcp_keepalive_time设置为较小的值,如60秒或120秒,将net.ipv4.tcp_keepalive_intvl设置为较小的值,如30秒或60秒,将net.ipv4.tcp_keepalive_probes设置为较小的值,如3次或5次,以提高连接的可靠性。但是,具体取值还需要根据实际情况进行调整。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值