centos nfs配置备忘

 

【需求】
web应用需要部署在两台机器,图片目录共用,MySQL共用。

【环境】
Server: 192.168.168.10
Client: 192.168.168.20

【配置步骤】
1、在两台机器上安装nfs
#yum install nfs-utils rpcbind

2、在Server机器上执行如下命令
#vi /etc/exports
/website/test.com/gallery/ 192.168.168.20/32(rw,sync)

#chkconfig nfs on
#/etc/init.d/rpcbind start
#/etc/init.d/nfs start

3、在Client机器上执行如下命令
#showmount -e 192.168.168.10
#mount -t nfs 192.168.168.10:/website/test.com/gallery/ /website/test.com/gallery/

#vi /etc/rc.d/rc.local
mount -t nfs 192.168.168.10:/website/test.com/gallery/ /website/test.com/gallery/

你可能感兴趣的:(centos)