温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

centos安装部署nfs

发布时间:2020-07-06 07:47:41 来源:网络 阅读:194 作者:qq5a1d14f340108 栏目:系统运维

服务端安装

sudo yum install -y nfs-utils
sudo systemctl enable rpcbind
sudo systemctl start rpcbind
sudo systemctl enable nfs
sudo systemctl start nfs

配置共享目录

mkdir /data/nfs

配置 /etc/exports,添加如下内容

/data/nfs     *(rw,sync,no_root_squash,no_all_squash)
/data/nfs: 共享目录位置。
*: 客户端 IP(18.8.1.0/30) 范围,* 代表所有,即没有限制。
rw: 权限设置,可读可写。
sync: 同步共享目录。
no_root_squash: 可以使用 root 授权。
no_all_squash: 可以使用普通用户授权。

重启nfs服务。检查本地共享目录

showmount -e localhost

客户端安装

sudo yum install -y nfs-utils
sudo systemctl enable rpcbind
sudo systemctl start rpcbind

创建共享目录

mkdir /data/nfs

挂载目录

sudo mount -t nfs 18.8.1.1:/data/nfs /data/nfs

添加自动挂载

sudo vi /etc/fstab

添加一行

18.8.1.1:/data/nfs /data/nfs nfs defaults 0 0
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI