我想设置一个 NFS 服务器,所以我在Archlinux 教程中设置 NFS,有两个挂载点:
[jenia@jenia ~]$ sudo exportfs -arv
point 1
point 2
point 3
exportfs: /etc/exports [3]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.1.0/24:/srv/nfs".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x
exportfs: /etc/exports [4]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.1.0/24:/srv/nfs/music".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x
exporting 192.168.1.0/24:/srv/nfs/music
exporting 192.168.1.0/24:/srv/nfs
但没有任何回应nfs://192.168.1.0/srv/nfs
:
[jenia@jenia ~]$ sudo nfs-ls nfs://192.168.1.0/srv/nfs
Failed to mount nfs share : nfs_mount_async failed. Failed to start connection. Failed to start connection. connect() to server failed. Network is unreachable(101)
[jenia@jenia ~]$
当我这样做journalctl --follow -xn
并重新启动 nfs 守护程序时systemctl restart nfs-server.service
,我得到:
Nov 17 20:36:21 jenia sudo[45585]: pam_unix(sudo:session): session opened for user root(uid=0) by jenia(uid=0)
Nov 17 20:36:21 jenia systemd[1]: Condition check resulted in Kernel Module supporting RPCSEC_GSS being skipped.
-- Subject: A start job for unit auth-rpcgss-module.service has finished successfully
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit auth-rpcgss-module.service has finished successfully.
--
-- The job identifier is 2142.
Nov 17 20:36:21 jenia systemd[1]: Stopping NFS server and services...
-
一切systemctl status nfs-mountd nfsdcld nfs-idmapd
都在成功运行。
做事systemctl status nfs-server
说:
[jenia@jenia ~]$ sudo 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)
Active: active (exited) since Tue 2020-11-17 20:42:09 EST; 3s ago
Process: 45946 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
Process: 45947 ExecStart=/usr/sbin/rpc.nfsd (code=exited, status=0/SUCCESS)
Main PID: 45947 (code=exited, status=0/SUCCESS)
Nov 17 20:42:09 jenia exportfs[45946]: exportfs: /etc/exports [3]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.1.0/24:/srv/nfs".
Nov 17 20:42:09 jenia exportfs[45946]: Assuming default behaviour ('no_subtree_check').
Nov 17 20:42:09 jenia exportfs[45946]: NOTE: this default has changed since nfs-utils version 1.0.x
Nov 17 20:42:09 jenia exportfs[45946]: exportfs: /etc/exports [4]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.1.0/24:/srv/nfs/music".
Nov 17 20:42:09 jenia exportfs[45946]: Assuming default behaviour ('no_subtree_check').
Nov 17 20:42:09 jenia exportfs[45946]: NOTE: this default has changed since nfs-utils version 1.0.x
Nov 17 20:42:09 jenia exportfs[45946]: point 1
Nov 17 20:42:09 jenia exportfs[45946]: point 2
Nov 17 20:42:09 jenia exportfs[45946]: point 3
Nov 17 20:42:09 jenia systemd[1]: Finished NFS server and services.
[
有人知道我在做什么错吗?
您尝试连接到位于 192.168.1.0 的 NFS 服务器。这不太可能是您的 NFS 服务器的实际 IP 地址。使用正确的 IP 地址。