Cetnos6.6安装NFS
service iptables stop//
vi /etc/selinux/conf disabled
chkconfig iptables off
NFS Server:
1,yum install rpcbind nfs-utils
2,echo “/storage *(rw,async,no_root_squash,no_subtree_check)” >> /etc/exports
3,/etc/init.d/rpcbind start
4,/etc/init.d/nfs start
5,showmount -e 10.161.4.106(查看挂载是否生效)
6,chkconfig rpcbind on
7,chkconfig nfs on
NFS Client:
1,yum install rpcbind nfs-utils
2,showmount -e 10.161.4.106(查看是否能识别到server的挂载)
3,mount -t nfs 10.161.4.106:/storage /storage
4, echo “mount -t nfs 110.161.4.106:/storage /storage” >> /etc/rc.local
nfs服务端修改端口:(客户端不需要修改)
RQUOTAD_PORT=30001
LOCKD_TCPPORT=30002
LOCKD_UDPPORT=30003
MOUNTD_PORT=30004
STATD_PORT=30005
RDMA_PORT=30006
iptables配置:(客户端不需要修改)
nfs服务器iptables添加允许规则
-A INPUT -p tcp -m tcp –dport 111 -j ACCEPT
-A INPUT -p udp -m udp –dport 111 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 2049 -j ACCEPT
-A INPUT -p udp -m udp –dport 2049 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 30001:30006 -j ACCEPT
-A INPUT -p udp -m udp –dport 3001:30006 -j ACCEPT