Keepalived 开机自启动

时间:2024-03-19 18:42:09

keepalived  安装见   https://blog.csdn.net/qq_37668945/article/details/88618390

 

Keepalived 开机自启动

vim /lib/systemd/system/keepalived.service
[Unit]
Description=LVS and VRRP High Availability Monitor
After= network-online.target syslog.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/var/run/keepalived.pid
KillMode=process
EnvironmentFile=-/usr/local/etc/sysconfig/keepalived
ExecStart=/usr/local/sbin/keepalived $KEEPALIVED_OPTIONS
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
chkconfig keepalived on

重启机器测试