创新路
我们一直在努力

NFS服务器安装配置

执行命令:yum install nfs-utils portmap nfs4-acl-tools

编辑设置配置文件:vim /etc/exports

所遇问题:centos6.5

portmap: 未被识别的服务

解决方案:

由于在6系列里面,portmap已经改名了 ,6系列需要使用 service rpcbind start启动

启动rpcbind服务。

启动nfs服务

查看NFS服务器:

更新了/etc/exports后,使用如下命令刷新:

exportfs -r

挂载和卸载nfs文件系统使用:

[root@node4 ~]# clear

[root@node4 ~]# showmount -e 192.168.26.209

Export list for 192.168.26.209:

/data/nfs2 *

/data/nfs  *

[root@node4 ~]# mkdir /nfs

[root@node4 ~]# chmod 777 /nfs

[root@node4 ~]# mount -t nfs 192.168.26.209:/data/nfs /nfs

[root@node4 ~]# mount

/dev/mapper/vg1-lv_root on / type ext4 (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

devpts on /dev/pts type devpts (rw,gid=5,mode=620)

tmpfs on /dev/shm type tmpfs (rw)

/dev/sda1 on /boot type ext4 (rw)

/dev/mapper/vg2-lv_data on /data type ext4 (rw)

none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

192.168.26.209:/data/nfs on /nfs type nfs (rw,vers=4,addr=192.168.26.209,clientaddr=192.168.26.218)

[root@node4 ~]# cd /nfs

[root@node4 nfs]# ls

CentOS-6.5-x86_64-bin-DVD1.iso

[root@node4 nfs]# umount -f /nfs

umount2: Device or resource busy

umount.nfs: /nfs: device is busy

umount2: Device or resource busy

umount.nfs: /nfs: device is busy

[root@node4 nfs]# cd

[root@node4 ~]# umount -f /nfs

[root@node4 ~]# mount

/dev/mapper/vg1-lv_root on / type ext4 (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

devpts on /dev/pts type devpts (rw,gid=5,mode=620)

tmpfs on /dev/shm type tmpfs (rw)

/dev/sda1 on /boot type ext4 (rw)

/dev/mapper/vg2-lv_data on /data type ext4 (rw)

none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

[root@node4 ~]# 

客官点个赞呗! (0)
分享到:

评论 抢沙发

评论前必须登录!

天府云博 - 做有态度的开发&运维&设计学习分享平台!

联系我们百度云主机