溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

云計算學(xué)習(xí)路線教程大綱課件:使用自建源

發(fā)布時間:2020-05-30 17:50:57 來源:網(wǎng)絡(luò) 閱讀:208 作者:wx5d6de969e8c0b 欄目:云計算

云計算學(xué)習(xí)路線教程大綱課件:使用自建源:

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

綜合案例:建立YUM服務(wù)器

  1. 提供基礎(chǔ)軟件包Base [光盤]

  2. 提供update軟件包

  3. 提供其它軟件包如nginx, zabbix, docker, hadoop, openstack

配置防火墻

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

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

關(guān)閉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

實現(xiàn)目標(biāo)1:提供基礎(chǔ)軟件Base

掛載centos鏡像

[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測試

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

[root@yum-client ~]# vi /etc/yum.repos.d/centos7u3.repo //添加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

實現(xiàn)目標(biāo)2: 提供update

啟動yum緩存

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

[main]

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

keepcache=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測試

[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

實現(xiàn)目標(biāo)3: 提供其它軟件包如nginx, zabbix

--downloadonly

  1. 配置nginx及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. 創(chuàng)建reopdata:

[root@yum-server ~]# createrepo /var/ftp/nginx //如果加入新軟件包,重新創(chuàng)建

Yum client測試

[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

客戶端使用YUM源:

添加base,update,nginx,zabbix yum源

  1. 手動

  2. Shell

  3. Saltstack, Asible, Puppet

本地源:例如使用安裝光盤 [了解]

  1. 掛載安裝光盤(臨時):

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

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

  1. 添加yum源

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

[centos7u3]

name=centos7u3

baseurl=file:///media

gpgcheck=0

enabled=1

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

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI