Centos5与Centos6 下安装和部署NFS
2013-04-02 12:04
411 查看
一、安装NFS
1、首先安装NFS套件,命令如下:yum install nfs-utils*(64位系统)
yum install nfs-utils*(32位系统)
2、安装后检测
rpm -qa | grep nfs-utils
[CentOS5]
nfs-utils-版本.el5
nfs-utils-lib-版本.el5
[CentOS6]
nfs-utils-版本.el6
nfs-utils-lib-版本.el6
3、然后安装portmap服务,portmap在centos6中改名为rpcbind
yum install rpcbind(centos6)
yum install portmap(centos5)
二、NFS服务端配置
1、/etc/service 增加端口nfs 2049/tcp nfsd
nfs 2049/udp nfsd
#[CentOS5]
sunrpc 111/tcp portmapper # RPC 4.0 portmapper TCP
sunrpc 111/udp portmapper # RPC 4.0 portmapper UDP
#[CentOS6]
sunrpc 111/tcp rpcbind
sunrpc 111/udp rpcbind
2、/etc/exports配置挂接点和权限
/opt/centos6 192.168.0.0/24(ro,no_root_squash)
#/opt/centos6是挂接点
#192.168.0.0/24 这个网段的服务器可以接受挂接nfs文件系统
#ro只读
#no_root_squash 当访问者为root用户时方位该目录具有root权限
三 启动NFS服务
1、读取/etc/exports 文件exportfs -a
2、启动进程
[CentOS5]
/etc/init.d/portmap start
/etc/init.d/nfs start
chkconfig portmap on
chkconfig nfs on
[CentOS6]
/etc/init.d/rpcbind start
/etc/init.d/nfs start
chkconfig rpcbind on
chkconfig nfs on
3、查看进程和服务
netstat -nulpt |grep -E "111|2049"
看端口和服务是否启动
rpcinfo -p
看nfs mountd portmapper
四客户端访问NFS文件系统
1、查找NFS服务是否可用showmount -e NFS-IP
如果看到了可以NFS服务器端相关消息,就可以使用nfs服务了
2、挂载
mount -t nfs NFS-IP:/opt/centos6 /mnt
[注意:如何解决报错信息]
If you got error such as this:
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified
To fix this, you need to do:
rpc.statd
rpc.mountd
rpcinfo -p
本文出自 “大角牛” 博客,请务必保留此出处http://jingshengsun888.blog.51cto.com/1767811/1169111
相关文章推荐
- CentOS 6.3 NFS部署与安装
- CentOS 7安装部署Solr 7.1:记一次踩坑填坑经历
- 安装centos6.5+配置物理机数据中心+配置网络部署系统服务器
- CentOS 6 NFS的安装配置
- mongodb在centos 6上的安装部署
- CentOS 7.3 NFS服务器的安装与配置
- CentOS 6.6 NFS服务的安装与配置详解
- CentOS6.5 上部署 MySQL5.7.17 二进制安装以及多实例配置
- 在centos7下安装和部署java8和mysql
- CentOS 6.3下安装部署CHEF环境教程
- CentOS上xen虚拟化的安装部署
- centos 6.0 安装配置nfs与排错
- 在Centos7下安装与部署.net core
- 在Centos7下安装与部署.net core
- CentOS 6.4编译安装和部署Zabbix 2.0版本监控(中文)
- CENTOS安装部署zabbix
- CentOS 6.5系统下安装和配置NFS服务
- linux(CentOS7)中安装JDK7,部署jboss7
- CentOS 7.3 环境下详细部署安装分布式存储系统Ceph
- Linux——centos环境部署--一Centos安装图解