NFS安装配置

准备两台机器,此处lsx02(192.168.1.12)服务端、lsx01(192.168.1.226/24)客户端。

lsx02(192.168.1.12)服务端
yum install -y nfs-utils rpcbind //客户端也需安装nfs-utils包

lsx01(192.168.1.226/24)
yum install -y nfs-utils

服务端
vim /etc/exports //加入如下内容
/home/nfstestdir //分享的出去的目录。比如A机器分享给BC机器,那分享的目录要一样
192.168.133.0/24(rw,sync,all_squash,anonuid=1000,anongid=1000) //定义分享给哪些机器及其选项。

[root@server ~]# systemctl reload nfs

保存配置文件后,执行如下准备操作
[root@lsx03 ~]# netstat -ltnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name 
tcp 0 0 127.0.0.1:25 0.0.0.0: LISTEN 2003/master 
tcp 0 0 0.0.0.0:111 0.0.0.0:
 LISTEN 1/systemd 
tcp 0 0 0.0.0.0:22 0.0.0.0: LISTEN 1155/sshd 
tcp6 0 0 ::1:25 :::
 LISTEN 2003/master 
tcp6 0 0 :::111 :::* LISTEN 1/systemd

mkdir /home/nfstestdir
chmod 777 /home/nfstestdir
systemctl start rpcbind //(rpc已经启动可以省略)
systemctl start nfs
systemctl enable rpcbind //开机启动(客户端省略)
systemctl enable nfs //开机启动(客户端省略)
systemctl disable nfs //取消开机启动



本文转自 虾米的春天 51CTO博客,原文链接:http://blog.51cto.com/lsxme/2054795,如需转载请自行联系原作者

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值