redhat搭建nfs-server acgred.cn

服务器A、B、C、D......想共用同一个目录,大家最先想到的肯定是挂nas

但如果没有nas,或者说只想实现一个简单的功能,觉得挂nas流程太麻烦,还有没有其他方法可以实现呢?

这时候就可以用上linux的nfs-server了

先选定服务器A作为NFS-Server,其他服务器作为client;

在服务器A上启动nfs服务器,client就可以使用mount命令挂载服务器A的目录了


服务器A(server端): www.acgred.cn

安装nfs-server组件: yum install -y nfs-utils rpcbind

检查是否安装成功:

[root@SZB-L0031636 ~]# rpm -qa|egrep "nfs-utils|rpcbind"

nfs-utils-lib-1.1.5-11.el6.x86_64

rpcbind-0.2.0-11.el6.x86_64

nfs-utils-1.2.3-64.el6.x86_64


检查是否启动:

[root@SZB-L0031636 ~]# /etc/init.d/nfs status

rpc.svcgssd is stopped

rpc.mountd (pid 1992) is running...

nfsd (pid 2008 2007 2006 2005 2004 2003 2002 2001) is running...

rpc.rquotad (pid 1987) is running...

[root@SZB-L0031636 ~]# /etc/init.d/rpcbind status

rpcbind (pid  1732) is running...


server端配置:

[root@SZB-L0031636 ~]# cat /etc/exports

/nfsc/csp_ifbss_trmnl_id005123_vol1001_prd/pacap-upload/ 10.20.25.0.0/24(rw,anonuid=0)

--将pacap-upload目录设置共享,允许10.20.25.0网段访问,权限为读+写,anonuid允许客户端访问的用户id
www.gaimor.cn


刷新配置文件:

[root@SZB-L0031636 ~]# exportfs -arv

exporting 10.20.25.0/24:/nfsc/csp_ifbss_trmnl_id005123_vol1001_prd/pacap-upload


client端挂载:

mount -t nfs  10.20.25.244:/nfsc/csp_ifbss_trmnl_id005123_vol1001_prd/pacap-upload/ /nfsc/csp_ifbss_trmnl_id005123_vol1001_prd/pacap-upload/

[root@SZB-L0031638 ~]# df -h |grep pacap-upload

10.20.25.244:/nfsc/csp_ifbss_trmnl_id005123_vol1001_prd/pacap-upload/

                       25G   14G  9.5G  60% /nfsc/csp_ifbss_trmnl_id005123_vol1001_prd/pacap-upload


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值