设为首页 加入收藏

TOP

阿里云服务器Ubuntu 14.04.2和centos7.5实现nfs挂载(一)
2019-09-03 01:49:45 】 浏览:41
Tags:阿里 服务器 Ubuntu 14.04.2 centos7.5 实现 nfs 挂载

前提条件,确保两个ip可以正常通信

确认服务端是否安装nfs-utils和rpcbind
[root@localhost /]# rpm -qa|grep "nfs"
nfs4-acl-tools-0.3.3-17.el7.x86_64
libnfsidmap-0.25-19.el7.x86_64
nfs-utils-1.3.0-0.61.el7.x86_64

[root@localhost /]# rpm -qa|grep "rpc"
xmlrpc-c-client-1.32.5-1905.svn2451.el7.x86_64
libtirpc-0.2.4-0.10.el7.x86_64
rpcbind-0.2.0-47.el7.x86_64
xmlrpc-c-1.32.5-1905.svn2451.el7.x86_64

mkdir /data/sharestore 创建共享目录

chmod -Rf 777 /data/sharestore 确保其他用户对该目录具备读写权限(该步骤可以不执行)
服务端配置
cat /etc/exports
/data/sharestore *(insecure,rw,no_root_squash,no_all_squash,async)

exports参数相关可以参考:https://blog.csdn.net/qq_36357820/article/details/78488077

cat /etc/sysconfig/nfs|grep -v '#'
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
RPCNFSDARGS="-N 4"
MOUNTD_PORT=10892
STATD_PORT=10662
STATD_OUTGOING_PORT=12020
GSS_USE_PROXY="yes"

systemctl restart rpcbind
systemctl restart nfs-server

systemctl enable rpcbind
systemctl enable nfs-server

exportfs -r 使配置文件立即生效

 

客户端配置:

 

确认是否安装:nfs-common 该包提供showmount等功能

执行:dpkg-query -l nfs-common

出现以下信息说明已安装
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==================================================-==============================-==============================-=========================================================================================================
ii nfs-common 1:1.2.8-6ubuntu1.2 amd64 NFS support files common to client and server

 

 

mkdir /nfsfile 创建挂载目录

chmod -Rf 777 /nfsfile(具备读写权限即可,可以不给777)

showmount -e 服务端ip(如果出现服务端共享的目录信息说明目录共享成功)

rpcinfo -p 服务端ip地址 ---查看服务端rpc进程(该命令不指定ip地址可以用于获取本地rpc进程)

   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

    100005    1   udp  20048  mountd

    100005    1   tcp  20048  mountd

    100005    2   udp  20048  mountd

    100005    2   tcp  20048  mountd

    100005    3   udp  20048  mountd

    100005    3   tcp  20048  mountd

    100003    3   tcp   2049  nfs

    100003    4   tcp   2049  nfs

 

首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇fs.inotify.max_user_watches默认.. 下一篇mysql传统主从配置与主从监控

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目