Linux下安装NFS
一、
准备两台机器CentOS6.x
一个做NFS 服务器
一个做客户端
二、
安装NFS服务器
1.查看是否安装nfs和rpcbind
[root@nfs_01 ~]# rpm -qa nfs-utils rpcbind
出现: rpcbind-0.2.0-11.el6.x86_64
nfs-utils-1.2.3-54.el6.x86_64
出现: rpcbind-0.2.0-11.el6.x86_64
nfs-utils-1.2.3-54.el6.x86_64
说明已经安装
如果没有安装可以使用yum 安装
yum install nfs-utils rpcbind -y
2.启动rpcbind
/etc/init.d/rpcbind start
3.启动nfs
/etc/init.d/nfs start
4.配置
/etc/rpcbind 文件
进入
/etc/rpcbind
vi /etc/exports
在文件中加入 : /data/bbs 10.0.70.111/24(rw,sync)
5.平滑重启
/etc/init.d/nfs reload
6.查看是否共享成功
showmount -e localhost
三、
安装客户端(
客户端只需要安装repbind即可)
1.开启rpcbind
/etc/init.d/rpcbind start
2.设置rpcbind开机启动
chkconfig rpcbind on
3.查看是否开机启动rpcbind
chkconfig --list rpcbind
4.进入共享目录:
showmount -e NFS服务器IP地址
5.如果进入不了就关闭NFS服务器的防火墙
service iptables stop
6.把/data/bbs挂载到本地mnt目录:/data/bbs就会是客户端/mnt目录
mount -t nfs 10.0.70.110:/data/bbs /mnt
7.查看是否挂载
df -h
查看到
10.0.70.110:/data/bbs 说明已经成功安装