nfs搭建过程

2020-06-23  本文已影响0人  hemingkung
****************************************************************************************************************************
##node1:   192.168.56.101

1.yum install nfs-utils

2.vi  /etc/exports
添加以下
/data    *(rw,async,insecure,no_all_squash,no_root_squash)

3.使修改生效
sudo exportfs -r

4.启动nfs服务
systemctl start nfs ,启动后 使用rpcinfo -p 192.168.56.101 查看

5.使用showmount查看
showmount -e localhost

6 ,创建/data目录添加文件,更改权限(很重要!!!!!)
    mkdir /data 
    touch /data/1.txt

    echo "hello nfs" >> /data/1.txt

    chown -R nfsnobody.nfsnobody /data

******************************************************************************************
##node2:   192.168.56.102
1.yum -y intall nfs-utils (客户端上不需要启动nfs服务,只是为了使用showmount工具)

2.检测rpc是否启动,

3.使用showmount -e 192.168.56.101查看

4.mount -t nfs 192.168.56.101:/data /mnt

       1.txt可读写 。nfs挂载完成。
        接下来在服务器端执行
                systemctl enable nfs
                systemctl enable rpcbind
        让nfs,rpcbind开机自动启动,实验完成。


*******************************************************************************************
##node3:   192.168.56.103
1.yum -y intall nfs-utils (客户端上不需要启动nfs服务,只是为了使用showmount工具)

2.检测rpc是否启动,

3.使用showmount -e 192.168.56.101查看

4.mount -t nfs 192.168.56.101:/data /mnt

       1.txt可读写 。nfs挂载完成。
        接下来在服务器端执行
                systemctl enable nfs
                systemctl enable rpcbind
        让nfs,rpcbind开机自动启动,实验完成。
上一篇 下一篇

猜你喜欢

热点阅读