Translated message

A translation of this page exists in English.

Warning message

This translation is outdated. For the most up-to-date information, please refer to the English version.

rhel6: rsyslog imptcp モジュールがハングした TCP 接続を生成するのはなぜですか?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 6
  • rsyslog

Issue

  • rsyslog が TCP (imptcp) モジュールを使用するように設定されています。
  • 実稼働サーバーと中央 rsyslog サーバーの間の確立された TCP 接続で rsyslog がハングしました。

Resolution

rsyslog7 パッケージは RHEL6 で利用でき、この問題の修正が含まれています。

Root Cause

  • クライアントが rsyslog への TCP チャネルを確立しています。
  • 接続を適切に破棄せずにクライアントが消えると (つまり、ネットワークの中断または kill -9 <client>)、rsyslog は着信接続を維持するため、デッド tcp ピアを検出しません。

新しいバージョンの rsyslog には、この状況を検出して TCP チャネルを破棄するための修正が含まれています。

Diagnostic Steps

/etc/rsyslog.conf

# Provides TCP syslog reception                                                                                                                                                                                
$ModLoad imptcp
$InputTCPServerRun 514
# Provides TCP syslog reception                                                                                                                                                                                
$ModLoad imptcp
$InputTCPServerRun 514
$InputPTCPServerKeepAlive on  <=== Keep alive not supported

パッチを含むバージョンの rsyslog デバッグログ、つまり rsyslog7:

1309.441560958:7fb009c3d700: --------imuxsock calling select, active file descriptors (max 3): 3 
1312.047322939:7fb003fff700: imptcp: new connection on listen socket 6
1312.047370787:7fb003fff700: KEEPALIVE enabled for socket 9
1312.123092204:7fb003fff700: imptcp: added socket 9 to epoll[5] set
1312.123140824:7fb003fff700: imptcp going on epoll_wait

netstat:

tcp        0      0 a.b.c.f:514           r.e.w.d:55695         ESTABLISHED -                   keepalive (6781.40/0/0)

conf:

$ModLoad imptcp
$InputPTCPServerRun 514
$InputPTCPServerKeepalive on

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments