搭建
1、 安装 nfs 和 rpc
yum install nfs-utils rpcbind -y
rpm -qa nfs-utils rpcbind
2、运行 rpc 和 nfs (先启动RPC服务,然后再启动NFS服务)
systemctl start rpcbind
systemctl start nfs-server
5、 查看 rpc 和nfs 是否启动
ps -ef|grep rpc
ps -ef|grep nfs
6、可以设置开机自启动
systemctl enable rpcbind
systemctl enable nfs
挂载 (服务端和客户端最好都不要再挂在目录要不有可能挂在成功了,还是不好使)
vi /etc/exports
内容:
/opt/data 192.168.1.0/24(rw,sync,no_root_squash,no_subtree_check)
exportfs -rv
mount -t nfs 192.168.1.22:/opt/data /opt/data
卸载
umount /opt/data
网友评论