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

keepalived设置日志文件

时间:2014-09-29 17:01:51      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:keepalived设置日志文件

以前配置keepalived时候所有的日志都是写入到/var/log/message下的,由于message的日志太多了而keepalived的日志又很那分离出来,所以研究了一下keepalived的日志设置。
具体操作步骤如下:因为我的keepalived 是./configure 默认配置安装。
然后使用的以下操作命令
    cp /usr/local/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/keepalived
    cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/keepalived 
    cp /usr/local/etc/keepalived/keepalived.conf /etc/keepalived/keepalived.conf
    cp /usr/local/sbin/keepalived /sbin/keepalived
我们只需要修改 /etc/sysconfig/keepalived 就可以了
把KEEPALIVED_OPTIONS="-D" 修改为KEEPALIVED_OPTIONS="-D -d -S 0"
最后设置syslog,修改/etc/rsyslog.conf
最后添加:
# keepalived -S 0 
local0.*                                                /var/log/keepalived.log
重新启动日志
/etc/init.d/rsyslog restart
使用以下命令进行验证
/etc/init.d/keepalived restart;tailf /var/log/keepalived.log

本文出自 “yaoshenshen” 博客,谢绝转载!

keepalived设置日志文件

标签:keepalived设置日志文件

原文地址:http://shenshen.blog.51cto.com/156530/1559374

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