标签:nfs服务端
++++++++++++++++++++++++++++++++NFS服务端+++++++++++++++++++++++++++++++++
1)打印系统版本
cat /etc/redhat-release
[root@cenos5 ~]# cat /etc/redhat-release
CentOS release 6.6 (Final)
uname -r
[root@cenos5 ~]# uname -r
2.6.32-504.el6.x86_64
uname -m
[root@cenos5 ~]# uname -m
x86_64
2)检查并安装NFS服务
rpm -aq nfs-utils portmap rpcbind
LANG=EN
yum grouplist
yum install nfs-utils rpcbind -y
rpm -aq nfs-utils portmap rpcbind(必须安装以下两个包)
[root@cenos5 ~]# rpm -qa nfs-utils portmap rpcbind
nfs-utils-1.2.3-64.el6.x86_64
rpcbind-0.2.0-11.el6.x86_64
3)启动RPC及NFS服务并检查
/etc/init.d/rpcbind start
[root@cenos5 ~]# /etc/init.d/rpcbind start
Starting rpcbind: [ OK ]
ps -ef|grep rpc
[root@cenos5 ~]# ps -ef |grep rpc
rpc 1601 1 0 11:43 ? 00:00:00 rpcbind
root 1605 1386 0 11:44 pts/0 00:00:00 grep rpc
/etc/init.d/rpcbind status
[root@cenos5 ~]# /etc/init.d/rpcbind status
rpcbind (pid 1601) is running...
rpcinfo -p localhost
[root@cenos5 ~]# rpcinfo -p localhost
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
/etc/init.d/nfs start
[root@cenos5 ~]# /etc/init.d/nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS mountd: [ OK ]
Starting NFS daemon: [ OK ]
Starting RPC idmapd: [ OK ]
rpcinfo -p localhost
[root@cenos5 ~]# rpcinfo -p localhost
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 875 rquotad
100011 2 udp 875 rquotad
100011 1 tcp 875 rquotad
100011 2 tcp 875 rquotad
100005 1 udp 35343 mountd
100005 1 tcp 52042 mountd
100005 2 udp 53616 mountd
100005 2 tcp 37579 mountd
100005 3 udp 57976 mountd
100005 3 tcp 53085 mountd
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100227 2 tcp 2049 nfs_acl
100227 3 tcp 2049 nfs_acl
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100227 2 udp 2049 nfs_acl
100227 3 udp 2049 nfs_acl
100021 1 udp 41285 nlockmgr
100021 3 udp 41285 nlockmgr
100021 4 udp 41285 nlockmgr
100021 1 tcp 49062 nlockmgr
100021 3 tcp 49062 nlockmgr
100021 4 tcp 49062 nlockmgr
4)设置开机自启动并检查
chkconfig nfs on
chkconfig rpcbind on
chkconfig --list nfs
chkconfig --list rpcbind
5)配置共享/data目录
cat >>/etc/exports<<EOF
#shared data for bbs by oldboy at 20140901
/data 192.168.59.131/24(rw,sync)
EOF
cat /etc/exports
6)创建共享目录
mkdir /data
ll /data/
chown -R nfsnobody.nfsnobody /data
7)平滑加载NFS服务并检查服务
/etc/init.d/nfs reload
showmount -e localhost
[root@cenos5 ~]# showmount -e localhost
Export list for localhost:
/data 192.168.59.131/24
++++++++++++++++++++++++++++++++++++NFS客户端+++++++++++++++++++++++++++++++++++++
1)检查系统版本
hostname nfsclient 更改主机名
cat /etc/redhat-release
uname -r
uname -m
2)安装rpc服务并检查
rpm -aq nfs-utils portmap rpcbind
yum groupinstall "NFS file server" -y
rpm -aq nfs-utils portmap rpcbind
3)启动rpc服务并检查
/etc/init.d/rpcbind start
/etc/init.d/rpcbind status
4)设置开机自启动并检查
chkconfig rpcbind on
chkconfig --list rpcbind
5)检查服务端的NFS是否OK
showmount -e 192.168.59.131
[root@nfscient ~]# showmount -e 192.168.59.131
Export list for 192.168.59.131:
/data 192.168.59.131/24
排查故障:
ping 192.168.59.131
telnet 192.168.59.131 111
注意防火墙
6)挂载并测试
mount -t nfs 192.168.59.131:/data /mnt
cd /mnt
ls -l
touch 123.log
ls -l
echo "mount -t nfs 192.168.59.131:/data /mnt" >>/etc/rc.local
本文出自 “蛮荒之力” 博客,请务必保留此出处http://chenfei123.blog.51cto.com/1427669/1701170
标签:nfs服务端
原文地址:http://chenfei123.blog.51cto.com/1427669/1701170