# yum install nfs-utils
# mkdir -p /export/primary
# mkdir -p /export/secondary
# vi /etc/exports
/export *(rw,async,no_root_squash,no_subtree_check)
# exportfs -a
# vi /etc/sysconfig/nfs
...
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020
...
# service rpcbind start
# service nfs start
# chkconfig nfs on
# chkconfig rpcbind on
# reboot
# mkdir -p /mnt/primary
# mkdir -p /mnt/secondary
# mount -t nfs 192.168.2.150:/export/primary /mnt/primary
# mount -t nfs 192.168.2.150:/export/secondary /mnt/secondary
修改防火墙配置,开放下面一些端口:
# vi /etc/sysconfig/iptables
...
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p udp --dport 111 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p tcp --dport 111 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p tcp --dport 2049 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p tcp --dport 32803 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p udp --dport 32769 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p tcp --dport 892 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p udp --dport 892 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p tcp --dport 875 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p udp --dport 875 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p tcp --dport 662 -j ACCEPT
-A INPUT -s 192.168.2.0/24 -m state --state NEW -p udp --dport 662 -j ACCEPT
...
# service iptables restart
# service iptables save