配置文件

配置文件

我在使用 时遇到了问题haproxy。每次我关闭 virtuoso 时,haproxy 都会显示以下错误消息:

来自 syslogd@master0 的消息,时间:7 月 9 日 14:39:18 ... haproxy[4403]: 后端 virtuoso 没有可用的服务器!

我发现以下内容关联 他们建议使用*.emerg;local2.none  *,但我真的不明白它如何帮助以及它应该位于配置文件的什么位置。

我如何修改配置文件以隐藏错误消息。


配置文件

#$export HAPROXY=/scratch_globa/HAProxy/haproxy-1.5.12-dist

global
        log /dev/log    local0
        log /dev/log    local1 notice
        user    test
        group   test_1
        maxconn 8890
        daemon

defaults
        log     global
        mode    http
        option  httplog
        option  dontlognull

#
#  Listen on *:80 - Send traffic to the backend named "apache"
#
frontend www-http
    bind *:8890
    default_backend virtuoso

#
# Back-end definition.
#
backend virtuoso
    mode http
    balance roundrobin
    server node0 xxx.xxx.x.xxx:8890 check
# 

#############################################
# Start

答案1

您问题中引用的帖子是正确的,您需要告诉 rsyslog(或 syslog)停止向控制台发送消息local0.emerglocal1.emerg

您需要将这些行附加到rsyslog.conf,而不是 HAProxy 配置文件。

或者,你可以改变

global
    log /dev/log    local0
    log /dev/log    local1 notice

global
    log /dev/log    local0 info alert
    log /dev/log    local1 notice alert

这将限制消息的最大严重性alert,如 HAProxy 中所述文档

log <address> [len <length>] <facility> [<level> [<minlevel>]]  

...

<level>    is optional and can be specified to filter outgoing messages. By
           default, all messages are sent. If a level is specified, only
           messages with a severity at least as important as this level
           will be sent. An optional minimum level can be specified. If it
           is set, logs emitted with a more severe level than this one will
           be capped to this level. This is used to avoid sending "emerg"
           messages on all terminals on some default syslog configurations.
           Eight levels are known :
             emerg  alert  crit   err    warning notice info  debug

相关内容