首页 > 代码库 > keepalived设置日志文件
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设置日志文件
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。