LoginSignup
2
1

More than 3 years have passed since last update.

nslcd.conf オプションメモ

Last updated at Posted at 2021-04-25

これを書いた背景

OSは、ubuntu18.04だが、理由あって、libnss_ldap.so からlibnss-ldapd.soに変更している。その結果、LDAP Serverに対して、通信はできているが、syslogに下記のようなメッセージが頻繁にでるようになった。

syslog
Apr 21 02:00:11 my_workbench nslcd[1521]: [39dc03] <passwd="daikumatan"> ldap_result() timed out

これが原因かわからないが、Slurmの srun のジョブが失敗するという問題がでた。LDAPなしにすると、srun は完全に機能する。何かしら関係はありそうである。

srun: error: Task launch for 28.0 failed on node debug-dy-t2micro-4: Communication connection failure
srun: error: Application launch failed:
Communication connection failure srun:
Job step aborted:
Waiting up to 182 seconds for job step to finish.
srun: error: Timed out waiting for job step to complete FALSE

また、LDAP Serverは on-premで LDAP Client はAWS、途中は Direct Connect でつながれているという環境である。
(本当はLDAPサーバのレプリカがAWS上にもほしいところであるが、これも現状ルール上難しい)

そこで、nslcdの Timing/reconnect options に関してまずは調査した。

nslcd Options

Timing/reconnect options

bind_timelimit <sec>

ディレクトリサーバーに接続するときに使用する制限時間(秒単位)を指定します。

  • デフォルト値: 10 [sec]
  • これは、timelimit で指定された時間制限とは異なり、接続のセットアップにのみ影響します。
  • すべてのLDAPクライアントライブラリが接続タイムアウトの設定をサポートしているわけではないことに注意してください。

timelimit <sec>

LDAPサーバーからの応答を待機する時間制限(秒単位)を指定します。

  • デフォルト値: 0 [sec]
  • デフォルト値の0は検索が完了するまで無期限に待機します。

idle_timelimit <sec>

LDAPサーバーへの接続が閉じられるまでの非アクティブ期間(秒単位)を指定します。

  • デフォルトでは、接続がタイムアウトしません。

reconnect_sleeptime <sec>

すべてのLDAPサーバーへの接続が失敗したときにスリープする秒数を指定します。

  • デフォルト値: 1 [sec]
  • デフォルト値の1は、最初の失敗と最初の再試行の間の待機時間です。

reconnect_retrytime <sec>

LDAPサーバーが永続的に使用不可であると見なされるまでの時間を指定します。

  • デフォルト値: 10 [sec]
  • この時間に達すると、再試行はこの期間に1回だけ実行されます。

上記の再接続ロジックは、nslcdとLDAPサーバーの間で使用されるメカニズムであることに注意してください。一方の端のNSSおよびPAMクライアントライブラリともう一方のnslcdの間のメカニズムは単純で、nslcdへの書き込みの場合は10秒、回答の読み取りの場合は60秒の固定コンパイル時間です。 nslcd自体の読み取り時間は0.5秒、書き込み時間は60秒です。

テスト結果

まずは上記まとめまで。
テスト結果は今後、記載しますー

Note

下記、参考3

If you set nslcd's idle_timelimit less than timeout client for haproxy, you shouldn't get these messages.

下記、参考4

調べてみると、LDAP サーバ/クライアントの idle_timelimit の値がサーバの方が小さいためのようである。
クライアントがサーバから強制切断されると、何故に固まるようである、、、バグ?
ちなみに、Leopard Server のOpen Directory の idle_timelimit が 300 秒がデフォルトになっており、新しめのCentOS/Fedoraのauthconfig が勝手に 3600秒に設定してくれる。

参考

  1. https://arthurdejong.org/nss-pam-ldapd/nslcd.conf.5
  2. https://bugs.launchpad.net/ubuntu/+source/nss-pam-ldapd/+bug/1074213
  3. https://serverfault.com/questions/920675/openldap-with-haproxy-ldap-result-failed-cant-contact-ldap-server
  4. https://moimoitei.blogspot.com/2007/11/ldap-idletimelimit-missmatch.html
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1