如何重定向Keepalived日志的输出路径
1个回答
2016-04-25 · 百度知道合伙人官方认证企业
兄弟连教育
兄弟连教育成立于2006年,11年来专注IT职业教育,是国内专业的IT技术培训学校。2016年成功挂牌新三板(股票代码:839467)市值过亿。开设专注程序员培训专注php、Java、UI、云计算、Python、HTML5、
向TA提问
关注
展开全部
Keepalived默认所有的日志都是写入到/var/log/message下的,由于message的日志太多了,而Keepalived的日志又很难分离出来,所以本文提供了一个调整Keepalived日志输出路径的方法。
具体操作步骤如下:
一、修改 /etc/sysconfig/keepalived
把KEEPALIVED_OPTIONS="-D" 修改为KEEPALIVED_OPTIONS="-D -d -S 0"
#其中-S指定syslog的facility
二、重启服务
service keepalived restart
三、设置syslog,修改/etc/syslog.conf,添加内容如下
# keepalived -S 0
local0.* /var/log/keepalived.log
注意:local0是l是字符L的小写
四、Keepalived相关管理的知识拓展
/usr/local/keepalived/sbin/keepalived --vrrp -P Only run with VRRP subsystem.
/usr/local/keepalived/sbin/keepalived --check -C Only run with Health-checker subsystem.
/usr/local/keepalived/sbin/keepalived --dont-release-vrrp -V Dont remove VRRP VIPs & VROUTEs on daemon stop.
/usr/local/keepalived/sbin/keepalived --dont-release-ipvs -I Dont remove IPVS topology on daemon stop.
/usr/local/keepalived/sbin/keepalived --dont-fork -n Dont fork the daemon process.
/usr/local/keepalived/sbin/keepalived --use-file -f Use the specified configuration file. Default is /etc/keepalived/keepalived.conf.
/usr/local/keepalived/sbin/keepalived --dump-conf -d Dump the configuration data.
/usr/local/keepalived/sbin/keepalived --log-console -l Log message to local console.
/usr/local/keepalived/sbin/keepalived --log-detail -D Detailed log messages.
/usr/local/keepalived/sbin/keepalived --log-facility -S 0-7 Set syslog facility to LOG_LOCAL[0-7]. (default=LOG_DAEMON)
/usr/local/keepalived/sbin/keepalived --help -h Display this short inlined help screen.
/usr/local/keepalived/sbin/keepalived --version -v Display the version number
/usr/local/keepalived/sbin/keepalived --pid -p pidfile
/usr/local/keepalived/sbin/keepalived --checkers_pid -c checkers pidfile
/usr/local/keepalived/sbin/keepalived --vrrp_pid -r vrrp pidfile
具体操作步骤如下:
一、修改 /etc/sysconfig/keepalived
把KEEPALIVED_OPTIONS="-D" 修改为KEEPALIVED_OPTIONS="-D -d -S 0"
#其中-S指定syslog的facility
二、重启服务
service keepalived restart
三、设置syslog,修改/etc/syslog.conf,添加内容如下
# keepalived -S 0
local0.* /var/log/keepalived.log
注意:local0是l是字符L的小写
四、Keepalived相关管理的知识拓展
/usr/local/keepalived/sbin/keepalived --vrrp -P Only run with VRRP subsystem.
/usr/local/keepalived/sbin/keepalived --check -C Only run with Health-checker subsystem.
/usr/local/keepalived/sbin/keepalived --dont-release-vrrp -V Dont remove VRRP VIPs & VROUTEs on daemon stop.
/usr/local/keepalived/sbin/keepalived --dont-release-ipvs -I Dont remove IPVS topology on daemon stop.
/usr/local/keepalived/sbin/keepalived --dont-fork -n Dont fork the daemon process.
/usr/local/keepalived/sbin/keepalived --use-file -f Use the specified configuration file. Default is /etc/keepalived/keepalived.conf.
/usr/local/keepalived/sbin/keepalived --dump-conf -d Dump the configuration data.
/usr/local/keepalived/sbin/keepalived --log-console -l Log message to local console.
/usr/local/keepalived/sbin/keepalived --log-detail -D Detailed log messages.
/usr/local/keepalived/sbin/keepalived --log-facility -S 0-7 Set syslog facility to LOG_LOCAL[0-7]. (default=LOG_DAEMON)
/usr/local/keepalived/sbin/keepalived --help -h Display this short inlined help screen.
/usr/local/keepalived/sbin/keepalived --version -v Display the version number
/usr/local/keepalived/sbin/keepalived --pid -p pidfile
/usr/local/keepalived/sbin/keepalived --checkers_pid -c checkers pidfile
/usr/local/keepalived/sbin/keepalived --vrrp_pid -r vrrp pidfile
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询