2台机器先安装nfs Debian&Ununtu: ```shell sudo apt install nfs-kernel-server ``` CentOS: ```shell yum install nfs-utils 服务端配置: systemctl enable rpcbind systemctl enable nfs systemctl start rpcbind systemctl start nfs 客户端配置: systemctl enable rpcbind systemctl start rpcbind ``` ifconfig查看内网IP 比如服务端(大盘机)IP为: 1.1.1.1 比如客户端(大流量机)IP为:2.2.2.2 服务端文件/etc/exports添加设置: ```shell /home 2.2.2.2(rw,no_root_squash,no_subtree_check,sync) ``` /homet为分享目录 重启nfs服务生效 ```shell sudo service nfs-kernel-server restart ``` 服务端完成! 接下来客户端: ```shell sudo mount -t nfs4 -o proto=tcp,port=2049 1.1.1.1:/home /www/wwwroot ``` /www/wwwroot为挂载目录 /etc/fstab文件添加设置: ```shell 1.1.1.1:/home /www/wwwroot nfs4 _netdev,auto 0 0 ``` 完成! 使用mount或者df -h命令查看挂载情况 treesky 2023-01-26 上一篇: 坑系列之CentOS7下ipv4/6冲突引发的https加载过慢wget慢curl慢Github慢 下一篇: Centos7限制进程CPU使用,设置进程优先级 评论已关闭
评论已关闭