博主linux环境为:7.6 环境只有nginx1.8和keepalived2.2.7 在下载tar包,编译、安装后,配置完,使用./keepalived启动时。没有报错,但是查服务和VIP都没有成功。 通过systemctl status keepalived信息为
[root@bogon sbin]# systemctl status keepalived
● keepalived.service - LVS and VRRP High Availability Monitor
Loaded: loaded (/usr/lib/systemd/system/keepalived.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:keepalived(8)
man:keepalived.conf(5)
man:genhash(1)
https://keepalived.org
通过journalctl -xe查询日志结果为
Mar 29 11:07:15 bogon Keepalived[10561]: Running on Linux 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 (built for Linux 3.10.0)
Mar 29 11:07:15 bogon Keepalived[10561]: Command line: './keepalived'
Mar 29 11:07:15 bogon Keepalived[10561]: Stopped Keepalived v2.2.7 (01/16,2022)
Mar 29 11:07:53 bogon polkitd[896]: Registered Authentication Agent for unix-process:10565:75278 (system bus name :1.29 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1
Mar 29 11:07:53 bogon systemd[1]: Starting LVS and VRRP High Availability Monitor...
-- Subject: Unit keepalived.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit keepalived.service has begun starting up.
Mar 29 11:07:53 bogon Keepalived[10571]: Starting Keepalived v2.2.7 (01/16,2022)
Mar 29 11:07:53 bogon Keepalived[10571]: Running on Linux 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 (built for Linux 3.10.0)
Mar 29 11:07:53 bogon Keepalived[10571]: Command line: '/usr/local/keepalived/sbin/keepalived' '-D'
Mar 29 11:07:53 bogon Keepalived[10571]: CPU usage (self/children) user: 0.002423/0.000000 system: 0.010905/0.000000
Mar 29 11:07:53 bogon Keepalived[10571]: Stopped Keepalived v2.2.7 (01/16,2022)
Mar 29 11:07:53 bogon systemd[1]: keepalived.service: control process exited, code=exited status=6
Mar 29 11:07:53 bogon systemd[1]: Failed to start LVS and VRRP High Availability Monitor.
-- Subject: Unit keepalived.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit keepalived.service has failed.
--
-- The result is failed.
在经过网上各种资料查询,比如赋权文件权限什么的。都不管用,核查过无数遍配置文件,也开启过虚拟机的虚拟化功能,没什么用。 原来是因为在新版本中,编译安装的初始配置文件名称为keepalived.conf.sample。但是系统不识别这个配置文件,找不到配置文件。只需要删除后缀变成keepalived.conf即可启动,查询结果正常。
[root@bogon keepalived]# ps -ef | grep keepalived
root 10611 1 0 11:14 ? 00:00:00 ./keepalived
root 10612 10611 0 11:14 ? 00:00:00 ./keepalived
root 10620 1632 0 11:18 pts/0 00:00:00 grep --color=auto keepalived
[root@bogon sbin]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:28:3e:da brd ff:ff:ff:ff:ff:ff
inet 192.168.159.142/24 brd 192.168.159.255 scope global noprefixroute dynamic ens33
valid_lft 1439sec preferred_lft 1439sec
inet 192.168.159.152/32 scope global ens33
valid_lft forever preferred_lft forever
inet6 fe80::d879:b597:4c99:2b/64 scope link noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::6:5f7f:c030:5074/64 scope link tentative noprefixroute dadfailed
valid_lft forever preferred_lft forever
|