【发布时间】:2013-10-30 13:03:04
【问题描述】:
我有 syslog 成功地将日志转发到上游服务器,如下所示:
$MainMsgQueyeType LinkedList
$MainMsgQueueSize 10000
$MainMsgQueusDiscardMark 8000
$MainMsgQueueDiscardSeverity 1
$MainMsgQueueSaveOnShutdown off
$MainMsgQueueTimeoutEnqueue 0
$ActionQueueType LinkedList # in memory queue
$ActionQueueFileName fwdRule1 # unique name prefix for spool files
$ActionQueueSize 10000 # Only allow 10000 elements in the queue
$ActionQueueDiscardMark 8000 # Only allow 8000 elements in the queue before dropping msgs
$ActionQueueDiscardSeverity 1 # Discard Alert,Critical,Error,Warning,Notice,Info,Debug, NOT Emergency
$ActionQueueSaveOnShutdown off # save messages to disk on shutdown
$ActionQueueTimeoutEnqueue 0
$ActionResumeRetryCount -1 # infinite retries if host is down
$RepeatedMsgReduction off
*.* @@remoteserver.mynetwork.com:5544
在远程服务器上,我有一些东西可以谈论 syslog 并在该端口上侦听。为了测试,我有一个简单的日志客户端,每秒将 100 条消息记录到 syslog。
这一切都很好,我已经配置了上面的队列,以便在远程服务器不可用的情况下,队列开始填满,然后最终消息被丢弃,从而保护 syslog 不会阻塞其日志记录客户端。
当我在 remoteserver:5544 上停止远程日志接收器时,syslog 仍然稳定(队列已满/满),但是当我稍后重新启动远程日志接收器时,rsyslog 再次检测到服务器,重新建立 TCP 连接
但是 - syslog 仅将 1 条消息转发给它,尽管队列中有数千条消息,并且日志记录客户端每秒继续记录 100 条消息
如何让系统日志在检测到远程服务器已备份后再次开始转发消息? (无需重新启动系统日志)。
我正在使用 rsyslog 4.6.2-2
我正在使用,并且想要使用 TCP
【问题讨论】: