操作系统:SLES12sp2
keepalived版本:1.2.12
问题描述:
使用命令"systemctl stop keepalived" 无法关闭keepalived,使用 "ps -ef|grep keep"查看,竟然还有keepalived的进程!
解决方案:
vi /sur/lib/systemd/system/keepalived.service, 在里面添加PIDFile配置项,如下:
[Unit]
Description=LVS and VRRP High Availability Monitor
After=syslog.target network.target
[Service]
Type=forking
KillMode=process
PIDFile=/run/keepalived.pid
EnvironmentFile=-/etc/sysconfig/keepalived
ExecStart=/usr/sbin/keepalived $KEEPALIVED_OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
保存后,需要运行systemctl daemon-reload, 重启keepalived~