服务端
yum install -y nfs-utils rpcbind
rpm -qa nfs-utils rpcbind
systemctl start rpcbind
systemctl start nfs
ps aux | grep nfs
ps aux | grep rpcbind
systemctl enable rpcbind
systemctl enable nfs
systemctl list-unit-files --type=service|grep "enabled"|egrep "rpcbind|nfs"
mkdir /data
chown -R nfsnobody.nfsnobody /data
ls -ld /data
cat>>/etc/exports<<EOFwindows
#NFS server share directories
/data 192.168.1.0/24(rw,sync)
EOF
systemctl reload nfs
cat /var/lib/nfs/etab
showmount -e 192.168.1.158(服务端Ip)ide
systemctl stop firewalld
setenforce 0
chmod 777 /data工具
客户端命令行
yum install nfs-utils rpcbind -y
rpm -qa nfs-utils rpcbind
systemctl start rpcbind
systemctl enable rpcbind
systemctl list-unit-files --type=service|grep "enabled"|grep "rpcbind"
showmount -e 192.168.xx
mount -t nfs 192.168.1.158:/data /mnt
echo "mount -t nfs 192.168.1.158:/data /mnt">>/etc/rc.local
df -h
systemctl stop firewalld
setenforce 0server
链接windows
打开控制面板
点程序
点程序和功能中的小蓝字
添加nfs服务,点加号出现的nfs客户端、管理工具全选,这时变加号ip
打开windows的命令行服务cmd
输入mount \ 192.168.x.x\data x:\ ipwei服务端ip
实现windows挂载
去计算机查看,会多出data磁盘
再去cmd上输入mount查看挂载属性
给Windows读写权限
在cmd内输入regedit 回车 打开注册表
找到 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default 这个路径目录
建立两个32位值 AnonymousUid和AnonymousGid
重启计算机
而后去cmd内输入mount 查看属性
在x:盘下放置***程序(这里采用的是scp远程传输)
用电脑杀毒软件进行查杀文档
文档:搭建nfs服务.note
连接:http://note.youdao.com/noteshare?id=c27f34bfba9e41a28bfa644e7a9cda57rpc