Building NFS Services in Linux redhat6.5

Source: Internet
Author: User

The NFS (Network File system), which is one of the file systems supported by FreeBSD, allows computers in the network to share resources across TCP/IP networks. In an NFS application, a local NFS client application can transparently read and write to files located on the remote NFS server, just as you would access a local file.

首先准备两台linux (一台最为服务器  一台作为客户机)通过搭建NFS 使得客户机能访问服务器 并且文件同步        1:在服务器上配置            #yum install nfs-utils rpcbind -y   //安装 nfs-utils  rpcbind 软件                nfs-utils  用于NFS共享发布和访问                rpcbind    用于远端过程调用机制支持            #chkconfig nfs on            #chkconfig rpcbind on    //开机自启动            #mkdir -p /opt/wwwroot  //创建目录wwwroot            #vim /etc/exports           //编辑exports            /opt/wwwroot 192.168.100.0/24(rw,sync,no_root_squash)            //192.168.100.0/24网段访问 /opt/wwwroot时 会有以下权限            rw:允许读写  sync:同步写入             no_root_squash:表示客户机以root身份访问时赋予本地root权限

2:service rpcbind restart     //重启rpcbind服务     service nfs restart         //重启nfs服务     netstat -ntap | grep rpcbind   //查看111端口是否开启     showmount -e 192.168.100.101   //本机中查看NFS文件     service iptables stop     setenforce 0                 //关闭防火墙

3:切换到客户机        #yum install nfs-utils rpcbind -y   //安装 nfs-utils  rpcbind 软件        #chkconfig nfs on        #chkconfig rpcbind on    //开机自启动        #showmount -e 192.168.100.101   //查看服务器中的NFS文件        #mkdir /share                 //创建目录share        #mount 192.168.100.101:/opt/wwwroot /share    //手动挂载        #tail -1 /etc/mtab          //确认挂载结果        #vim /share/index.html      //测试添加文件,同时服务端也会同步添加

4:切换到服务器    查看服务器wwwroot里  可以看到文件同步成功

Building NFS Services in Linux redhat6.5

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.