keepalived的log日志设置
修改:/etc/sysconfig/keepalived,然后用service来启动。[*]# cat /etc/sysconfig/keepalived
[*]# 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 -d -S 0"
[*]
[*]# service keepalived start
最后设置syslog,修改/etc/syslog.conf.
[*]root@LVS02 ~]# cat /etc/syslog.conf
[*]# Log all kernel messages to the console.
[*]# Logging much else clutters up the screen.
[*]#kern.* /dev/console
[*]
[*]# Log anything (except mail) of level info or higher.
[*]# Don't log private authentication messages!
[*]*.info;mail.none;authpriv.none;cron.none /var/log/messages
[*]
[*]# The authpriv file has restricted access.
[*]authpriv.* /var/log/secure
[*]
[*]# Log all the mail messages in one place.
[*]mail.* -/var/log/maillog
[*]
[*]
[*]# Log cron stuff
[*]cron.* /var/log/cron
[*]
[*]# Everybody gets emergency messages
[*]*.emerg *
[*]
[*]# Save news errors of level crit and higher in a special file.
[*]uucp,news.crit /var/log/spooler
[*]
[*]# Save boot messages also to boot.log
[*]local7.* /var/log/boot.log
[*]
[*]# keepalived -S 0
[*]local0.* /var/log/keepalived.log
重启syslog,设置完成。
# /etc/init.d/syslog restart
页:
[1]