Cloud computing tutorial learning course syllabus courseware: Use self-built source

Cloud computing tutorial learning course syllabus courseware: Use self Source:

====================================================================================

Integrated Case: establish YUM server

  1. Provide basic packages Base [CD-ROM]

  2. Provide update packages

  3. Provide other packages such as nginx, zabbix, docker, hadoop, openstack

Configure the firewall

[root@yum-server ~]# firewall-cmd --permanent --add-service=ftp

[root@yum-server ~]# firewall-cmd --reload

Close SELinux

[root@yum-server ~]# setenforce 0

[root@yum-server ~]# vim /etc/sysconfig/selinux

SELINUX=disabled

FTP

[root@yum-server ~]# yum -y install vsftpd

[root@yum-server ~]# systemctl start vsftpd

[root@yum-server ~]# systemctl enable vsftpd

Goal 1: Provide basic software Base

Centos mirror mount

[root@yum-server ~]# mkdir /var/ftp/{centos6u8,centos7u3}

[root@yum-server ~]# mount /home/centos7u3.iso /var/ftp/centos7u3

[root@yum-server ~]# echo "mount /home/centos7u3.iso /var/ftp/centos7u3" >> /etc/rc.d/rc.local

[root@yum-server ~]# chmod +x /etc/rc.d/rc.local

Yum client testing

[root@yum-client ~]# rm -rf /etc/yum.repos.d/CentOS-Base.repo

[Root @ yum-client ~] # vi /etc/yum.repos.d/centos7u3.repo // add source Yum

[centos7u3]

name=centos7u3

baseurl = ftp: //192.168.122.202/centos7u3

gpgcheck=0

enabled=1

[root@yum-client ~]# yum makecache

[root@yum-client ~]# yum repolist

[root@yum-client ~]# yum -y install wget lftp bash-com* vim-enhanced

2 goals: to provide update

Start yum cache

[root@yum-server ~]# vim /etc/yum.conf

[main]

cachedir=/var/cache/yum/$basearch/$releasever

keep cache = 1

[root@yum-server ~]# yum clean all

[root@yum-server ~]# yum -y update

[root@yum-server ~]# mkdir /var/ftp/update

[root@yum-server ~]# find /var/cache/yum/x86_64/7/ -iname "*.rpm" -exec cp -rf {} /var/ftp/update \;

[root@yum-server ~]# yum -y install createrepo

[root@yum-server ~]# createrepo /var/ftp/update

Yum client testing

[root@yum-client ~]# rm -rf /etc/yum.repos.d/CentOS-Base.repo

[root@yum-client ~]# vi /etc/yum.repos.d/update.repo

[update]

name=centos update

baseurl = ftp: //192.168.122.202/update

gpgcheck=0

enabled=1

[root@yum-client ~]# yum repolist

Loaded plugins: fastestmirror

repo id repo name status

update centos update 75

repolist: 75

[root@yum-client ~]# yum -y update

Goal 3: Provide other packages such as nginx, zabbix

--downloadonly

  1. Configuring nginx source and zabbix

[root@yum-server ~]# vim /etc/yum.repos.d/nginx.repo

[nginx]

name=nginx repo

baseurl = http://nginx.org/packages/centos/7/$basearch/

gpgcheck=0

enabled=1

  1. downloadonly

[root@yum-server ~]# yum clean all

[root@yum-server ~]# yum install nginx --downloadonly

[root@yum-server ~]# mkdir /var/ftp/{nginx,zabbix}

[root@yum-server ~]# find /var/cache/yum/x86_64/7/ -iname "*.rpm" -exec cp -rf {} /var/ftp/nginx

  1. Creating reopdata:

[Root @ yum-server ~] # createrepo / var / ftp / nginx // If you add a new package, re-create

Yum client testing

[root@yum-client ~]# vi /etc/yum.repos.d/nginx.repo

[nginx]

name=nginx

baseurl = ftp: //192.168.122.202/nginx

gpgcheck=0

enabled=1

[root@yum-client ~]# yum repolist

repo id repo name status

nginx nginx 1

update centos update 75

[root@yum-client ~]# yum -y install nginx

The client uses YUM Source:

Add a base, update, nginx, zabbix yum source

  1. Manually

  2. Shell

  3. Saltstack, Asible, Puppet

Local Source: for example, CD-ROM [learn]

  1. Mount the CD-ROM (provisional):

[root@tianyun ~]# mount /dev/cdrom /media

or

[root@tianyun ~]# mount -o loop centos7u3.iso /media

  1. Add yum source

[root@tianyun ~]# vim /etc/yum.repos.d/centos7u3.repo

[centos7u3]

name=centos7u3

baseurl = file: /// media

gpgcheck=0

enabled=1

====================================================================================

Guess you like

Origin blog.51cto.com/14529670/2439710