linux下配置共享磁盘nfs服务
假设共享磁盘服务器192.168.1.100,目录/opt/resource/,只允许192.168.1.网段访问。 修改/etc/exports文件,添加:/opt/resource 192.168.1.(rw,async,no_root_squash) 执行:exportfs -a 修改/etc/sysconfig/nfs文件,将下列内容的注释去掉: RQUOTAD_PORT=875 LOCKD_TCPPORT=32803 LOCKD_UDPPORT=32769 MOUNTD_PORT=892 重启nfs服务:service nfs restart 防火墙配置增加: #portmap -A INPUT -p tcp --dport 111 -j ACCEPT -A INPUT -p udp --dport 111 -j ACCEPT #nfsd -A INPUT -p tcp --dport 2049 -j ACCEPT -A INPUT -p udp --dport 2049 -j ACCEPT #rquotad -A INPUT -p tcp --dport 875 -j ACCEPT -A INPUT -p udp --dport 875 -j ACCEPT #mountd -A INPUT -p tcp --dport 892 -j ACCEPT -A INPUT -p udp --dport 892 -j ACCEPT #lockd -A INPUT -p tcp --dport 32803 -j ACCEPT -A INPUT -p udp --dport 32769 -j ACCEPT 假设需要挂载映射的服务器192.168.1.200,目录路径/opt/web/resource/ 进行挂载:mount -t nfs 192.168.1.100:/opt/resource /opt/web/resource 服务器启动自动挂载需修改/etc/fstab文件,添加如下内容: 192.168.1.100:/opt/resource /opt/web/resource nfs defaults 0 0