CentOS使用NFS服务进行文件共享

以centos 8 为例,安装nfs服务:

dnf install -y nfs-utils;

编辑配置文件:

vi /etc/exports

相关命令:

rpcinfo -p;
showmount;
mount -t nfs 211.69.140.165:/data /nfs/center

查看rpc服务端口:

rpcinfo -p
   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
    100024    1   udp  51783  status
    100024    1   tcp  33877  status
    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
    100227    3   tcp   2049  nfs_acl
    100021    1   udp  32937  nlockmgr
    100021    3   udp  32937  nlockmgr
    100021    4   udp  32937  nlockmgr
    100021    1   tcp  35755  nlockmgr
    100021    3   tcp  35755  nlockmgr
    100021    4   tcp  35755  nlockmgr

注:曾经使用Anolis OS 8.6 的某个版本,使用4.19的内核,nfs的mountd服务端口无法访问,导致nfs服务无法使用,升级内核就好了。

参考:

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享