zoukankan      html  css  js  c++  java
  • centos7中nfs文件系统的使用

    需求:
    
    file01:1.1.1.1(内网ip 172.20.103.212),file02:2.2.2.2(内网ip 172.20.103.211) 这两台机器的 /dev/mapper/myvg-mylv /data  这个盘都挂载到 video01 47.254.78.171, video02 47.254.83.81 这两台机器上
    
    即将file01和file02的/data目录都挂载到video01和video02上
    
    处理:
    file01和file02安装
    yum install -y exportfs nfs-utils
    
    video01和video02安装
    yum install -y nfs-utils
    
    1.在file01和file02添加共享的文件夹和客户端可以访问的IP地址
    
    [root@eus_filmora_file01:~]# vim /etc/exports
    /data *(insecure,rw,no_root_squash,sync,anonuid=500,anongid=500)
    
    # 查看共享文件夹
    
    [root@eus_filmora_file01:/data]# exportfs -rv
    exporting *:/data
    
      
    # 重启file01的NFS服务  
    systemctl restart nfs
      
    2.目标机器video01和video02上创建挂载点并挂载
    
    # 客户端video01和video02操作
    mkdir /file01_nfs
    mkdir /file02_nfs
    
    # 挂载file01和file02
    mount -t nfs 172.20.103.212:/data /file01_nfs -o proto=tcp -o nolock
    mount -t nfs 172.20.103.211:/data /file02_nfs -o proto=tcp -o nolock
    
    # 卸载nfs
    [root@eus_filmora_video01:~]# umount 172.20.103.212:/data
    
    
    列出nfs服务端共享的目录:
    [root@eus_filmora_video01:/file02_nfs]# showmount -e 172.20.103.212
    Export list for 172.20.103.212:
    /data *
    
    [root@eus_filmora_video01:/file02_nfs]# showmount -e 172.20.103.211
    Export list for 172.20.103.211:
    /data *
    
    # 添加开机自动挂载
    [root@eus_filmora_video01:~]# cat /etc/rc.local 
    #!/bin/bash
    
    mount -t nfs 172.20.103.212:/data /file01_nfs -o proto=tcp -o nolock
    mount -t nfs 172.20.103.211:/data /file02_nfs -o proto=tcp -o nolock
    
    报错:
    mount: wrong fs type, bad option, bad superblock on 10.25.177.47:/opt/data07,
           missing codepage or helper program, or other error
           (for several filesystems (e.g. nfs, cifs) you might
           need a /sbin/mount.<type> helper program)
    
    
           In some cases useful info is found in syslog - try
           dmesg | tail or so.
    
    解决:
    yum install -y nfs-utils
    
    报错:
    mount.nfs: access denied by server while mounting 10.25.177.47:/data/voice 
    解决:
    nfs服务端
     vim /etc/sysconfig/nfs
    修改如下:
    RPCNFSDARGS="-N 2 -N 3"
            ----->启用
    # Turn off v4 protocol support
    RPCNFSDARGS="-N 4"     ---->启用
    重启生效
    systemctl restart nfs
  • 相关阅读:
    【activemq artemis】消息持久化——文件系统以及jdbc
    【activemq artemis】安全相关配置
    【微信原生支付】服务商模式-小微商户专属接口:小微商户新增对应APPID关联API
    【activemq artemis】新一代ActiveMQ —— Apache ActiveMQ Artemis
    【签名加解密】c# 对XML进行数字签名并且让java验签成功
    自省书!!!!!
    大前端完整学习路线(详解)//转载自csdn:http://blog.csdn.net/u011047006/article/details/52597178
    Javascript学习十
    Javascript学习九
    Javascript学习八
  • 原文地址:https://www.cnblogs.com/reblue520/p/9689587.html
Copyright © 2011-2022 走看看