zoukankan      html  css  js  c++  java
  • 【CentOS7.9】创建及挂载共享文件夹

    ##################
    ##   服务端配置   ##
    ##################
    mkdir /ycx/upload
    mkdir -p /ycx/data/nginx/html
    
    # 安装nfs
    yum -y install nfs-utils
    
    # 共享文件夹
    vi /etc/exports
    
    /ycx/upload 10.176.22.98(rw,no_root_squash)
    /ycx/upload 10.176.22.99(rw,no_root_squash)
    
    /ycx/data/nginx/html 10.176.22.98(rw,no_root_squash)
    /ycx/data/nginx/html 10.176.22.99(rw,no_root_squash)
    
    # 共享生效
    exportfs -a
    
    # 设置权限,很重要,配置no_root_squash不用设置
    chown -R nfsnobody.nfsnobody /ycx/upload
    chown -R nfsnobody.nfsnobody /deya/data/nginx/html
    # 检查共享目录是否设置正确 showmount
    -e # 开机启用 systemctl enable nfs # 启动nfs systemctl start nfs # 停用防火墙 systemctl stop firewalld.service ################## ## 客户端配置 ## ################## mkdir /ycx/upload mkdir -p /ycx/data/nginx/html # 安装nfs yum -y install nfs-utils rpcbind # 开机启用 systemctl enable nfs # 启动nfs systemctl start nfs # 检查共享目录是否设置正确 showmount -e 10.176.22.132 # 挂载服务端硬盘到客户端服务器 mount -t nfs 10.176.22.132:/ycx/upload /deya/upload mount -t nfs 10.176.22.132:/ycx/data/nginx/html /ycx/data/nginx/html # 取消挂载 umount 10.176.22.132:/ycx/upload umount 10.176.22.132:/ycx/data/nginx/html
  • 相关阅读:
    python3----练习题(斐波那契)
    python3----运算符
    python3----函数、匿名函数
    python3----生成器generator(yield)
    Python捕获异常
    OS模块
    发送邮件
    IO文件读写
    Unittest框架概念
    生成报告
  • 原文地址:https://www.cnblogs.com/yangchongxing/p/15135476.html
Copyright © 2011-2022 走看看