NFS服务器部署准备
查看系统版本
cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
查看内核版本
uname -r
2.6.32-431.el6.x86_64
服务端查看是否安装包
程序包安装
yum -y install nfs-utils rpcbind
启动服务
/etc/init.d/rpcbind start
/etc/init.d/nfs start
检查是否启动成功
rpcinfo -p localhost
/etc/init.d/nfs status
加入开机自启动
chkconfig rpcbind on
chkconfig nfs on
配置文档
vi /etc/exportds
/nfs 192.168.0.0/24(rw,async,all_squash,anonuid=555,anongid=555)
vi /etc/sysctl.conf
net.core.wmem_default=8388608
net.core.rmem_default=8388608
net.core.rmem_max=1677216
net.core.wmem_max=1677216
发布生效:sysctl -p
重启nfs服务:exportfs -rv
修改用户UID,GID
usermod -u 555 nfsnobody
groupmod -g 555 nfsnobody
检查是否修改成功
修改目前权限
chown -R nfsnobody nfsnobody /nfs
关闭防火墙:/etc/init.d/iptables stop
nfs服务的相关功能组件
portmap C5.8 rpc服务
rpc.rquotad 磁盘配额进程
nfsd nfs主进程,
rpc.mountd 权限管理进程
rpc.statd 检查文件一致性
客户端设置
启动rpc:/etc/init.d/rpcbind start
检查是否正常启动:service rpcbind status
开机自启动:chkconfig rpcbind on
检查是否设置成功:chkconfig --list rpcbind
测试是否成功连接服务器:showmount -e 192.168.0.11
挂载nfs:mount -t nfs -o nosuid,noexec,noatime,nodiratime,rsize=131072,wsize=131072 192.168.0.11:/nfs/mnt
检查是否挂载成功:df -h
测试挂载权限测试
192.168.0.12
192.168.0.13