首页

关于Centos6.8操作系统安装配置nfs、rpcbind服务后实现linux系统间文件数据共享(挂载mount共享路径)

标签:Centos6.8,配置nfs,rpcbind服务,linux间文件共享,挂载mount网络,网络文件系统     发布时间:2018-09-19   

一、前言

关于多个centos6.8操作系统间实现文件数据资源共享(挂载mount网络文件路径),这边通过在服务端配置nfs(网络文件系统)+rpcbind服务软件,具体操作步骤如下所示。

二、安装步骤

1. 确认服务端安装ndf服务、启动并设置为开机启动

[root@centos6 ~]# rpm  -qa|grep  nfs@b@nfs-utils-1.2.3-64.el6.x86_64@b@nfs4-acl-tools-0.3.3-7.el6.x86_64@b@nfs-utils-lib-1.1.5-11.el6.x86_64@b@[root@centos6 ~]# service  nfs  start@b@启动 NFS 服务: [确定]@b@关掉 NFS 配额:[确定]@b@启动 NFS mountd:[确定]@b@启动 NFS 守护进程:[确定]@b@正在启动 RPC idmapd:[确定]@b@[root@centos6 ~]# chkconfig  --list  nfs@b@nfs             0:关闭  1:关闭  2:关闭  3:关闭  4:关闭  5:关闭  6:关闭@b@[root@centos6 ~]# chkconfig nfs  on@b@[root@centos6 ~]# chkconfig  --list  nfs@b@nfs             0:关闭  1:关闭  2:启用  3:启用  4:启用  5:启用  6:关闭

2. 服务端安装配置rpcbind、启动并设置为开机启动

[root@centos6 ~]# rpm  -qa|grep  rpcbind@b@rpcbind-0.2.0-11.el6.x86_64 @b@[root@centos6 ~]# chkconfig  --list rpcbind@b@rpcbind         0:关闭  1:关闭  2:启用  3:启用  4:启用  5:启用  6:关闭@b@[root@centos6 ~]# chkconfig  rpcbind  on@b@[root@centos6 ~]# service  rpcbind start@b@[root@centos6 ~]# service  rpcbind status@b@rpcbind (pid  1768) 正在运行...

3. 在服务端的/etc/exports配置共享路径,并重启服务,同时关闭防火墙(比较重要,否则报mount.nfs: Connection timed out)

[root@centos6 init.d]# vi  /etc/exports@b@/home/share  *(insecure,rw,async,no_root_squash)@b@@b@[root@centos6 init.d]# service  nfs  restart@b@关闭 NFS 守护进程:[确定]@b@关闭 NFS mountd:[确定]@b@关闭 NFS quotas:[确定]@b@Shutting down RPC idmapd: [确定]@b@启动 NFS 服务: [确定]@b@关掉 NFS 配额:[确定]@b@启动 NFS mountd:[确定]@b@启动 NFS 守护进程:[确定]@b@正在启动 RPC idmapd:[确定]@b@[root@centos6 init.d]# service  rpcbind  restart@b@停止 rpcbind:[确定]@b@正在启动 rpcbind:[确定]@b@@b@[root@centos6 init.d]# chmod  -R 755 /home/share@b@[root@centos6 init.d]# service  iptables  stop@b@iptables:将链设置为政策 ACCEPT:nat mangle filter [确定]@b@iptables:清除防火墙规则:[确定]@b@iptables:正在卸载模块:[确定]@b@@b@@b@[root@centos6 init.d]# cd /home/share@b@[root@centos6 share]# touch  test.txt@b@[root@centos6 share]# echo "123">test.txt

4. 在客户端mount上面服务端分享的nfs路径/home/share(绑定在客户的/home/202),测试成功

[root@raid2t 202]# mount -t nfs   192.168.1.202:/home/share/  /home/202/@b@[root@raid2t 202]# cd /home/202@b@[root@raid2t 202]# ls -l@b@总用量 0 @b@-rw-r--r--. 1 root root 4 9月  21 13:59 test.txt