zoukankan      html  css  js  c++  java
  • CentOS中配置NFS服务

    1.服务器端安装rpcbind、nfs-utils、nfs-server包

    yum install nfs-utils -y

    2.修改服务器端配置文件,添加需要共享的文件夹。

    vim /etc/exports

      /share1 172.25.1.11/24(rw,async)     允许读写

      /share2 172.25.1.11/24(ro,async) 只读模式

      :wq

    exportfs -r 重新读取/etc/exports配置文件

    3.首先查看rpcbind(远程过程调用)允许状态  

    systemctl status rpcbind   如果没有开启用start开启

    4.开启nfs服务,开机自启动

    systemctl start nfs-server

    systemctl enable nfs-server

    5.客户端必须安装nfs-utils,然后可以使用命令查看是服务器有没有开启nfs服务

    showmount  -e 17.25.1.11

    /share1 172.25.1.11/24

    /share2 172.25.1.11/24

    6.可以手工挂载

    mount -t nfs 172.25.1.11:/share1 /mnt/nfs1

      mount -t nfs 172.25.1.11:/share2 /mnt/nfs2

    7.也可以进行手工挂载,编辑fstab文件

    vim /etc/fstab

    172.25.1.11:/share1 /mnt/nfs1 nfs  defaults 0 0

    172.25.1.11:/share2 /mnt/nfs2 nfs defaults 0 0

    8.使用mount -a挂载,df -h 可以看到共享文件成功挂载

    9.不需要NFS时,则使用umount /mnt/xxx(xxx代表挂载点的文件名)

  • 相关阅读:
    华为ensp使用
    网络学习目录
    MySQL简介
    zip命令详解
    gzip命令详解
    unzip/tar命令详解
    tar命令详解
    ipython使用
    os, sys, stat 模块使用
    配置linux系统时区---解决ntp同步完时间不准问题
  • 原文地址:https://www.cnblogs.com/cq146637/p/7806546.html
Copyright © 2011-2022 走看看