一堆命令部署NFS

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了一堆命令部署NFS相关的知识,希望对你有一定的参考价值。

环境准备:
server--172.16.1.31
client---172.16.1.41

server端部署:
1 #!/bin/bash
2
3 #check info
4
5 #time 2018.01.29
6
7 #Software inspection and installation
8 rpm -qa nfs-utils rpcbind && yum -y install nfs-utils rpcbind
9
10 #To configure file
11 cat >/etc/exports <<EOF
12 /data 172.16.1.0/24(rw,sync)
13 EOF
14 ##Create a directory
15
16 mkdir -p /data && chown -R nfsnobody.nfsnobody /data
17
18 ##start-up
19
20 /etc/init.d/rpcbind restart && /etc/init.d/nfs restart && /etc/init.d/rpcbind restart && /etc/init.d/nfs restart
21
22 #Local mount
23
24 showmount -e 172.16.1.31
25
26 #mount
27
28 mount -t nfs 172.16.1.31:/data /mnt
29
30 #See
31 df -h

client端部署:

#!/bin/bash
#time 2018.01.29
#cliet Deployment

#Check whether the software is installed
rpm -qa nfs-utils rpcbind && yum -y install rpcbind nfs-utils

#Does the shared directory exist
showmount -e 172.16.1.31 && mount -t nfs 172.16.1.31:/data/ /mnt/

#inspect
df -h

以上是关于一堆命令部署NFS的主要内容,如果未能解决你的问题,请参考以下文章

一堆命令部署rsync以及客户端部署

在kubernetes中部署kubersphere

02—NFS服务器的原理和部署

02—NFS服务器的原理和部署

OpenStack 存储服务 Cinder存储节点部署NFS(十七)

Linux中部署YUM仓库及NFS共享服务