我想设置一个 NFS 服务器,因此我按照如下方式设置 NFSArchlinux 教程有两个挂载点:
[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.
[
有人知道我做错了什么吗?
答案1
您尝试连接到 192.168.1.0 的 NFS 服务器。这可能不是您的 NFS 服务器的实际 IP 地址。请使用正确的 IP 地址。