• exportfs 入门/ 错误


    exportfs -uv 不能卸载,

    exportfs -au 才可以

    ================================================================================================================================================================================

    参照 http://www.bkjia.com/Linux/766463.html 做, 结果出了很多问题, 看到 不同版本, 不能一个搞法。。

    vi /etc/exports

    /home/test 192.168.4.*(rw,sync,no_root_squash)
    ~

    ++++++

    [root@lk1 ~]# service nfs restart
    Shutting down NFS daemon: [ OK ]
    Shutting down NFS mountd: [ OK ]
    Shutting down NFS quotas: [ OK ]
    Shutting down NFS services: [ OK ]
    Shutting down RPC idmapd: [ OK ]
    Starting NFS services: exportfs: No options for /home/test 192.168.4.(rw,sync,no_root_squash): suggest 192.168.4.(rw,sync,no_root_squash)(sync) to avoid warning
    [ OK ]
    Starting NFS quotas: [ OK ]
    Starting NFS mountd: [ OK ]
    Starting NFS daemon: [ OK ]
    Starting RPC idmapd: [ OK ]

    [root@lk1 ~]# exportfs -r
    exportfs: No options for /home/test 192.168.4.(rw,sync,no_root_squash): suggest 192.168.4.(rw,sync,no_root_squash)(sync) to avoid warning

    ++++++++++++

    但是
    cat /var/log/messages | grep mount 没有看到任何错误。。

    +++++++++++++++++++++++++++

    [root@lk1 ~]# mount -t nfs 192.168.4.51:/home/test /mnt
    mount.nfs: access denied by server while mounting 192.168.4.51:/home/test
    [root@lk1 ~]#
    [root@lk1 ~]# !ex
    exportfs -r
    exportfs: No options for /home/test 192.168.4.(rw,sync,no_root_squash): suggest 192.168.4.(rw,sync,no_root_squash)(sync) to avoid warning
    [root@lk1 ~]#
    [root@lk1 ~]# mount -t nfs 192.168.4.51:/home/test /mnt
    mount.nfs: access denied by server while mounting 192.168.4.51:/home/test

    ++++++++++

    showmount -e
    Export list for lk1:
    /home/test 192.168.4.*(rw,sync,no_root_squash)

    ++++++ showmount -d 没有结果
    [root@lk1 ~]# showmount -d
    Directories on lk1:

    ----------- 192.168.4.*(rw,sync,no_root_squash) <====== 原来是有 中文括号引起的!! 我擦 !!! 这些个我是从网页复制过来的, 没注意检查, 结果出了大问题啊!!!

    ++++++++++++++++++++++

    =============================================================================================================================================

    昨天配置NFS,中间没出现任何不正常的反映,但最后在客户端使用
    mount -t nfs hdp1:/test /mnt
    挂载NFS目录,显示

    “mount.nfs:access denied by server while mounting hdp1:/test”

    莫名其妙的被服务器拒绝,然后就一直搞不清有什么问题,提示是权限不够,所以就
    chmod 777 /test
    chmod 777 /mnt
    并且用户都使用root
    exports中的共享选项都是no_squash

    但结果就是死活都是access denied。
    没办法就上网搜索,有些说的tcp warpper限制,有的说是iptables限制,但都不适用于我这种情况。

    最后不经意间看到有人说是exports的共享范围设置有问题,看了我的设置:
    /test 192.168.2.*(rw,no_squash)

    把192.168.2.换成192.168.2.3就可以了,但这样的话权限定义的就太细了,我要开放给2段,不能使用通配符,要使用192.168.2.0/24。
    不知这到底是什么原因,个人猜测是不是NFS的代码上的验证方式。是否可以这么理解:在192.168.2.2上mount,NFS将配置hosts文件,使用127.0.0.1来与192.168.2.*进行验证,导致不能通过验证,所以结构就是access denied。

    目前没有深究这个问题,可能是hosts文件有影响,等闲的时候再试试看。

  • 相关阅读:
    长连接网关技术专题(八):B站基于微服务的API网关从0到1的演进之路
    社交软件红包技术解密(十二):解密抖音春节红包背后的技术设计与实践
    dubbo的消费者是怎么获取提供者服务接口引用的?
    新版本MybatisPlus分页插件失效 一年
    《穷爸爸和富爸爸》&《思考致富》读后感
    windows下搭建MQTT服务器
    如何使用curl POST方式上传文件
    Python flask实现文件接收保存
    使用Python Flask获取curl传来的JSON数据
    Vue实现顶部栏和侧边栏不变
  • 原文地址:https://www.cnblogs.com/FlyAway2013/p/6008999.html
Copyright © 2020-2023  润新知