Linux NFS 服务部署

发表于:2014-10-11 10:00

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:JingyuZhao    来源:51Testing软件测试网采编

  系统环境:Oracle Linux 5.7
  服务端:192.168.1.111
  客户端:192.168.1.171
  一、服务端配置
  1.依次启动portmap和nfs服务
service portmap start
service nfs start
[root@OEL-ASM ~]#  service portmap status
portmap (pid 2543) is running...
[root@OEL-ASM ~]#  service nfs status
rpc.mountd is stopped
nfsd is stopped
rpc.rquotad is stopped
[root@OEL-ASM ~]# service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
[root@OEL-ASM ~]# service nfs status
rpc.mountd (pid 10530) is running...
nfsd (pid 10527 10526 10525 10524 10523 10522 10521 10520) is running...
rpc.rquotad (pid 10504) is running...
  2.将服务端需要共享的目录配置到/etc/exports文件中
  例如在/etc/exports配置文件中添加一行:
  /usr2/nfs *(rw)
  配置/etc/exports文件后重启nfs服务
[root@OEL-ASM /]# mkdir -p /usr2/nfs
[root@OEL-ASM /]# cd /usr2/nfs
[root@OEL-ASM nfs]# ls
[root@OEL-ASM nfs]# pwd
/usr2/nfs
[root@OEL-ASM nfs]# touch 1 2
[root@OEL-ASM nfs]# vi 1
[root@OEL-ASM nfs]# vi 2
[root@OEL-ASM nfs]# more 1
Hello, World! one~
[root@OEL-ASM nfs]# more 2
Hello, World! two.
[root@OEL-ASM nfs]# pwd
/usr2/nfs
[root@OEL-ASM nfs]# ls -lh
total 8.0K
-rw-r--r-- 1 root root 19 10-09 10:02 1
-rw-r--r-- 1 root root 19 10-09 10:03 2
[root@OEL-ASM nfs]# vi /etc/exports
[root@OEL-ASM nfs]# more /etc/exports
/usr2/nfs *(rw)
[root@OEL-ASM nfs]# service nfs restart
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
[root@OEL-ASM nfs]# showmount -e
Export list for OEL-ASM:
/usr2/nfs *
[root@OEL-ASM nfs]# exportfs
/usr2/nfs         <world>
21/212>
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号