Preparing the Environment
[root@root ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
- Turn off the firewall
[root@root ~]# systemctl stop firewalld
- Close selinux
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
Mount the ISO image Centos7
[root@root ~]# mkdir /mnt/cdrom
vim /etc/fstab
/dev/cdrom /mnt/cdrom iso9660 defaults 0 0
- Mounting
[root@root ~]# mount /mnt/cdrom
[root@root ~]# ll /mnt/cdrom/
总用量 636
-r--r--r--. 1 root root 14 12月 10 2015 CentOS_BuildTag
dr-xr-xr-x. 3 root root 2048 12月 10 2015 EFI
-r--r--r--. 1 root root 215 12月 10 2015 EULA
-r--r--r--. 1 root root 18009 12月 10 2015 GPL
dr-xr-xr-x. 3 root root 2048 12月 10 2015 images
dr-xr-xr-x. 2 root root 2048 12月 10 2015 isolinux
dr-xr-xr-x. 2 root root 2048 12月 10 2015 LiveOS
dr-xr-xr-x. 2 root root 612352 12月 10 2015 Packages
dr-xr-xr-x. 2 root root 4096 12月 10 2015 repodata
-r--r--r--. 1 root root 1690 12月 10 2015 RPM-GPG-KEY-CentOS-7
-r--r--r--. 1 root root 1690 12月 10 2015 RPM-GPG-KEY-CentOS-Testing-7
-r--r--r--. 1 root root 2883 12月 10 2015 TRANS.TBL
Installation vsftp
Since the network is so mounted yum source obtained from the mirror mounting
[root@root ~]# cd /mnt/cdrom/Packages/
[root@root Packages]# rpm -ivh vsftpd-3.0.2-10.el7.x86_64.rpm
准备中... ################################# [100%]
正在升级/安装...
1:vsftpd-3.0.2-10.el7 ################################# [100%]
- Start ftp
[root@root Packages]# systemctl start vsftpd
- Copy the image to the / var / ftp / pub directory
[root@root Packages]# cp -a /mnt/* /var/ftp/pub/
[root@root Packages]# ll /var/ftp/pub/cdrom/
总用量 100
-r--r--r--. 1 root root 14 12月 10 2015 CentOS_BuildTag
dr-xr-xr-x. 3 root root 33 12月 10 2015 EFI
-r--r--r--. 1 root root 215 12月 10 2015 EULA
-r--r--r--. 1 root root 18009 12月 10 2015 GPL
dr-xr-xr-x. 3 root root 54 12月 10 2015 images
dr-xr-xr-x. 2 root root 4096 12月 10 2015 isolinux
dr-xr-xr-x. 2 root root 41 12月 10 2015 LiveOS
drwx------. 2 root root 32768 5月 7 21:47 Packages
dr-xr-xr-x. 2 root root 4096 12月 10 2015 repodata
-r--r--r--. 1 root root 1690 12月 10 2015 RPM-GPG-KEY-CentOS-7
-r--r--r--. 1 root root 1690 12月 10 2015 RPM-GPG-KEY-CentOS-Testing-7
-r--r--r--. 1 root root 2883 12月 10 2015 TRANS.TBL
Installation createrepo
[root@root Packages]# cd /var/ftp/pub/cdrom/Packages/
[root@root Packages]# rpm -ivh createrepo-0.9.9-23.el7.noarch.rpm
Create a yum repository
[root@root Packages]# cd /var/ftp/pub/
[root@root pub]# createrepo .
Spawning worker 0 with 577 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
- So far the network yum warehouse was set for
test
- Modify the client yum configuration file
[root@root yum.repos.d]# mv /etc/yum.repos.d/* /tmp/
- Create a repo file
[root@root yum.repos.d]# vim Centos7-yum.repo
[centos7_yum]
name=glusterfs
baseurl=ftp://172.16.1.201/pub
gpgcheck=0
enabled=1
gpgkey=ftp://172.16.1.201/pub/RPM-GPG-KEY-CentOS-7
ip address yum warehouse server address
[root@root ~]# yum makecache
已加载插件:fastestmirror
glusterfs | 2.9 kB 00:00:00
(1/3): glusterfs/filelists_db | 482 kB 00:00:00
(2/3): glusterfs/primary_db | 439 kB 00:00:00
(3/3): glusterfs/other_db | 211 kB 00:00:00
Determining fastest mirrors
元数据缓存已建立