NFS安装实战

来源:互联网 发布:淘宝c店违反广告法处罚 编辑:程序博客网 时间:2024/06/05 10:05

好久没更新过博客了,主要是一直在忙工作,最近再帮同事做分布式配置,用到了NFS共享存储,记录一下。

环境描述

client1 10.1.1.76 Ubuntu 12.04 #只可读
client2 10.1.1.78 Ubuntu 12.04 #可读可写
server  10.1.1.70 CentOS6.5

服务器端配置:
IP:10.1.1.70
系统:CentOS6.5
存储目录:/opt/nfs-disk

安装步骤:

yum -y install nfs-utils rpcbindchkconfig --level 2345 rpcbind onchkconfig --level 2345 nfs onservice rpcbind startservice nfs startmkdir /opt/nfs-disk/hui-zhi-e-zhan #hui-zhi-e-zhan client使用的网站目录vi /etc/exports#编辑配置文件,内容如下
/opt/nfs-disk/hui-zhi-e-zhan 10.1.1.76(rw,sync,root_squash)/opt/nfs-disk/hui-zhi-e-zhan 10.1.1.78(rw,sync,no_root_squash)
exportfs -rv热加载配置文件

客户端配置:
client1 10.1.1.76 Ubuntu 12.04 #只可读
client2 10.1.1.78 Ubuntu 12.04 #可读可写
挂载路径:/opt/webapps

安装步骤:
sudo apt-get install nfs-commonmount -t nfs 10.1.1.70:/opt/nfs-disk/hui-zhi-e-zhan   /opt/webapps-o rw

先写这么多吧,下次更新NFS相关的防火墙配置
原创粉丝点击