keepalived问题咨询
keepalived问题咨询
我的keepalived已经在线上跑了1年多 没出过问题,主备切换也是OK的。但是昨天看message的log时候发现这样的信息:
May 19 17:19:12 lvs01 Keepalived_vrrp: Registering Kernel netlink command channel
May 19 17:19:12 lvs01 Keepalived_vrrp: Registering gratutious ARP shared channel
May 19 17:19:12 lvs01 Keepalived_vrrp: Opening file '/etc/keepalived/keepalived.conf'.
May 19 17:19:12 lvs01 Keepalived_vrrp: VRRP_Instance(VI_2) setting protocol VIPs.
May 19 17:19:12 lvs01 Keepalived_vrrp: VRRP_Instance(VI_3) setting protocol VIPs.
May 19 17:19:12 lvs01 Keepalived_vrrp: Configuration is using : 42828 Bytes
May 19 17:19:12 lvs01 Keepalived_vrrp: cant do IP_DROP_MEMBERSHIP errno=Bad file descriptor (9)
May 19 17:19:12 lvs01 Keepalived_vrrp: VRRP_Instance(VI_1) Entering BACKUP STATE
May 19 17:19:12 lvs01 Keepalived_vrrp: VRRP sockpool: [ifindex(2), proto(112), fd(10,11)]
May 19 17:19:17 lvs01 Keepalived_vrrp: VRRP_Instance(VI_2) Transition to MASTER STATE
May 19 17:19:17 lvs01 Keepalived_vrrp: VRRP_Instance(VI_3) Transition to MASTER STATE
文件描述符我改过了 65536,恢复成了1024也一样的问题。虽然这个现在对线上服务没影响,但是总觉得怪。请问下谁知道这个问题是什么原因呢?
另外:
[root@lvs01 ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:11:25:A9:63:88
inet addr:192.168.1.4 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::211:25ff:fea9:6388/64 Scopeink
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2653256102 errors:0 dropped:6200832 overruns:0 frame:4
TX packets:2662935377 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:612238716 (583.8 MiB) TX bytes:697519790 (665.2 MiB)
Interrupt:169
请问一下 这个dropped和frame ,这是什么情况??
谢谢!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我也遇到此问题,Relad的时候会出现,Restart的时候正常。
open("/etc/init.d/keepalived", O_RDONLY) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff296ebe60) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(3, 0, SEEK_CUR) = 0
read(3, "#!/bin/sh\n#\n# keepalived High "..., 80) = 80
lseek(3, 0, SEEK_SET) = 0
getrlimit(RLIMIT_NOFILE, {rlim_cur=800000, rlim_max=800000}) = 0
fcntl(255, F_GETFD) = -1 EBADF (Bad file descriptor)
restart时大概是fork出来的, 这个值是合法的, reload时那个句柄可能已经被关闭了.
得按上下文找一下相应的代码, 看看是哪个变量, 然后在哪里被打开/关闭。不知道fcntl(255, F_GETFD) 这里传了什么。
对应函数位置:
void if_leave_vrrp_group(int sd, interface *ifp)
{
struct ip_mreqn req_add;
int ret = 0;
if (sd < 0) return; // If fd is -1 then we add a membership trouble
memset(&req_add, 0, sizeof (req_add)); // Leaving the VRRP multicast group
req_add.imr_multiaddr.s_addr = htonl(INADDR_VRRP_GROUP);
req_add.imr_address.s_addr = IF_ADDR(ifp);
req_add.imr_ifindex = IF_INDEX(ifp);
ret = setsockopt(sd, IPPROTO_IP, IP_DROP_MEMBERSHIP,
(char *) &req_add, sizeof (struct ip_mreqn));
if (ret < 0) {
syslog(LOG_INFO, "cant do IP_DROP_MEMBERSHIP errno=%s (%d)",
strerror(errno), errno);
return;
}
close(sd); // Finally close the desc
}
2009-09-24 Release 1.1.18 | Bugfixes
* VRRP : Fixed an IP_DROP_MEMBERSHIP issue while performing
reload. vrrp socket pool is released at first.
LZ用的版本 < 1.1.18 ?
是的,这个我也发现了:
我排查了几个版本,问题是从 1.2.6 开始重现的。
我写了博客记录此问题: http://hi.baidu.com/higkoo/item/eacc58b46b9c2ce84fc7fdea
嗯。我也看看
这个好像是一个BUG
keepalived 官网有介绍
http://www.keepalived.org/changelog.html
Release 0.6.8 | Bug fixes
* Alex Kramarov & Remi Nivet, <Remi.Nivet <at> atosorigin.com>
reported an assertion error during smtp notification process. The assertion
caused a bad file descriptor registration during in_progress connection
handling. Fixed registering an event thread calling upper level SMTP
protocol in_progress connection handler. So the SMTP stream handlers use
global I/O multiplexer on connection success.