これはネーム サービス キャッシュ デーモンです .実行中のプログラムのグループとパスワードのルックアップを処理し、NIS や LDAP などの変更の取得に時間がかかる可能性のあるサービスの次のクエリのためにルックアップ結果をキャッシュします。これらのサービスを実行している場合は、nscd を実行することをお勧めします。
このデーモンは、ネーム サービス、/etc/hosts、DNS、NIS、NIS+ などのデータをキャッシュできます。これはマシン上のローカル ユーザー専用です。キャッシュは関数を glibc でラップすることによって実現されるため、リモート ユーザーはこのキャッシュを使用できません。 .元の DNS データが変更されても、キャッシュの変更には時間がかかるため、このデーモンの使用には注意してください。
サービス コントロール
「chkconfig –list [サービス]」の例
# chkconfig --list nscd nscd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
利用可能なサービス利用オプション:
# service nscd
Usage: /etc/init.d/nscd {start|stop|status|restart|reload|condrestart} サービスの開始:
# service nscd start Starting nscd: [ OK ]
サービスの停止:
# service nscd stop Stopping nscd: [ OK ]
サービスのステータスを確認してください:
# service nscd status nscd (pid 15382) is running...
サービスの再起動:
# service nscd restart Stopping nscd: [ OK ] Starting nscd: [ OK ]
構成ファイルを再読み込みするためにサービスをリロードしています:
# service nscd reload Reloading nscd: [ OK ]
サービスの条件付き再起動:
# service nscd condrestart Stopping nscd: [ OK ] Starting nscd: [ OK ]
– 実行するデーモン:/usr/sbin/nscd
– ロードするモジュール:なし
構成
構成ファイルの例:
# nscd will run as "nscd" user and not as root.
server-user nscd
# nscd set no debug output. if level is higher than 0, nscd will create some debug output, the higher the level, the more output is produced
debug-level 0
# disable paranoia mode, nscd will not restart itself periodically
paranoia no
# enables the specified service "passwd" cache
enable-cache passwd yes
# Sets the TTL (time-to-live) for positive entries (successful queries) in the specified cache for "passwd" to 600 seconds
positive-time-to-live passwd 600
# Sets the TTL (time-to-live) for negative entries (unsuccessful queries) in the specified cache for "passwd" to 20 seconds
negative-time-to-live passwd 20
# Sets the internal hash table size to 211
suggested-size passwd 211
# Enables checking the file belonging to the specified service "passwd" for changes
check-files passwd yes
# Keep the content of the cache for service "passwd" over server restarts;
persistent passwd yes
# The memory mapping of the nscd databases for service "passwd" is shared with the clients
shared passwd yes
# The maximum allowable size for the service "passwd" set to be 33554432 bytes
max-db-size passwd 33554432
# The .byname requests will add to passwd.byuid or group.bygid cache.
auto-propagate passwd yes トラブルシューティング
NSCD デーモンを再起動、停止、または開始しても、キャッシュがフラッシュされないことがあります。次の方法を使用して、古いキャッシュを明示的にフラッシュする必要があります。
CentOS/RHEL 7 より前 :
# service nscd reload
CentOS/RHEL 7 以降 :
# systemctl restart nscd