How to configure NFS in RHEL 7?

本文围绕 Red Hat Enterprise Linux 7 系统展开,主要探讨了如何在 RHEL 7 中配置 NFS 以及启用 NFS 服务。给出了安装 NFS 包、开机启用服务、启动服务、检查状态、创建共享目录、导出目录等一系列操作步骤。

https://access.redhat.com/solutions/1355233

 SOLUTION 已验证 - 已更新 2018年十二月7日22:43 - 

English 

环境

  • Red Hat Enterprise Linux 7

问题

  • How do I configure NFS in RHEL 7?
  • How do I enable the NFS service in RHEL 7?

决议

  1. Install NFS packages on the system using the following command:

    Raw

    # yum install nfs-utils rpcbind
    
  2. Enable the services at boot time:

    Raw

    #  systemctl enable nfs-server
    #  systemctl enable rpcbind
    #  systemctl enable nfs-lock         <-- In  RHEL7.1 (nfs-utils-1.3.0-8.el7)   this does not work (No such file or directory).   it does not need to be enabled since rpc-statd.service  is static.
    #  systemctl enable nfs-idmap     <-- In  RHEL7.1 (nfs-utils-1.3.0-8.el7)   this does not work (No such file or directory).  it does not need to be enabled since nfs-idmapd.service is static.
    
  3. Start the NFS services:

    Raw

    #  systemctl start rpcbind
    #  systemctl start nfs-server
    #  systemctl start nfs-lock
    #  systemctl start nfs-idmap
    
  4. Check the status of NFS service:

    Raw

    # systemctl status nfs
    
  5. Create a shared directory:

    Raw

    # mkdir /test
    
  6. Export the directory:

    Raw

    # vi /etc/exports
    /test *(rw)
    
  7. Exporting the share:

    Raw

    # exportfs -r
    
  8. Restart the NFS service:

    Raw

    # systemctl restart nfs-server
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值