AKI*_*WEB 0 linux ubuntu nfs mount
我有三台机器-
machineA 10.108.24.132
machineB 10.108.24.133
machineC 10.108.24.134
Run Code Online (Sandbox Code Playgroud)
所有这些机器都安装了 Ubuntu 12.04,我对所有这三台机器都有 root 访问权限。
现在我应该在上面的机器上做下面的事情 -
Create mount point /opt/exhibitor/conf
Mount the directory in all servers.
sudo mount <NFS-SERVER>:/opt/exhibitor/conf /opt/exhibitor/conf/
Run Code Online (Sandbox Code Playgroud)
/opt/exhibitor/conf如上所述,我已经在所有这三台机器中创建了目录。
现在我试图在所有这三台机器上创建一个挂载点。所以我遵循了以下过程 -
安装 NFS 支持文件和 NFS 内核服务器
$ sudo apt-get install nfs-common nfs-kernel-server
Run Code Online (Sandbox Code Playgroud)
创建共享目录
$ mkdir /opt/exhibitor/conf/
Run Code Online (Sandbox Code Playgroud)
编辑 /etc/exports 并添加如下条目:
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/opt/exhibitor/conf/ 10.108.24.*(rw)
Run Code Online (Sandbox Code Playgroud)
运行 exportfs
root@machineA:/# exportfs -rv
exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "10.108.24.*:/opt/exhibitor/conf/".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x
exporting 10.108.24.*:/opt/exhibitor/conf
Run Code Online (Sandbox Code Playgroud)
现在我做showmount了machineA
root@machineA:/# showmount -e 10.108.24.132
Export list for 10.108.24.132:
/opt/exhibitor/conf 10.108.24.*
Run Code Online (Sandbox Code Playgroud)
现在当我这样做时,我收到了一个错误 -
root@machineA:/# sudo mount -t nfs 10.108.24.132:/opt/exhibitor/conf /opt/exhibitor/conf/
mount.nfs: access denied by server while mounting 10.108.24.132:/opt/exhibitor/conf
Run Code Online (Sandbox Code Playgroud)
知道我在这里做错了什么吗?
小智 6
将您的 /etc/exports 从
/opt/exhibitor/conf/ 10.108.24.*(rw)
Run Code Online (Sandbox Code Playgroud)
到
/opt/exhibitor/conf/ 10.108.24.0/24(rw)
Run Code Online (Sandbox Code Playgroud)