![使用 NFS 进行安装导致操作不允许](https://linux22.com/image/781919/%E4%BD%BF%E7%94%A8%20NFS%20%E8%BF%9B%E8%A1%8C%E5%AE%89%E8%A3%85%E5%AF%BC%E8%87%B4%E6%93%8D%E4%BD%9C%E4%B8%8D%E5%85%81%E8%AE%B8.png)
我跟着来自 DigitalOcean 的一篇文章将备份机器 ( ) 中的目录挂载到192.168.100.82
服务机器 ( 192.168.100.81
) 上:
mount -vvv 192.168.100.82:/var/nfs/general /nfs/general
但是它失败并显示以下日志:
mount.nfs: timeout set for Tue Nov 15 13:17:28 2022
mount.nfs: trying text-based options 'vers=4.2,addr=192.168.100.82,clientaddr=192.168.100.81'
mount.nfs: mount(2): Operation not permitted
mount.nfs: trying text-based options 'addr=192.168.100.82'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.100.82 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.100.82 prog 100005 vers 3 prot UDP port 20048
mount.nfs: mount(2): Stale file handle
mount.nfs: Operation not permitted
执行chmod 777 /var/nfs/general
、卸载(使用-f
和-l
选项)、fsid=0
在导出配置中使用、nfs-client.target
在服务机器上重新启动、在备份机器上重新启动nfs-server.service
和nfs-mountd.service
均不起作用。
两台机器的操作系统都是 Centos 8,我以root
用户身份执行所有这些操作。
以下是其他信息:
导出配置来自/etc/exports
:
/var/nfs/general 192.168.100.81(rw,sync,no_root_squash,no_subtree_check)
/var/log/messages
备份机上的相关日志:
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_exchange_id rqstp=00000000f62bc763 exid=00000000da7bb5db clname.len=18 clname.data=000000005dd36ddb ip_addr=192.168.100.82 flags 101, spa_how 0
Nov 15 13:20:57 Lin-Backup kernel: renewing client (clientid 63734cca/c31df923)
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_exchange_id seqid 0 flags 20001
Nov 15 13:20:57 Lin-Backup kernel: nfsv4 compound returned 0
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_exchange_id rqstp=00000000f62bc763 exid=00000000da7bb5db clname.len=18 clname.data=000000005dd36ddb ip_addr=192.168.100.82 flags 101, spa_how 0
Nov 15 13:20:57 Lin-Backup kernel: renewing client (clientid 63734cca/c31df924)
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_exchange_id seqid 0 flags 20001
Nov 15 13:20:57 Lin-Backup kernel: nfsv4 compound returned 0
Nov 15 13:20:57 Lin-Backup kernel: renewing client (clientid 63734cca/c31df924)
Nov 15 13:20:57 Lin-Backup kernel: check_slot_seqid enter. seqid 1 slot_seqid 0
Nov 15 13:20:57 Lin-Backup kernel: NFSD: move_to_confirm nfs4_client 0000000022350332
Nov 15 13:20:57 Lin-Backup kernel: renewing client (clientid 63734cca/c31df924)
Nov 15 13:20:57 Lin-Backup kernel: renewing client (clientid 63734cca/c31df924)
Nov 15 13:20:57 Lin-Backup kernel: nfsv4 compound returned 0
Nov 15 13:20:57 Lin-Backup kernel: __find_in_sessionid_hashtbl: 1668500682:3273521444:2662:0
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_sequence: slotid 0
Nov 15 13:20:57 Lin-Backup kernel: check_slot_seqid enter. seqid 1 slot_seqid 0
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_umh_cltrack_upcall: cmd: create
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_umh_cltrack_upcall: arg: 4c696e7578204e465376342e3220636f7265
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_umh_cltrack_upcall: env0: NFSDCLTRACK_CLIENT_HAS_SESSION=Y
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_umh_cltrack_upcall: env1: NFSDCLTRACK_GRACE_START=1668500682
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_umh_cltrack_upcall: /sbin/nfsdcltrack return value: 0
Nov 15 13:20:57 Lin-Backup kernel: nfsv4 compound returned 0
Nov 15 13:20:57 Lin-Backup kernel: --> nfsd4_store_cache_entry slot 0000000066b2707e
Nov 15 13:20:57 Lin-Backup kernel: renewing client (clientid 63734cca/c31df924)
Nov 15 13:20:57 Lin-Backup kernel: __find_in_sessionid_hashtbl: 1668500682:3273521444:2662:0
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_sequence: slotid 0
Nov 15 13:20:57 Lin-Backup kernel: check_slot_seqid enter. seqid 2 slot_seqid 1
Nov 15 13:20:57 Lin-Backup kernel: nfsv4 compound returned 0
Nov 15 13:20:57 Lin-Backup kernel: --> nfsd4_store_cache_entry slot 0000000066b2707e
Nov 15 13:20:57 Lin-Backup kernel: renewing client (clientid 63734cca/c31df924)
Nov 15 13:20:57 Lin-Backup kernel: __find_in_sessionid_hashtbl: 1668500682:3273521444:2662:0
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_sequence: slotid 0
Nov 15 13:20:57 Lin-Backup kernel: check_slot_seqid enter. seqid 3 slot_seqid 2
Nov 15 13:20:57 Lin-Backup kernel: nfsv4 compound returned 1
Nov 15 13:20:57 Lin-Backup kernel: --> nfsd4_store_cache_entry slot 0000000066b2707e
Nov 15 13:20:57 Lin-Backup kernel: renewing client (clientid 63734cca/c31df924)
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_destroy_session: 1668500682:3273521444:2662:0
Nov 15 13:20:57 Lin-Backup kernel: __find_in_sessionid_hashtbl: 1668500682:3273521444:2662:0
Nov 15 13:20:57 Lin-Backup kernel: NFSD: warning: no callback path to client Linux NFSv4.2 core: error -22
Nov 15 13:20:57 Lin-Backup kernel: renewing client (clientid 63734cca/c31df924)
Nov 15 13:20:57 Lin-Backup kernel: nfsv4 compound returned 0
Nov 15 13:20:57 Lin-Backup kernel: renewing client (clientid 63734cca/c31df924)
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_umh_cltrack_upcall: cmd: remove
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_umh_cltrack_upcall: arg: 4c696e7578204e465376342e3220636f7265
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_umh_cltrack_upcall: env0: (null)
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_umh_cltrack_upcall: env1: (null)
Nov 15 13:20:57 Lin-Backup kernel: nfsd4_umh_cltrack_upcall: /sbin/nfsdcltrack return value: 0
Nov 15 13:20:57 Lin-Backup kernel: nfsv4 compound returned 0
Nov 15 13:20:57 Lin-Backup rpc.mountd[3298271]: authenticated mount request from 192.168.100.81:1018 for /var/nfs/general (/var/nfs/general)
Nov 15 13:20:57 Lin-Backup kernel: nfsd: FSINFO(3) 28: 00070001 0607e3c0 00000000 038c7eae 044b2ce4 ac3b53ab
Nov 15 13:20:57 Lin-Backup kernel: nfsd: FSINFO(3) 28: 00070001 0607e3c0 00000000 038c7eae 044b2ce4 ac3b53ab
/var/log/messages
服务机器上的相关日志:
Nov 15 13:22:59 Lin-Service kernel: --> nfs4_proc_create_session clp=000000003ff426d5 session=00000000cda333b9
Nov 15 13:22:59 Lin-Service kernel: nfs4_init_channel_attrs: Fore Channel : max_rqst_sz=1049620 max_resp_sz=1049480 max_ops=8 max_reqs=64
Nov 15 13:22:59 Lin-Service kernel: nfs4_init_channel_attrs: Back Channel : max_rqst_sz=4096 max_resp_sz=4096 max_resp_sz_cached=0 max_ops=2 max_reqs=16
Nov 15 13:22:59 Lin-Service kernel: slot table setup returned 0
Nov 15 13:22:59 Lin-Service kernel: nfs4_proc_create_session client>seqid 2 sessionid 1668500682:3273521446:2663:0
Nov 15 13:22:59 Lin-Service kernel: <-- nfs4_proc_create_session
Nov 15 13:22:59 Lin-Service kernel: --> nfs41_proc_reclaim_complete
Nov 15 13:22:59 Lin-Service kernel: --> _nfs41_proc_secinfo_no_name
Nov 15 13:22:59 Lin-Service kernel: --> nfs41_call_sync_prepare data->seq_server 00000000a5776490
Nov 15 13:22:59 Lin-Service kernel: --> nfs4_reclaim_complete_done
Nov 15 13:22:59 Lin-Service kernel: nfs41_sequence_process: Error 0 free the slot
Nov 15 13:22:59 Lin-Service kernel: <-- nfs4_reclaim_complete_done
Nov 15 13:22:59 Lin-Service kernel: <-- nfs41_proc_reclaim_complete status=0
Nov 15 13:22:59 Lin-Service kernel: --> nfs41_call_sync_prepare data->seq_server 00000000a5776490
Nov 15 13:22:59 Lin-Service kernel: nfs41_sequence_process: Error 0 free the slot
Nov 15 13:22:59 Lin-Service kernel: <-- _nfs41_proc_secinfo_no_name status=0
Nov 15 13:22:59 Lin-Service kernel: --> nfs41_call_sync_prepare data->seq_server 00000000a5776490
Nov 15 13:22:59 Lin-Service kernel: nfs41_sequence_process: Error 0 free the slot
Nov 15 13:22:59 Lin-Service kernel: --> nfs4_proc_destroy_session
Nov 15 13:22:59 Lin-Service kernel: <-- nfs4_proc_destroy_session
Nov 15 13:22:59 Lin-Service kernel: NFS call fsinfo
Nov 15 13:22:59 Lin-Service kernel: NFS reply fsinfo: -116
Nov 15 13:22:59 Lin-Service kernel: NFS call fsinfo
Nov 15 13:22:59 Lin-Service kernel: NFS reply fsinfo: -116