默认日志存放在 /var/log/messages
一、查看配置文件
# Options for keepalived. See `keepalived --help' output and keepalived(8) and # keepalived.conf(5) man pages for a list of all options. Here are the most # common ones : # # --vrrp -P Only run with VRRP subsystem. # --check -C Only run with Health-checker subsystem. # --dont-release-vrrp -V Dont remove VRRP VIPs & VROUTEs on daemon stop. # --dont-release-ipvs -I Dont remove IPVS topology on daemon stop. # --dump-conf -d Dump the configuration data. # --log-detail -D Detailed log messages. # --log-facility -S 0-7 Set local syslog facility (default=LOG_DAEMON) # KEEPALIVED_OPTIONS="-D"
二、修改配置文件
vi /etc/sysconfig/keepalived
KEEPALIVED_OPTIONS="-D -S 6"
三、修改日志文件,将自定义日志文件写到 /var/log/keepalived.log
vim /etc/rsyslog.conf
local6.* /var/log/keepalived.log
四、重启日志服务,和Keepalive服务
systemctl restart rsyslog keepalived