背景:
操作系统:AnolisOS8.6
内核:4.19.91-26.an8.x86_64
问题:手动安装好 nfs 和 rpc 后 showmount -e localhost 报错:rpc mount export: RPC: Unable to receive; errno = Connection refused
[root@rancher ~]# cat /etc/redhat-release
Anolis OS release 8.6
[root@rancher ~]# uname -r
4.19.91-26.an8.x86_64
[root@rancher ~]# showmount -e localhost
rpc mount export: RPC: Unable to receive; errno = Connection refused
[root@rancher ~]# systemctl status rpcbind.service
● rpcbind.service - RPC Bind
Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-05-17 18:42:53 CST; 14h ago
Docs: man:rpcbind(8)
Main PID: 1743413 (rpcbind)
Tasks: 1 (limit: 100359)
Memory: 1.2M
CGroup: /system.slice/rpcbind.service
└─1743413 /usr/bin/rpcbind -w -f
5月 17 18:42:53 rancher systemd[1]: Starting RPC Bind...
5月 17 18:42:53 rancher systemd[1]: Started RPC Bind.
[root@rancher ~]# systemctl status nfs-server.service
● nfs-server.service - NFS server and services
Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)
Drop-In: /run/systemd/generator/nfs-server.service.d
└─order-with-mounts.conf
Active: active (exited) since Wed 2023-05-17 17:55:08 CST; 14h ago
Process: 1022954 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)
Process: 1022950 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUCCESS)
Process: 1022946 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=0/SUCCESS)
Process: 1025674 ExecStart=/bin/sh -c if systemctl -q is-active gssproxy; then systemctl reload gssproxy ; fi (code=exited, status=0/SUCCESS)
Process: 1025640 ExecStart=/usr/sbin/rpc.nfsd (code=exited, status=0/SUCCESS)
Process: 1025634 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
Main PID: 1025674 (code=exited, status=0/SUCCESS)
5月 17 17:55:08 rancher systemd[1]: Starting NFS server and services...
5月 17 17:55:08 rancher systemd[1]: Started NFS server and services.
[root@rancher ~]# systemctl status nfs-mountd.service
● nfs-mountd.service - NFS Mount Daemon
Loaded: loaded (/usr/lib/systemd/system/nfs-mountd.service; static; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2023-05-17 18:46:53 CST; 14h ago
Process: 1805595 ExecStart=/usr/sbin/rpc.mountd (code=exited, status=0/SUCCESS)
Main PID: 1805596 (code=exited, status=1/FAILURE)
5月 17 18:46:53 rancher systemd[1]: Starting NFS Mount Daemon...
5月 17 18:46:53 rancher systemd[1]: Started NFS Mount Daemon.
5月 17 18:46:53 rancher systemd[1]: nfs-mountd.service: Main process exited, code=exited, status=1/FAILURE
5月 17 18:46:53 rancher systemd[1]: nfs-mountd.service: Failed with result 'exit-code'.
排查后发现,nfs-mountd.service 服务状态不正常导致文件无法正常挂载
解决:nfs-utils包降级
rpm -e nfs-utils-1:2.3.3-51.0.1.an8.x86_64 rpm -qa|grep nfs-utils rpm -ivh nfs-utils-2.3.3-41.an8_4.3.x86_64.rpm nfs 41的包下载位置:https://mirrors.aliyun.com/anolis/8.4/BaseOS/x86_64/os/Packages/
以下是我的操作步骤 仅供参考
[root@rancher nfs]# rpm -qa |grep nfs
sssd-nfs-idmap-2.6.2-4.an8_6.1.x86_64
nfs-utils-2.3.3-51.0.1.an8.x86_64
libnfsidmap-2.3.3-51.0.1.an8.x86_64
[root@rancher nfs]# rpm -e nfs-utils-2.3.3-51.0.1.an8.x86_64
错误:依赖检测失败:
nfs-utils 被 (已安裝) libvirt-daemon-driver-storage-core-8.0.0-5.module+an8.6.0+10755+cbf458a5.x86_64
[root@rancher nfs]# dnf install -y nfs-utils rpcbind
上次元数据过期检查:3:19:18 前,执行于 2023年05月18日 星期四 05时54分27秒。
模块依赖问题:
问题: 模块 rust-toolset:rhel8:8050020211112063729:f73640c0.x86_64 需要 module(llvm-toolset:rhel8),但没有提供
- 模块 llvm-toolset:rhel8:8050020211109183021:b4937e53.x86_64 与 module(llvm-toolset:an8) (由 llvm-toolset
- 模块 llvm-toolset:an8:8060020220704090228:85f8c8bf.x86_64 与 module(llvm-toolset:rhel8) (由 llvm-toolset
- 模块 llvm-toolset:rhel8:8050020211202154934:b4937e53.x86_64 与 module(llvm-toolset:an8) (由 llvm-toolset
- 模块 llvm-toolset:an8:8060020220704090228:85f8c8bf.x86_64 与 module(llvm-toolset:rhel8) (由 llvm-toolset
- 冲突的请求
软件包 nfs-utils-1:2.3.3-51.0.1.an8.x86_64 已安装。
软件包 rpcbind-1.2.5-8.0.1.an8.x86_64 已安装。
依赖关系解决。
无需任何处理。
完毕!
[root@rancher nfs]# dnf autoremove nfs-utils-1:2.3.3-51.0.1.an8.x86_64 #移除nfs-utils-1:2.3.3-51.0.1.an8.x86_64的相关依赖包
[root@rancher opt]# mkdir anolis8.6_nfs
[root@rancher opt]# cd anolis8.6_nfs/
[root@rancher anolis8.6_nfs]# ll
[root@rancher anolis8.6_nfs]# dnf install -y nfs-utils rpcbind --downloadonly --downloaddir=.
上次元数据过期检查:3:31:09 前,执行于 2023年05月18日 星期四 05时54分27秒。
模块依赖问题:
问题: 模块 rust-toolset:rhel8:8050020211112063729:f73640c0.x86_64 需要 module(llvm-toolset:rhel8),但没有提供者可以被安装
...
[root@rancher anolis8.6_nfs]# ll
总用量 776
-rw-r--r-- 1 root root 121676 5月 18 09:25 gssproxy-0.8.0-19.el8.x86_64.rpm
-rw-r--r-- 1 root root 67792 5月 18 09:25 keyutils-1.5.10-9.el8.x86_64.rpm
-rw-r--r-- 1 root root 16100 5月 18 09:25 libverto-libevent-0.3.0-5.el8.x86_64.rpm
-rw-r--r-- 1 root root 511924 5月 18 09:25 nfs-utils-2.3.3-46.el8.x86_64.rpm
-rw-r--r-- 1 root root 71472 5月 18 09:25 rpcbind-1.2.5-8.el8.x86_64.rpm
[root@rancher anolis8.6_nfs]# dnf install -y nfs-utils rpcbind
上次元数据过期检查:3:32:03 前,执行于 2023年05月18日 星期四 05时54分27秒。
模块依赖问题:
问题: 模块 rust-toolset:rhel8:8050020211112063729:f73640c0.x86_64 需要 module(llvm-toolset:rhel8),但没有提供者可以被安装
...
已安装:
gssproxy-0.8.0-19.el8.x86_64 keyutils-1.5.10-9.el8.x86_64 libverto-libevent-0.3.0-5.el8.x86_64
nfs-utils-1:2.3.3-46.el8.x86_64 rpcbind-1.2.5-8.el8.x86_64
完毕!
[root@rancher anolis8.6_nfs]# systemctl enable --now rpcbind
[root@rancher anolis8.6_nfs]# systemctl enable --now nfs-server
Created symlink /etc/systemd/system/multi-user.target.wants/nfs-server.service → /usr/lib/systemd/system/nfs-server.service.
[root@rancher anolis8.6_nfs]# systemctl status nfs-server
[root@rancher anolis8.6_nfs]# systemctl status rpcbind
[root@rancher anolis8.6_nfs]# systemctl status nfs-mountd.service
查看以上服务均为启动状态则正常
[root@docker01 ~]# showmount -e 172.20.2.97
Export list for 172.20.2.97:
/opt/nfs/rancher 172.20.2.0/24
恢复正常!