苏州网站建设科技,wordpress rewrite nginx,网页定制,网站做不做双解析CentOS 7中搭建NFS文件共享服务器的完整步骤
要求#xff1a;实现镜像文件共享#xff0c;并基于挂载的共享目录配置yum源。
系统环境#xff1a;
服务器#xff1a;172.20.26.167-CentOS7.6
客户端#xff1a;172.20.26.198-CentOS7.6
1、在服务器和客户端上#x…CentOS 7中搭建NFS文件共享服务器的完整步骤
要求实现镜像文件共享并基于挂载的共享目录配置yum源。
系统环境
服务器172.20.26.167-CentOS7.6
客户端172.20.26.198-CentOS7.6
1、在服务器和客户端上关闭防火墙以及selinux安装nfs服务组件
stop firewalld systemctl disable firewalld
vi /etc/selinux/config
enforcringdisabled
yum -y intall nfs-utils rpcbind
在服务器上设置/mnt/cdrom 为共享文件
[rootlocalhost /]# vim /etc/exports
wq 保存退出并重启服务
[rootlocalhost /]# systemctl start rpcbind
[rootlocalhost /]# systemctl start nfs
[rootlocalhost /]# exportfs -r 2、在客户端172.20.26.198上
可用showmount搜索网络中可用的共享文件创建挂载点创建挂载
[rootlocalhost ~]# showmount -e 172.20.26.167 [rootlocalhost ~]# mkdir /mnt/nfs
[rootlocalhost ~]# mount -t nfs -o soft,timeo1 172.20.26.167:/mnt/cdrom /mnt/nfs 3、想要挂载永久生效需要挂载信息写进fstab 文件里否则机器重启挂载信息丢失 [rootlocalhost ~]# vim /etc/fstab [rootlocalhost ~]# mount -a #表示读取fstab 里的信息进行挂载
[rootlocalhost ~]# df [rootlocalhost /]# cd /mnt/nfs
[rootlocalhost nfs]# ll [rootlocalhost /]# vim /etc/yum.repos.d/nfs.repo [rootlocalhost /]# yum makecache
[rootlocalhost /]# yum repolist