Keepalived 没有开始

我编制并设置了

keepalived

但它没有开始。

这是我简单的配置;

    vrrp_sync_group PUBLIC_WEB_IPS {
group {
public_http_ip_lan
}
}

vrrp_instance public_http_ip_lan {
state MASTER
interface br1118
virtual_router_id 18
priority 100
advert_int 1
virtual_ipaddress {
192.168.0.254/24 dev br1118
}
nopreempt

}

当我跑步时 keepalived, 我没有得到错误,但似乎大多数等待时间都会发起,暂停 / 冷冻? 来自于 / var / log / syslog 开始时

keepalived

;

Apr 11 17:25:33 basil Keepalived[8047]: Starting Keepalived v1.2.7 (04/08,2013)
Apr 11 17:25:33 basil Keepalived[8048]: Starting Healthcheck child process, pid=8051
Apr 11 17:25:33 basil Keepalived[8048]: Starting VRRP child process, pid=8052
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Initializing ipvs 2.6
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Interface queue is empty
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: No such interface, eth0
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: No such interface, eth1.116
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: No such interface, br1116
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: No such interface, eth1.118
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: No such interface, br1118
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP 10.0.115.69 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP 10.0.116.249 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP 192.168.0.250 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP fe80::2a0:c9ff:fe8f:4164 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP fe80::220:edff:fe9f:9774 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP fe80::2a0:c9ff:fe8f:4164 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP fe80::2a0:c9ff:fe8f:4164 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP fe80::2a0:c9ff:fe8f:4164 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP fe80::2a0:c9ff:fe8f:4164 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Registering Kernel netlink reflector
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Registering Kernel netlink command channel
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Configuration is using : 2777 Bytes
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Using LinkWatch kernel netlink reflector...


keepalived

还在工作 (并且CPU的加载是 2 ~ 3%, Ozu. 10%)

user@basil:/usr/local/etc/keepalived$ ps aux | grep keepalived
root 8048 0.0 0.1 8372 808 ? Ss 17:25 0:00 /usr/local/sbin/keepalived -D
root 8051 0.0 0.3 8492 1820 ? S 17:25 0:00 /usr/local/sbin/keepalived -D
root 8052 0.0 0.2 8492 1344 ? S 17:25 0:00 /usr/local/sbin/keepalived -D

当我跑步时 keepalived, 在 tcpdump 例如,没有显示任何广告:

user@basil:~$ sudo tcpdump -nlASX -s 0 -vvv -e src net 192.168.0.0/24 and not port 22tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes

接口桥接开启 (因为他通过一个单独的人 vlan);

user@basil:/usr/local/etc/keepalived$ ip a s br1118
11: br1118: <broadcast,multicast,up,lower_up> mtu 1500 qdisc noqueue state UP
link/ether 00:a0:c9:8f:41:64 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.250/24 brd 192.168.0.255 scope global br1118
inet6 fe80::2a0:c9ff:fe8f:4164/64 scope link
valid_lft forever preferred_lft forever

我可以在这个中ping主人 VLAN. 这里发生了什么? 我怀疑我做了一个非常愚蠢的错误,但我不能注意到任何错误。

刷新:

根据要求:

user@basil:~$ ifconfig -a
br1116 Link encap:Ethernet HWaddr 00:a0:c9:8f:41:64
inet addr:xxxxx Bcast:xxxxx Mask:xxxx
inet6 addr: fe80::2a0:c9ff:fe8f:4164/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1120 (1.0 KiB) TX bytes:468 (468.0 B)

br1118 Link encap:Ethernet HWaddr 00:a0:c9:8f:41:64
inet addr:xxxxx Bcast:xxxxx Mask:xxxx
inet6 addr: fe80::2a0:c9ff:fe8f:4164/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:19 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1064 (1.0 KiB) TX bytes:468 (468.0 B)

eth0 Link encap:Ethernet HWaddr 00:20:ed:9f:97:74
inet addr:xxxx Bcast:xxxxx Mask:xxxxx
inet6 addr: fe80::220:edff:fe9f:9774/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:169 errors:0 dropped:0 overruns:0 frame:0
TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:20019 (19.5 KiB) TX bytes:11089 (10.8 KiB)

eth1 Link encap:Ethernet HWaddr 00:a0:c9:8f:41:64
inet6 addr: fe80::2a0:c9ff:fe8f:4164/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:150 errors:0 dropped:10 overruns:0 frame:0
TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11680 (11.4 KiB) TX bytes:2436 (2.3 KiB)

eth1.116 Link encap:Ethernet HWaddr 00:a0:c9:8f:41:64
inet6 addr: fe80::2a0:c9ff:fe8f:4164/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1120 (1.0 KiB) TX bytes:936 (936.0 B)

eth1.118 Link encap:Ethernet HWaddr 00:a0:c9:8f:41:64
inet6 addr: fe80::2a0:c9ff:fe8f:4164/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:19 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1064 (1.0 KiB) TX bytes:936 (936.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:732 (732.0 B) TX bytes:732 (732.0 B)

我刚重新启动此框,因此流量计数器很低。
</broadcast,multicast,up,lower_up>
已邀请:

卫东

赞同来自:

我遇到的脚本是那个 keepalived 它始于和不做,而且杂志的最后一排:

Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Using LinkWatch
kernel netlink reflector...

删除设置并启动新功能后,我发现有两种情况 keepalived 停在这个阶段,什么都不做;

Keepalived 指定文件 keepalived.conf, 因此,在无需配置的情况下就在技术上启动。

Keepalived 加载配置文件,但发生错误 (例如,错字)

三叔

赞同来自:

从时开始的问题 keepalived 通常由于文件中的错误而出现 keepalived.conf. Keepalived 目前,它不支持配置文件检查,如果它检测到任何错误,它通常会忽略所有可能的错误。

但是有一种方法可以更轻松地检测配置问题。 您必须开始维护活动

-d

切换将卸载到系统日志的配置数据。 如果您从包装安装它 Red Hat / Centos, 只是编辑

/etc/sysconfig/keepalived

并添加

-d

在一个变量中 KEEPALIVED_OPTIONS:

KEEPALIVED_OPTIONS="-D -d"

现在你运行时 keepalived, 您可以在系统日志中读取,分析配置数据。 此外,如果某些部分的配置工作,有些是不是,它可能是因为您忘了关闭一个配置单元,带有闭合括号。

三叔

赞同来自:

有同样的问题 RHEL 6.5, 如果你编译了 keepalived 从源中,它将放入配置文件

/usr/local/etc/keepalived

, 因为某些原因 keepalived 没有看那里,所以我拿走了 keepalived.conf 并放入

/etc/keepalived.conf



/etc/keepalived/keepalived.conf

之后,一切都在工作!

要回复问题请先登录注册