作系統:centos7.9
現象突然間通過 ssh、xshell等客戶端工具連接時,連接速度緩慢,需要耗時20秒左右才能連接上
排查思路:
1. 查看操作系統日志
從系統日志里看到較多的錯誤,這個可能是一個bug (現象類似,但是日志并不完全一樣)
參考redhat 官方的方案: https://access.redhat.com/solutions/3900301
3. 解決方案
從redhat 官網介紹看該問題和使用nsswitch.conf 里使用NIS 有關, 可以按照redhat 提供的方案試一下
/usr/lib/systemd/system/rpcbind.socket as /etc/systemd/system/rpcbind.socket (可要可不可要哦)
編輯這個文件 (如果沒有文件則創建)
/etc/systemd/system/rpcbind.socket
編輯后內容如下(建議直接復制)
[Unit]
Description=RPCbind Server Activation Socket[Socket]
ListenStream=/var/run/rpcbind.sock# RPC netconfig can't handle ipv6/ipv4 dual sockets
# Workaround for RHBZ 1531486
#BindIPv6Only=ipv6-only
#ListenStream=0.0.0.0:111
#ListenDatagram=0.0.0.0:111
#ListenStream=[::]:111
#ListenDatagram=[::]:111[Install]
WantedBy=sockets.target
保存后執行 systemctl daemon-reload
然后重啟。