搭建NFS Server

1、安装软件包

yum install -y nfs-utils rpcbind

2、创建NFS目录

mkdir /opt/nfs_share

3、配置NFS目录

echo "/opt/nfs_share    客户端IP(rw,sync,no_root_squash)" >> /etc/exports
exportfs -rv

4、启动NFS服务

systemctl enable nfs-server
systemctl enable rpcbind
systemctl enable nfs-server
systemctl enable nfs-lock
systemctl enable nfs-idmap
systemctl restart nfs-server
systemctl start nfs-utils
systemctl enable nfs-utils

5、查看端口运行状态

rpcinfo -p 你的服务器ip

NFS Client使用

1、安装软件包

yum install -y nfs-utils rpcbind

2、启动服务

systemctl start nfs-utils
systemctl enable nfs-utils

3、挂载远程共享目录

mkdir /opt/bigops/bastion_record
mount -t nfs 172.31.173.22:/opt/nfs_share /opt/bigops/bastion_record

results matching ""

    No results matching ""