首页 > 其他 > 详细

NFS系统安装

时间:2017-03-24 14:29:43      阅读:157      评论:0      收藏:0      [点我收藏+]

centos新版本已经把portmap改成rpcbind了


安装:

需要安装nfs-utils rpcbind


启动systemctl start rpcbind.servicesystemctl start nfs.service
端口/进程netstat -lnt (111端口)ps -ef | grep nfs
rpc检查rpcinfo -p localhost 

    

配置文件

NFS默认配置文件/etc/exports存在,但是空文件,有的需要手动创建文件。

/etc/exports  三种方式

常用格式共享目录客户端IP或网段(参数,参数,...,....)
方式1/share/share10.0.0.1/24(rw,sync) 
方式2/share/share10.0.0.0/24(rw,sync.all_squash,anonuid=2000,anongid=2000)
方式3/share/share10.0.0.0/24(ro) 

备注:

sync 同步写入到内存及硬盘中,影响性能!

方式2是常用的一种方式,适合多人共享,表明所有接入客户都匿名方式.

例如:

[root@localhost ~]# cat > /etc/exports << EOF

> /share/share 172.21.10.0/24(rw,sync)

> EOF

[root@localhost ~]# cat /etc/exports

/share/share 172.21.10.0/24(rw,sync)



客户端篇


linux客户端挂NFS方法showmount -e nfs服务器IP地址

mount -t nfs nfs服务器的ip:/共享目录 /mnt (mnt为客户端的目录)


NFS默认自带参数 /var/lib/nfs/etab

NFS查看挂载用户  /var/lib/nfs/rmtab 


开机自启nfs挂载方式

/etc/fstab 一般不放在此,若挂载不成功,引起主机无法开机

/etc/rc.local 


卸载umount 本地挂载点

例如:umount /mnt

强制卸载挂载:umount -lf /mnt


NFS系统安装

原文:http://sadoc.blog.51cto.com/12189157/1909954

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!