Dan*_*sta 12 remote logging syslog rsyslog
我试图让 rsyslog 将所有日志发送到 2 个远程服务器,但如果第一个失败,rsyslog 似乎只发送到辅助服务器。
*.* @@server1
*.* @@server2
Run Code Online (Sandbox Code Playgroud)
如果我将上述内容放在 /etc/rsyslog.conf 中,只要 server1 启动,server2 就不会收到任何日志。无论如何,我如何告诉 rsyslog 发送到两台服务器?
此外,作为额外的奖励,如果远程服务器出现故障,我想使用 2 个不同的本地“缓冲区”文件进行本地存储。
Aar*_*ley 18
从 转发到多台服务器;
然而,重要的是要知道,完整的指令集构成了一个动作。因此,您不能简单地添加(仅)第二条转发规则,还需要复制规则配置。小心为第二个操作使用不同的队列文件名,否则你会搞砸你的系统。
因此,实际上,您必须使用 2 个不同的本地队列。
配置工作目录。
$WorkDirectory /var/spool/rsyslog
Run Code Online (Sandbox Code Playgroud)
配置转发规则。
$ActionQueueType LinkedList
$ActionQueueFileName Forward1
$ActionResumeRetryCount -1
$ActionQueueSaveOnShutdown on
*.* @@server1
$ActionQueueType LinkedList
$ActionQueueFileName Forward2
$ActionResumeRetryCount -1
$ActionQueueSaveOnShutdown on
*.* @@server2
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
33641 次 |
最近记录: |