重启服务器后发现k8s很多pod起不来,发现pv全部挂掉了

排查原因

systemctl status nfs

发现nfs起不来,原因是rpcbind 起不来。。。。

systemctl start rpcbind 
    A dependency job for rpcbind.service failed. See 'journalctl -xe' for details.

查看错误

# journalctl -xe

Sep 10 23:01:33 m1 polkitd[1264]: Registered Authentication Agent for unix-process:25781:382062 (system bus name :1.61 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationA
Sep 10 23:01:33 m1 systemd[1]: rpcbind.socket failed to listen on sockets: Address family not supported by protocol
Sep 10 23:01:33 m1 systemd[1]: Failed to listen on RPCbind Server Activation Socket.
-- Subject: Unit rpcbind.socket has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit rpcbind.socket has failed.
--
-- The result is failed.
Sep 10 23:01:33 m1 polkitd[1264]: Unregistered Authentication Agent for unix-process:25781:382062 (system bus name :1.61, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from
Sep 10 23:01:33 m1 systemd[1]: Dependency failed for RPC bind service.
-- Subject: Unit rpcbind.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit rpcbind.service has failed.
--
-- The result is dependency.
Sep 10 23:01:33 m1 systemd[1]: Job rpcbind.service/start failed with result 'dependency'.

发现是ipv6没开启导致的,解决办法:注释掉rpcbind.socket监听ipv6地址


一步到胃脚本
socket=`find /etc/ -name '*rpcbind.socket*'`
sed -i 's/ListenStream=\[::\]:111/\#ListenStream=[::]:111/g' $socket
systemctl daemon-reload
systemctl restart rpcbind.socket
systemctl start nfs

搞定!

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐