码迷,mamicode.com
首页 > 其他好文 > 详细

Keepalived日志

时间:2017-03-31 16:58:14      阅读:485      评论:0      收藏:0      [点我收藏+]

标签:ges   stop   interface   添加   seconds   repo   keep   stat   init.d   

Keepalived日志
默认日志存放在系统日志:/var/log/messages下

[root@lb01 /]# tail -f  /var/log/messages
Oct  6 13:30:07 lb01 Keepalived_vrrp[3671]: Kernel is reporting: interface eth0 UP
Oct  6 13:30:07 lb01 Keepalived_vrrp[3671]: VRRP_Instance(VI_1) Transition to MASTER STATE
Oct  6 13:30:08 lb01 Keepalived_vrrp[3671]: VRRP_Instance(VI_1) Entering MASTER STATE
Oct  6 13:30:08 lb01 Keepalived_vrrp[3671]: VRRP_Instance(VI_1) setting protocol VIPs.
Oct  6 13:30:08 lb01 Keepalived_vrrp[3671]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 192.168.119.150
Oct  6 13:30:08 lb01 Keepalived_healthcheckers[3670]: Netlink reflector reports IP 192.168.119.150 added
Oct  6 13:30:13 lb01 Keepalived_vrrp[3671]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 192.168.119.150
Oct  6 13:30:48 lb01 dhclient[856]: DHCPREQUEST on eth0 to 192.168.119.254 port 67 (xid=0x32903a31)
Oct  6 13:30:48 lb01 dhclient[856]: DHCPACK from 192.168.119.254 (xid=0x32903a31)
Oct  6 13:30:50 lb01 dhclient[856]: bound to 192.168.119.128 -- renewal in 783 seconds.

 

把日志单独存放
修改/etc/sysconfig/keepalived
把KEEPALIVED_OPTIONS="-D" 修改为:KEEPALIVED_OPTIONS="-D -d -S 0"

[root@lb01 /]# vim /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"

 

在/etc/rsyslog.conf 末尾添加
[root@localhost~]# vim /etc/rsyslog.conf
  local0.*             /var/log/keepalived.log

重启日志记录服务
 # /etc/init.d/rsyslog restart
 
重启keepalived
 #/etc/init.d/keepalived restart

 

Keepalived日志

标签:ges   stop   interface   添加   seconds   repo   keep   stat   init.d   

原文地址:http://www.cnblogs.com/sunziying/p/6651841.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!