zoukankan      html  css  js  c++  java
  • CentOS 7快速安装配置NFS服务

    Server IP ADD:192.168.153.138
    Client IP ADD:192.168.153.140
    NFS Server安装配置:
    关闭selinux
    vim /etc/selinux/config
    #SELINUX=enforcing
    #SELINUXTYPE=targeted
    SELINUX=disabled     //新增部分
    systemctl stop firewalld
    systemctl disable firewalld
    yum remove firewalls
    yum install iptables-services
    vi /etc/sysconfig/iptables
    -A INPUT -p udp -s 192.168.153.140/32 -j ACCEPT    //新增两条访问策略
    -A INPUT -p tcp -s 192.168.153.140/32 -j ACCEPT
    :wq!
    service start iptables
    systemctl enable iptables
    
    yum install nfs-utils -y //会连同rpcbind依赖包一起安装。
    
    /tmp/nfs 192.168.153.140(rw,sync,fsid=0,no_root_squash,no_all_squash,anonuid=501,anongid=501)
    
    exportfs -r  //使配置生效
    
    1./tmp/nfs  为共享目录
    2.192.168.153.140  //可以为一个网段或一个IP或多个IP
    3.rw表示可读写,ro只读;
    4.sync表示同步模式,内存中数据时写入磁盘;async表示不同步,把内存中数据定期写入磁盘中。
    5.no_root_squash:root用户会对共享目录拥有至高的权限控制,就像是对本机的目录操作一样,不安全,不建议使用;root_squash:root用户对共享目录的权限不高,只有普通用户的权限,
    6.all_squash:不管使用NFS用户是谁,他的身份将会被限定成为一个指定的普通用户身份;
    7.anonuid/anongid:要和root_squash以及all_squash一同使用,同于指定使用NFS用户限定后的uid和gid,前提本机的/etc/passwd中存在这个uid和gid。
    8.fsid=0表示将/tmp/nfs整个目录包装成根目录
    
    nfs开机启动服务
    systemctl enable rpcbind
    systemctl enable nfs-server
    
    启动nfs服务
    
    systemctl start rpcbind
    systemctl start nfs-server
    
    确认NFS服务器启动成功:
    rpcinfo -p
    
    查看service列中是否有nfs服务来确认NFS是否启动
    showmount -e 192.168.153.138     //在nfs server操作
    
    NFS Client安装配置
    关闭selinux
    vim /etc/selinux/config
    #SELINUX=enforcing
    #SELINUXTYPE=targeted
    SELINUX=disabled     //新增部分
    systemctl stop firewalld
    systemctl disable firewalld
    yum remove firewalls
    yum install iptables-services
    vi /etc/sysconfig/iptables
    -A INPUT -p udp -s 192.168.153.138/32 -j ACCEPT    //新增两条访问策略
    -A INPUT -p tcp -s 192.168.153.138/32 -j ACCEPT
    :wq!
    service start iptables
    systemctl enable iptables
    
    yum install nfs-utils -y //会连同rpcbind依赖包一起安装。
    systemctl enable rpcbind
    systemctl start rpcbind
    mkdir /tmp/nfs
    mount -t nfs 192.168.153.138:/tmp/nfs /tmp/nfs/
    vim /etc/fstab       //mount永久生效,重启后mount不消失
    192.168.153.138:/tmp/nfs  /tmp/nfs              nfs     nolock          0 0
    :wq!
  • 相关阅读:
    HihoCoder 1245:王胖浩与三角形 三角形边长与面积
    C++ 读写注册表
    Codestorm:Counting Triangles 查各种三角形的个数
    2015年10月之 叽里咕噜
    HDU 5523:Game
    Codestorm:Game with a Boomerang
    关于GPU-driver for linux的资料
    ACER NV47H75C 安装CUDA 驱动以及调整屏幕
    服务器GTX590安装CUDA
    观后感,读了几篇博文
  • 原文地址:https://www.cnblogs.com/vincent-liang/p/7043274.html
Copyright © 2011-2022 走看看