NFS共享目录

mac2025-11-26  14

1、首先需要三台服务器,记住防火墙一定要关闭 2、web1安装nfs-utils,rpcbind

yum -y install nfs-utils rpcbind httpd chkconfig nfs on chkconfig rpcbind on

3、设置共享目录

vi /etc/exports

/var/www/html 192.168.11.0/24(rw,sync,no_root_squash)

4、启动NFS服务,rpcbind必须在nfs前启动:

service rpcbind start service nfs start netstat -anpt | grep rpcbind

查看本机NFS共享目录

showmount -e

5、在web2,web3安装部署客户机端:

yum -y install rpcbind nfs-utils httpd chkconfig rpcbind on service rpcbind start

6、web2,web3手动挂载NFS共享目录

mount 192.168.11.128:/var/www/html /var/www/html/

7、查看挂载结果,并测试

tail -1 /etc/mtab

转到web1

touch /var/www/html/11

查看web2,web3是否都有

ll /var/www/html/

最新回复(0)