Linux

即使協議列為可用,NFS 客戶端也會失敗並顯示“不支持協議”

  • August 16, 2016

我為 Proxmox 設置了一個 NFS 服務,以便在那里遠端備份 VM 映像。由於某種原因,Proxmox 盒子無法連接到 NFS 伺服器。我測試了與另一台伺服器上的另一個 NFS 客戶端的連接,它工作正常。我不確定出了什麼問題,因為就客戶端的命令而言,它確實支持這些連接類型(版本 3 和 4)。我不確定我在這裡缺少什麼。

為簡單起見,將 IP 替換為 SERVER_IP 和 CLIENT_IP

坐騎列表:

root@client:~# showmount SERVER_IP -e
Export list for SERVER_IP:
/export/backups CLIENT_IP/32
/export         CLIENT_IP/32

支持的協議列表:

root@client:~# rpcinfo -p SERVER_IP | egrep "service|nfs"
  program vers proto   port  service
   100003    3   tcp   2049  nfs
   100003    4   tcp   2049  nfs
   100003    3   udp   2049  nfs
   100003    4   udp   2049  nfs

嘗試掛載遠端導出:

root@client: mkdir -p /nfs/backups
root@client:~# mount SERVER_IP:/export/backups /nfs/backups -vv
mount.nfs: timeout set for Wed Apr 27 17:55:34 2016
mount.nfs: trying text-based options 'vers=4,addr=SERVER_IP,clientaddr=CLIENT_IP'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=SERVER_IP'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying SERVER_IP prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying SERVER_IP prog 100005 vers 3 prot UDP port 38873
mount.nfs: mount(2): Protocol not supported
mount.nfs: Protocol not supported

/etc/exports在伺服器上:

/export CLIENT_IP/32(rw,sync,no_subtree_check,sec=sys,fsid=0)
/export/backups CLIENT_IP/32(rw,sync,no_subtree_check,all_squash,anonuid=1010,anongid=1010)

/export/backupsmount --rbind /home/backups /export/backups。1010 是備份使用者的 uid 和 gid。

中唯一編輯的設置/etc/conf.d/nfs

OPTS_RPC_NFSD="8 -N 2 -V 3 -V 4 -V 4.1"

有沒有人有任何想法?提前致謝。

根據 Zacq 的評論重啟伺服器

不是任何人都想在生產 Proxmox 伺服器上聽到的解決方案,但它確實有效。必須有一個 /etc/init.d/

$$ something $$重啟類型修復。 與OP的症狀完全相同。

此外,客戶在 dmesg 中抱怨

nfsv3: disagrees about version of symbol nlmclnt_proc
nfsv3: disagrees about version of symbol nfs_alloc_client
nfsv3: disagrees about version of symbol nfs_access_zap_cache
nfsv3: disagrees about version of symbol nfs_submount
nfsv3: disagrees about version of symbol nfs_create_server
nfsv3: disagrees about version of symbol nfs_post_op_update_in$
nfsv3: disagrees about version of symbol nfs_mkdir
nfsv3: disagrees about version of symbol nfs_get_client
nfsv3: disagrees about version of symbol nfs_file_operations
nfsv3: disagrees about version of symbol nfs_lookup
nfsv3: disagrees about version of symbol nfs_getattr
nfsv3: disagrees about version of symbol register_nfs_version
nfsv3: disagrees about version of symbol nfs_setattr
nfsv3: disagrees about version of symbol unregister_nfs_version
nfsv3: disagrees about version of symbol nfs_sops
nfsv3: disagrees about version of symbol nfs_link
nfsv3: disagrees about version of symbol nfs_try_mount
nfsv3: disagrees about version of symbol nfs_close_context
nfsv3: disagrees about version of symbol nfs_symlink
nfsv3: disagrees about version of symbol nfs_clone_server
nfsv3: disagrees about version of symbol nlmclnt_proc
nfsv3: Unknown symbol nfs_writeback_update_inode (err -22)
nfsv3: Unknown symbol nfs_dentry_operations (err -22)

引用自:https://serverfault.com/questions/773424