syslog服务重启需要花费太多时间才能完成

问题描述 投票:0回答:1

在我的系统rsyslog服务运行中,更改rsyslog配置后我需要重启rsyslog服务,但有时需要太多时间(大约1.30分钟1)重启服务。 (用于发送系统日志消息的TLS连接)

rsyslog.conf文件包含:

$SystemLogRateLimitInterval 0

$DefaultNetstreamDriver          gtls # gnu TLS
$DefaultNetstreamDriverCAFile    /etc/certs/ca.crt
$ActionSendStreamDriverMode      1
$ActionSendStreamDriverAuthMode  x509/certvalid
local6.*    @@<ipv4_addr>:6514

journalctl -u rsyslog.service命令输出:

Oct 15 11:43:26 centos74 rsyslogd[9989]:  [origin software="rsyslogd" swVersion="8.24.0" x-pid="9989" x-info="http://www.rsyslog.com"] exiting on signal 15.
Oct 15 11:43:26 centos74 systemd[1]: Stopping System Logging Service...
Oct 15 11:44:56 centos74 systemd[1]: rsyslog.service stop-sigterm timed out. Killing.
Oct 15 11:44:56 centos74 systemd[1]: rsyslog.service: main process exited, code=killed, status=9/KILL
Oct 15 11:44:56 centos74 systemd[1]: Unit rsyslog.service entered failed state.
Oct 15 11:44:56 centos74 systemd[1]: rsyslog.service failed.
Oct 15 11:44:56 centos74 systemd[1]: Starting System Logging Service...
Oct 15 11:44:56 centos74 rsyslogd[11480]:  [origin software="rsyslogd" swVersion="8.24.0" x-pid="11480" x-info="http://www.rsyslog.com"] start
Oct 15 11:44:56 centos74 systemd[1]: Started System Logging Service.

如何减少重启时间?

centos rsyslog
1个回答
0
投票

使用local6.* @@<ipv4_addr>:6514表明您使用的是TCP协议而不是UDP(您应该只使用一个@)。由于您使用的是TCP,因此必须初始化并维护客户端和服务器之间的连接,这可能需要更长的时间。

如果时间对您来说确实是一个大问题,并且您没有符合消息一致性(UDP可能会导致消息丢失),那么您应该查看UDP以减少启动时间。

如果您想坚持使用TCP协议,我建议您调查您的网络架构,以改进/优先考虑客户端和服务器之间的路径。

© www.soinside.com 2019 - 2024. All rights reserved.