syslog 服务重启在 centos 中花费太多时间
syslog service restart takes too much time in centos
在我的系统 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.
如何减少重启时间?
local6.* @@<ipv4_addr>:6514
的用法表明您正在使用 TCP 协议而不是 UDP(您应该只使用一个 @
)。
由于您使用的是 TCP,因此必须初始化和维护客户端与服务器之间的连接,这可能需要更长的时间。
如果时间对您来说确实是个大问题,并且您没有遵守消息一致性(UDP 可能会导致消息丢失),您应该看看 UDP 以减少启动时间。
如果您想坚持使用 TCP 协议,我建议您调查您的网络架构以improve/prioritize客户端和服务器之间的路径。
在我的系统 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.
如何减少重启时间?
local6.* @@<ipv4_addr>:6514
的用法表明您正在使用 TCP 协议而不是 UDP(您应该只使用一个 @
)。
由于您使用的是 TCP,因此必须初始化和维护客户端与服务器之间的连接,这可能需要更长的时间。
如果时间对您来说确实是个大问题,并且您没有遵守消息一致性(UDP 可能会导致消息丢失),您应该看看 UDP 以减少启动时间。
如果您想坚持使用 TCP 协议,我建议您调查您的网络架构以improve/prioritize客户端和服务器之间的路径。