前言:
存储的主轴线
本地存储
磁盘管理 分区 格式化 自动挂载
LVM逻辑卷(跨区卷)
Raid 磁盘阵列 (条带、镜像、raid5,raid6 ,raid1+0)
——————————————
NFS 网络文件系统
MFS 分布式存储的文件系统
GFS 海量分布式存储的文件系统
学习部署YUM仓库服务
[root@localhost ~]# mount /dev/sr0 /opt
mount: /dev/sr0 写保护,将以只读方式挂载
[root@localhost ~]# rpm -ivh /opt/Packages/sftpd-3.0.2-22.el7.x86_64.rpm
[root@localhost ~]# cd /var/ftp
[root@localhost ftp]# mkdir centos7
[root@localhost ftp]# cp -r /opt/* /var/ftp/centos7/ '后面加&可以在后台运行'
[root@localhost ftp]# systemctl start vsftpd
[root@localhost ftp]# systemctl enable vsftpd
Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.
[root@localhost ftp]# mkdir /var/ftp/other
[root@localhost ftp]# cd /var/ftp/other/
[root@localhost repodata]# createrepo -g /opt/repodata/repomd.xml ./
Directory /opt/repodata/./ must be writable.
[root@localhost other]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.139.132 netmask 255.255.255.0 broadcast 192.168.139.255
[root@localhost yum.repos.d]# ls /opt/centos7
CentOS_BuildTag GPL LiveOS RPM-GPG-KEY-CentOS-7
EFI images Packages RPM-GPG-KEY-CentOS-Testing-7
EULA isolinux repodata TRANS.TBL
[root@localhost yum.repos.d]# vim centos7.repo
[base]
name=centos7
baseurl=ftp://192.168.139.132/centos7
enabled=1
gpgcheck=1
gpgkey=ftp:///opt/RPM-GPG-KEY-CentOS-7
[other]
name=Other RPM Packages
baseurl=ftp://192.168.139.132/other
enabled=1
gpgcheck=0
~
[root@localhost yum.repos.d]# vim centos7.repo
[local]
name=centos7
baseurl=file:///opt
enabked=1
gpgcheck=0
[root@localhost yum.repos.d]# yum clean all '清楚缓存数据'
已加载插件:fastestmirror, langpacks
Repository base is listed more than once in the configuration
正在清理软件源: base extras local other updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@localhost ~]# yum grouplist
[root@localhost yum.repos.d]# yum grouplist gnome-desktop
[root@localhost yum.repos.d]# yum groupinfo gnome-desktop
RPC,远程过程调用,即rpcbind 软件包
[root@localhost ~]# yum install nfs-utils rpcbind -y
[root@localhost ~]# systemctl enable nfs
[root@localhost ~]# systemctl enable rpcbind
[root@localhost ~]# mkdir /opt/wwwroot
[root@localhost ~]# vi /etc/exports
/opt/wwwroot 192.168.7.0/24(rw,sync,no_root_squash)
/var/ftp/pub 192.168.4.11(ro) 192.168.4.110(rw)
共享目录 用户 (rw读写,sync同步,no_root_squash 不对root进行降级处理)
ro 只能读
[root@localhost ~]# systemctl start rpcbind
[root@localhost ~]# systemctl start nfs
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# setenforce 0
[root@localhost ~]# netstat -anpt |grep rpcbind
[root@localhost ~]# netstat -anpu |grep rpcbind
udp 0 0 0.0.0.0:681 0.0.0.0:* 5594/rpcbind
udp 0 0 0.0.0.0:111 0.0.0.0:* 5594/rpcbind
udp6 0 0 :::681 :::* 5594/rpcbind
udp6 0 0 :::111 :::* 5594/rpcbind
[root@localhost ~]# showmount -e 192.168.139.132
Export list for 192.168.139.132:
/opt/wwwroot 192.168.7.0/24
/var/ftp/pub 192.168.4.110,192.168.4.11
_netdev 网络型设备
当目标服务端宕机时,无法进行所有操作,就需要强制挂载
服务端操作,服务端ip地址为192.168.139.141
root@localhost ~]# rpm -q rpcbind
rpcbind-0.2.0-42.el7.x86_64
[root@localhost ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.48.el7.x86_64
[root@localhost ~]# vim /etc/exports
/opt 192.168.139.0/24(rw,sync,no_root_squash)
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl start nfs
[root@localhost ~]# systemctl start rpcbind
[root@localhost network-scripts]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.139.141 netmask 255.255.255.0 broadcast 192.168.139.255
inet6 fe80::e2c1:c26d:afa1:a4ad prefixlen 64 scopeid 0x20<link>
客户机操作
[root@localhost ~]# showmount -e 192.168.139.141
Export list for 192.168.139.141:
/opt 192.168.139.0/24
[root@localhost ~]#
[root@localhost ~]# mount 192.168.139.141:/opt /mnt
[root@localhost ~]# cd /mnt
[root@localhost mnt]# ls
rh
[root@localhost mnt]# mkdir 192.168.139.132
[root@localhost mnt]# ls
192.168.139.132 rh
[root@localhost mnt]#
[root@localhost mnt]# df -hT
文件系统 类型 容量 已用 可用 已用% 挂载点
192.168.139.141:/opt nfs4 20G 4.6G 16G 23% /mnt
服务端查看是否创建
[root@localhost network-scripts]# ls /opt
192.168.139.132 rh
[root@localhost network-scripts]#
站点
软件仓库的提供方式
file://
ftp://
http://
配置文件 /etc/yum.repos.d/*.repo
[base]
name=centos 7.3
baseurl=ftp://192.168.88.88/centos7 ‘软件仓库的路径’
enabled=1 '启用'
gpgcheck=0 '不启用验证'
其他配置文件
基本设置 /etc/yum/conf
日志文件 /var/log/yum.log
yum update 连内核一起升级,
yum upgrade 只更新软件包,不更新内核
依赖于RPC远程过程调用
需要安装nfs-utils、rpcbind 软件包
/var/ftp/pub 192.168.10.0/24(rw,sync,no_root_squash)
用户可以是网段,也可以是ip地址
ro 只可读 rw读写 sync 同步 no_root_squash 不对root用户进行降级处理
也可以直接配置文件的权限
分别是rpcbind和nfs
nfs 网络存储
rpcbind 远程调用
showmount -e 共享服务端ip地址
共享路径 可用用户
查看手动挂载 /etc/mtab
自动挂载
vim /etc/fstab
服务端ip地址:共享目录路径 客户端路径 nfs defaults,_netdev 0 0
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。