小试Linux NFS安装

实验环境:


  • 虚拟机一:系统CentOS6.4 IP:192.168.0.45
  • 虚拟机二:系统CentOS6.4 IP:192.168.0.46

NFS服务器端配置:


  • 打印系统版本:

    1. cat /etc/redhat-release
    2. uname -r
    3. uname -m
  • 检查并安装NFS服务:

    1. rpm -aq nfs-utils portmap rpcbind
    2. LANG=EN
    3. yum grouplist
    4. yum install nfs-utils rpcbind -y
    5. rpm -aq nfs-utils portmap rpcbind
  • 启动RPC及NFS服务并检查:

    1. /etc/init.d/rcpbind start
    2. ps -ef |grep rpc
    3. /etc/init.d/rpcbind status
    4. rpcinfo -p localhost
    5. /etc/init.d/nfs start
    6. rpcinfo =p localhost
  • 设置开机自启动并检查:

    1. chkconfig nfs on
    2. chkconfig rpcbind on
    3. chkconfig --list nfs
    4. chkconfig --list rpcbind
  • 配置共享/data目录:

    1. cat >>/etc/exports<<EOF
    2. #shared data for bbs by jason at 20150810
    3. /data 192.168.0.0/24(rw,sync)----注IP为机器地址网段,24为子网掩码
    4. EOF
    5. cat /etc/exports
  • 创建共享目录:

    1. mkdir /data
    2. ll /data
    3. chown -R nfsnobody.nfsnobody /data
  • 平滑加载NFS服务并检查服务:

    1. /etc/init.d/nfs reload
    2. showmount -e localhost

NFS客户端:


  • 检查系统版本
    1. hostname nfsclient
    2. cat /etc/redhat-release
    3. uname -r
    4. uname -m
  • 安装rpc服务并检查
    1. rpm -aq nfs-utils portmap rpcbind
    2. yum groupinstall "NFS file server" -y
    3. rpm -aq nfs-utils portmap rpcbind
  • 启动rpc服务并检查
    1. /etc/init.d/rpcbind start
    2. /etc/init.d/rpcbind status
  • 设置开机自启动并检查
    1. chkconfig rpcbind on
    2. chkconfig --list rpcbind
  • 检查服务端的NFS是否OK
    1. showmount -e 192.168.0.46
  • 排查故障
    1. ping 192.168.0.46
    2. telnet 192.168.0.46 111
  • 挂载并测试
    1. mount -t nfs 192.168.0.46:/data /mnt
    2. cd /mnt
    3. ls -l
    4. touch jason.log
    5. ls -l
    6. echo "mount -t nfs 192.168.0.46:/data /mnt" >>/etc/rc.local
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • NFS相关介绍一、NFS简介1. NFS(Network File System): NFS是一个文件共享协议, ...
    sjfbjs阅读 4,527评论 0 0
  • 上图所示问题在新版nfs 已经不存在 ,服务器端软件:安装nfs-utils和portmap(rpcbind)nf...
    不排版阅读 4,430评论 1 0
  • 1 概述 通过NFS搭建共享盘,方便共享资料 本次使用,服务器ip的地址是192.168.32.11。需要共享的目...
    ghbsunny阅读 5,320评论 0 1
  • 系统环境: centos73.10.0-514.26.2.el7.x86_64 机器数量:五台 硬盘:四块一块为系...
    think_lonely阅读 10,343评论 0 5
  • 小玉文静秀气,却是东北姑娘,来自长春,在南京读大学,毕业后留在这座城市。她是我朋友中为数不多正常工作的人,不说脏话...
    倩倩不是120阅读 2,761评论 0 0

友情链接更多精彩内容