在服务端启动nfs进程(实际上是要启动portmap和nfs进程)
[root@rac1 ~]# /etc/init.d/portmap start
Starting portmap: [ OK ]
[root@rac1 ~]# /etc/init.d/nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
Starting RPC idmapd: [ OK ]
再次在客户端连接
[root@rac2 init.d]# mount 192.168.0.5:/disk0 /wyl
mount: 192.168.0.5:/disk0 failed, reason given by server: Permission denied
此报错信息是因为没在server端授权client端来连接,其实道理很简单,必须在服务端来决定哪些IP可以来mount,我的哪个分区可以被mount.
在服务器端编辑/etc/wxports文件
[root@rac1 ~]# vi /etc/exports
/disk0 192.168.0.6(rw)
第一列定义的是服务端哪个分区可以被mount,第二列定义的是哪些客户端IP可以来mount.
注意修改/etc/export后,要重起nfs进程.
vi /etc/exports
/disk0 192.168.0.6(rw)
~
~
~
"/etc/exports" 1L, 24C written
[root@rac1 ~]# more /etc/exports
/disk0 192.168.0.6(rw)
[root@rac1 ~]# /etc/init.d/nfs restart
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
Linux下NFS配置学习(2)
内容版权声明:除非注明,否则皆为本站原创文章。