部署NFS服务

DevOps NFS评论5,026字数 1169阅读3分53秒阅读模式

部署 NFS 服务

  • 服务端: 192.168.100.11

安装依赖

yum -y install epel-release

安装 NFS

yum -y install nfs-utils rpcbind

启动 NFS

[root@hecs-x-large-2-linux-20200321161149 ~]# systemctl enable rpcbind nfs-server nfs-lock nfs-idmap
Created symlink from /etc/systemd/system/multi-user.target.wants/nfs-server.service to /usr/lib/systemd/system/nfs-server.service.
[root@hecs-x-large-2-linux-20200321161149 ~]# systemctl start rpcbind nfs-server nfs-lock nfs-idmap

配置防火墙

[root@hecs-x-large-2-linux-20200321161149 ~]# firewall-cmd --add-service=nfs --permanent --zone=public
[root@hecs-x-large-2-linux-20200321161149 ~]# firewall-cmd --add-service=mountd --permanent --zone=public
[root@hecs-x-large-2-linux-20200321161149 ~]# firewall-cmd --add-service=rpc-bind --permanent --zone=public
[root@hecs-x-large-2-linux-20200321161149 ~]# firewall-cmd --reload

配置 NFS

  • 创建存储目录
[root@hecs-x-large-2-linux-20200321161149 ~]# mkdir /data
[root@hecs-x-large-2-linux-20200321161149 ~]# chmod 777 -R /data

配置NFS权限

[root@hecs-x-large-2-linux-20200321161149 ~]# vi /etc/exports
/data 192.168.0.*(rw,sync,all_squash,anonuid=0,anongid=0)
  • 设置 NFS 访问权限, /data 是刚才创建的将被共享的目录, 192.168.0.* 表示整个 192.168.0.* 的资产都有括号里面的权限
  • 也可以写具体的授权对象 /data 192.168.0.30(rw,sync,no_root_squash) 192.168.0.31(rw,sync,no_root_squash)

继续阅读
DevOps
  • 本文由 发表于 2023年2月24日 15:45:50
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
  • NFS
NFS CentOS

NFS

安装依赖 yum -y install epel-release 安装 NFS yum -y install nfs-utils rpcbind 启动 NFS systemctl ena...
评论  0  访客  0

发表评论