keepalived源码包安装

 

yum install openssl openssl-devel

cd keepalived-2.0.11

./configure --prefix=/usr/local/keepalived  --with-init=systemd --with-systemdsystemunitdir=/usr/lib/systemd/system

make && make install

mkdir /usr/local/keepalived/temp/

mkdir /etc/keepalived/
ln -s /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/keepalived.conf
ln -s /usr/local/keepalived/sbin/keepalived /usr/bin/keepalived

关于 SECURITY VIOLATION - scripts are being executed but script_security not enabled 的告警:

keepalived -t

  SECURITY VIOLATION - scripts are being executed but script_security not enabled.

 

修改启动文件 keepalived.service

  

vim /usr/lib/systemd/system/keepalived.service
#主要修改PIDFile的路径
[Unit]
Description=LVS and VRRP High Availability Monitor
After= network-online.target syslog.target
Wants=network-online.target

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

[Install]
WantedBy=multi-user.target

posted @ 2022-09-14 11:30  CF211  阅读(192)  评论(0编辑  收藏  举报