Get the App
SLTechnology News&Howtos  ›  Servers  › 

SHELL script to configure NFS remote sharing on Centos7

Shulou Source: shulou.com Published: 2022-06-02 16:11:50 11月14日 Update

NFS remote sharing 1. Remote shared server configuration script #! / bin/bash# master server NFS configuration script # create a new disk partition echo "n p w" | fdisk / dev/sdb# New disk mount point mkdir / mnt/sdb# format disk partition mkfs.xfs / dev/sdb1# add automatic mount echo "/ dev/sdb1 / mnt/sdb xfs defaults 0 "> > / etc/fstabmount-a # installation service yum install nfs-utils rpcbind-y # modify configuration file echo" / mnt/sdb 192.168.102.128Unip 24 (rw Sync,no_root_squash) "> > / etc/exports# enable service systemctl start nfssystemctl start rpcbind# turn off firewall systemctl stop firewalld.servicesetenforce check whether empty share goes out showmount-e2. The local http site uses the space script #! / bin/bash# client server configuration script # turn off the firewall systemctl stop firewalld.servicesetenforce install the http service yum install httpd-y # mount the http site to the space shared by the master server mount 192.168.102.128:/mnt/sdb / var/www/html# view the space of the site df-hT

Tags: Services scripts configurations servers disks space sites firewalls fireproofing customers files formats Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Microsoft Shulou Information Xiaomi Huawei