nfs配置:
阿里云(华为云)服务器+linux虚拟机
1.开启阿里云服务器(运行状态):
2.linux虚拟机ping阿里云服务器公网地址
3.阿里云输入以下命令,看看nfs是否安装:
rpm -q nfs-utils
4.阿里云写/etc/exports文件
vim /etc/exports
文件内容:
/it *(rw,insecure)
5.创建文件夹/mnt/it
mkdir /mnt/it
6.客户端挂载文件:
sudo mount -t nfs 47.120.39.220:/it /mnt/it
7.阿里云为/it 设置权限:
sudo chmod 777 /it
8.客户端进入到it目录,查看文件
ls
9.客户端it目录下创建文件
touch a.py
10.阿里云it目录下查看文件
ls
注意事项:
1.阿里云要关闭防火墙:
systemctl stop firewalld
2.修改完/ect/exports文件要重启nfs-服务
systemctl restart nfs-server