码迷,mamicode.com
首页 > 其他好文 > 详细

nfs安装

时间:2016-11-20 00:24:30      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:nfs


参考:

http://www.jb51.net/os/RedHat/155286.html

服务端配置

1 安装

yum install -y nfs-utils 

a、检查系统是否开启nfs服务:service nfs status 结果显示nfs: unrecognized service,说明系统没有安装nfs服务,so 安装之;


注意,yum install nfs是无法安装的,应该用yum install nfs-utils.


b、开启portmap服务,还是unrecognized service ,安装之,yum install portmap 未果,百度+google之,发现centos 6.4中portmap 已经被rpcbind取代,于是乎继续安装之,未果,检查下是不是已经在安装nfs-utils包的时候安装了,service rpcbind status ,果然已经一块安装了。


以上为整个安装过程,总结下就是centos 6.x之后的系统一个命令yum install nfs-utils 全部搞定,貌似5.x版本的也可以用这个命令搞定,搞不定的话可以单独装portmap;主要6.x版本用的事rpcbind, 5.x版本用的是portmap

2 设置开机启动服务

chkconfig nfs on

chkconfig rpcbind on

3 启动相关服务

service rpcbind start

service nfs start

4 创建共享目录

mkdir /data

5 编辑/etc/exports文件添加如下内容

vi /etc/exports

/data/ *(insecure,rw,sync)

6 刷新配置立即生效

exportfs -a

客户端配置

1 安装nfs-utils

[root@bogon ~]# yum -y install nfs-utils

2 设置开机启动服务

chkconfig nfs on

chkconfig rpcbind on

3.启动服务

servicerpcbind start

servicenfs start

4.创建挂载点

mkdir -p /var/www/html

5 挂载目录

[root@bogon html]# mount -t nfs 192.168.57.132:/data/www /var/www/html

6 查看

[root@bogon html]# df -h

文件系统                  容量  已用  可用 已用% 挂载点

/dev/mapper/centos-root    18G  3.8G   14G   22% /

devtmpfs                  479M     0  479M    0% /dev

tmpfs                     489M     0  489M    0% /dev/shm

tmpfs                     489M  6.7M  483M    2% /run

tmpfs                     489M     0  489M    0% /sys/fs/cgroup

/dev/sda1                 497M  125M  373M   25% /boot

tmpfs                      98M     0   98M    0% /run/user/0

192.168.57.132:/data/www   18G  3.1G   15G   18% /var/www/html

7 卸载挂载的目录

[root@bogon html]# umount /var/www/html

8 编辑/etc/fstab,开机自动挂载

vi /etc/fstab

192.168.57.132:/data/www /var/www/html nfs rw,tcp,intr 0 1


报错:

mount.nfs: access denied by server while mounting 192.168.57.132:/data/www

参考链接:http://blog.chinaunix.net/uid-20554957-id-3444786.html

服务端 vi /etc/exports加入insecure

[root@bogon www]# more /etc/exports

/data/ *(insecure,rw,sync)




运维部署步骤:

1 开发给代码zip的

2 备份

3 放到临时目录中并解压

4 覆盖到网站中


本文出自 “卓尔的博客” 博客,请务必保留此出处http://6874869.blog.51cto.com/6864869/1874640

nfs安装

标签:nfs

原文地址:http://6874869.blog.51cto.com/6864869/1874640

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!