码迷,mamicode.com
首页 > 其他好文 > 详细

nfs配置

时间:2015-04-09 14:57:37      阅读:115      评论:0      收藏:0      [点我收藏+]

标签:

1. 检查是否已安装NFS
rpm -qa | grep nfs
rpm -qa | grep portmap

2. 安装NFS
yum install nfs-utils*
chkconfig nfs on
chkconfig rpcbind on
service nfs restart
service rpcbind restart
service nfs status
service rpcbind status

3. 配置防火墙

cd /etc/sysconfig
cp nfs nfs.bak
vim nfs

RQUOTAD_PORT=875
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892

echo "mountd 892/tcp" >> /etc/services
echo "mountd 892/udp" >> /etcservices
echo "rquotad 875/tcp" >> /etc/services
echo "rquotad 875/udp" >> /etc/services
echo "nlockmgr 32803/tcp" >> /etc/services
echo "nlockmgr 32769/udp" >> /etc/services

service nfs restart

iptables -A INPUT -p tcp --dport 111 -j ACCEPT
iptables -A INPUT -p udp --dport 111 -j ACCEPT
iptables -A INPUT -p tcp --dport 892 -j ACCEPT
iptables -A INPUT -p udp --dport 892 -j ACCEPT
iptables -A INPUT -p tcp --dport 875 -j ACCEPT
iptables -A INPUT -p udp --dport 875 -j ACCEPT
iptables -A INPUT -p tcp --dport 2049 -j ACCEPT
iptables -A INPUT -p udp --dport 2049 -j ACCEPT
iptables -A INPUT -p tcp --dport 32803 -j ACCEPT
iptables -A INPUT -p udp --dport 32803 -j ACCEPT
iptables -A INPUT -p tcp --dport 32769 -j ACCEPT
iptables -A INPUT -p udp --dport 32769 -j ACCEPT

service iptables save

4. 配置NFS
vim /etc/exports

/nfs *(insecure,rw,async,no_root_squash) *(ro)

 

5. 挂载测试

showmount -e 10.166.80.15

nfs配置

标签:

原文地址:http://www.cnblogs.com/sflik/p/4409437.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!