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
  • 相关阅读:
    Linux下高并发socket最大连接数所受的各种限制
    Oracle DB 使用资源管理
    Oracle DB 资源管理
    C++ 封装私有堆(Private Heap)
    用宏实现 C++ Singleton 模式
    基于 crt debug 实现的 Windows 程序内存泄漏检测工具
    如何养成良好的 C++ 编程习惯 —— 内存管理
    OCP-1Z0-053-V12.02-643题
    Oracle DB 通过SQL 优化管理性能
    OCP-1Z0-052-V8.02-141题
  • 原文地址:https://www.cnblogs.com/reblue520/p/9689587.html
Copyright © 2011-2022 走看看