fedora20 nfs服务器配置

板子在很多时候需要通过 NFS 协议读取 mount 的文件。

1)安装nfs服务和rpcbind 服务
yum install rpcbind
yum install nfs-utils

2)创建nfs server目录,用于放置被远程NFS访问的文件。
mkdir /opt/nfsroot

3)编辑/etc/exports 文件 
编辑/etc/exports 文件,增加1个挂载点,内容如下:
/opt/nfsroot *(rw,no_root_squash,no_all_squash)

4)启动rpcbind和 nfs 服务:
systemctl restart rpcbind.service
systemctl restart nfs.service

可以用下列命令检查这两个服务的状态

systemctl status rpcbind.service
  1. ]# systemctl status rpcbind.service
  2. rpcbind.service - RPC bind service
  3.    Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; static)
  4.    Active: active (running) since 三 2014-03-05 13:55:54 CST; 4min 9s ago
  5.   Process: 3688 ExecStart=/sbin/rpcbind -w ${RPCBIND_ARGS} (code=exited, status=0/SUCCESS)
  6. Main PID: 3689 (rpcbind)
  7.    CGroup: /system.slice/rpcbind.service
  8.            └─3689 /sbin/rpcbind -w

  9. 3月 05 13:55:54 localhost.localdomain systemd[1]: Started RPC bind service.
复制代码


systemctl status nfs.service
  1. #systemctl status nfs.service
  2. nfs-server.service - NFS Server
  3.    Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled)
  4.    Active: active (exited) since 三 2014-03-05 13:57:16 CST; 1min 57s ago
  5.   Process: 3788 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)
  6.   Process: 3786 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=0/SUCCESS)
  7.   Process: 3817 ExecStartPost=/usr/libexec/nfs-utils/scripts/nfs-server.postconfig (code=exited, status=0/SUCCESS)
  8.   Process: 3803 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT (code=exited, status=0/SUCCESS)
  9.   Process: 3800 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
  10.   Process: 3798 ExecStartPre=/usr/libexec/nfs-utils/scripts/nfs-server.preconfig (code=exited, status=0/SUCCESS)
  11. Main PID: 3803 (code=exited, status=0/SUCCESS)
  12.    CGroup: /system.slice/nfs-server.service

  13. 3月 05 13:57:16 localhost.localdomain systemd[1]: Started NFS Server.
复制代码


5.检查nfs服务是否启动:

mount localport:/opt/nfsroot /mnt

6.必要是关闭防火墙
如果远程访问不能成功,原因是防火墙的问题,关闭或者禁用防火墙。

systemctl stop firewalld.service

systemctl disable firewalld    禁用防火墙

7.远程检查nfs服务

mount localport ip address:/opt/nfsroot /mnt
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值