云计算学习路线教程大纲课件:使用自建源

云计算学习路线教程大纲课件:使用自建源:

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

综合案例:建立YUM服务器

  1. 提供基础软件包Base [光盘]
  2. 提供update软件包
  3. 提供其它软件包如nginx, zabbix, docker, hadoop, openstack

配置防火墙

[[email protected] ~]# firewall-cmd --permanent --add-service=ftp

[[email protected] ~]# firewall-cmd --reload

关闭SELinux

[[email protected] ~]# setenforce 0

[[email protected] ~]# vim /etc/sysconfig/selinux

SELINUX=disabled

FTP

[[email protected] ~]# yum -y install vsftpd

[[email protected] ~]# systemctl start vsftpd

[[email protected] ~]# systemctl enable vsftpd

实现目标1:提供基础软件Base

挂载centos镜像

[[email protected] ~]# mkdir /var/ftp/{centos6u8,centos7u3}

[[email protected] ~]# mount /home/centos7u3.iso /var/ftp/centos7u3

[[email protected] ~]# echo "mount /home/centos7u3.iso /var/ftp/centos7u3" >> /etc/rc.d/rc.local

[[email protected] ~]# chmod +x /etc/rc.d/rc.local

Yum client测试

[[email protected] ~]# rm -rf /etc/yum.repos.d/CentOS-Base.repo

[[email protected] ~]# vi /etc/yum.repos.d/centos7u3.repo //添加Yum源

[centos7u3]

name=centos7u3

baseurl=ftp://192.168.122.202/centos7u3

gpgcheck=0

enabled=1

[[email protected] ~]# yum makecache

[[email protected] ~]# yum repolist

[[email protected] ~]# yum -y install wget lftp bash-com* vim-enhanced

实现目标2: 提供update

启动yum缓存

[[email protected] ~]# vim /etc/yum.conf

[main]

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

keepcache=1

[[email protected] ~]# yum clean all

[[email protected] ~]# yum -y update

[[email protected] ~]# mkdir /var/ftp/update

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

[[email protected] ~]# yum -y install createrepo

[[email protected] ~]# createrepo /var/ftp/update

Yum client测试

[[email protected] ~]# rm -rf /etc/yum.repos.d/CentOS-Base.repo

[[email protected] ~]# vi /etc/yum.repos.d/update.repo

[update]

name=centos update

baseurl=ftp://192.168.122.202/update

gpgcheck=0

enabled=1

[[email protected] ~]# yum repolist

Loaded plugins: fastestmirror

repo id repo name status

update centos update 75

repolist: 75

[[email protected] ~]# yum -y update

实现目标3: 提供其它软件包如nginx, zabbix

--downloadonly

  1. 配置nginx及zabbix源

[[email protected] ~]# 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

[[email protected] ~]# yum clean all

[[email protected] ~]# yum install nginx --downloadonly

[[email protected] ~]# mkdir /var/ftp/{nginx,zabbix}

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

  1. 创建reopdata:

[[email protected] ~]# createrepo /var/ftp/nginx //如果加入新软件包,重新创建

Yum client测试

[[email protected] ~]# vi /etc/yum.repos.d/nginx.repo

[nginx]

name=nginx

baseurl=ftp://192.168.122.202/nginx

gpgcheck=0

enabled=1

[[email protected] ~]# yum repolist

repo id repo name status

nginx nginx 1

update centos update 75

[[email protected] ~]# yum -y install nginx

客户端使用YUM源:

添加base,update,nginx,zabbix yum源

  1. 手动
  2. Shell
  3. Saltstack, Asible, Puppet

本地源:例如使用安装光盘 [了解]

  1. 挂载安装光盘(临时):

[[email protected] ~]# mount /dev/cdrom /media

[[email protected] ~]# mount -o loop centos7u3.iso /media

  1. 添加yum源

[[email protected] ~]# vim /etc/yum.repos.d/centos7u3.repo

[centos7u3]

name=centos7u3

baseurl=file:///media

gpgcheck=0

enabled=1

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

原文地址:https://blog.51cto.com/14529670/2439710

时间: 2024-09-30 15:36:55

云计算学习路线教程大纲课件:使用自建源的相关文章

云计算学习路线教程大纲课件:磁盘阵列 RAID

云计算学习路线教程大纲课件:磁盘阵列 RAID: RAID 0 全盘 0线性卷,一个数据两个硬盘同时读写,读写速率高,但是不支持容错,不提供冗余机制.需要2块硬盘. RAID 1 镜像卷,一个数据在两块硬盘里写,空间使用为50%,支持容错.需要2块硬盘. RAID 5 需要3块硬盘及以上,空间使用率为2块硬盘空间.支持容错 RAID 10是RAID0与RAID1综合应用. RAID 单盘0 RAID0_single 只需要一块盘,不支持容错, 不提供冗余机制.常见于新服务器,只有一块盘,用来安装

云计算学习路线教程大纲课件:tar项目实战案例

云计算学习路线教程大纲课件:tar项目实战案例: ==================================================================================== [[email protected] ~]# yum -y install mariadb-server [[email protected] ~]# systemctl start mariadb [[email protected] ~]# mkdir /backup 案例1

云计算学习路线教程大纲课件:使用RPM工具管理RPM包

云计算学习路线教程大纲课件:使用RPM工具管理RPM包: ==================================================================================== 需要考虑: OS版本,e.g. Centos6/7 # cat /etc/redhat-release 系统架构,e.g. i386/x86_64 # uname -m 依赖关系,e.g. ntfs-3g-devel 需要依赖ntfs-3g rpm包的版本, e.g. 2

云计算学习路线教程大纲课件:YUM 签名检查机制

云计算学习路线教程大纲课件:YUM 签名检查机制: ==================================================================================== rpm软件提供组织例如redhat在构建rpm包时,使用其私钥(private key)对rpm进行签名 client在使用其rpm包时,为了验证其合法性,可以使用redhat提供的公钥(public key)进行签名检查 方法一: 事先导入公钥 [[email protect

云计算学习路线教程大纲课件:关于DNS

云计算学习路线教程大纲课件:关于DNS: ==================================================================================== 名字解析: NetBios名: tianyun localhost WINS hosts FQDN: 完全限定域名 www.tianyun.com baidu.com www.126.com. mail.qq.com hosts DNS Server 一.hosts文件 作用: 实现名字

云计算学习路线教程大纲课件:关于HTTP Server

云计算学习路线教程大纲课件:关于HTTP Server: ======================================================== 静态元素: .html .img js css swf mp4 动态元素: .php .jsp .cgi .asp php SQL Web Server: Nginx(Tengine).Apache.IIS Web 中间件: php: PHP-fpm.HHVM jsp: Tomcat.JBOSS.Resin.IBM WebSp

云计算学习路线教程大纲课件:HTTP Server: Apache知识点

云计算学习路线教程大纲课件:HTTP Server: Apache知识点: 建议使用2.4及以上的版本 ======================================================== 一.Apache基础 Apache: www.apache.org 软件包: httpd 服务端口: 80/tcp(http) 443/tcp(https,http+ssl) 配置文件: /etc/httpd/conf/httpd.conf /etc/httpd/conf.d/*.

云计算学习路线教程大纲课件:客户端查询

云计算学习路线教程大纲课件客户端查询: ==================================================================================== nslookup,host,dig 客户端指定本地DNS [[email protected] ~]# cat /etc/resolv.conf nameserver 192.168.2.115 [[email protected] ~]# dig www.baidu.com [[emai

云计算学习路线教程大纲课件:部署网上商城ecshop

云计算学习路线教程大纲课件:部署网上商城ecshop: 建议新环境开始 一.基础环境 [[email protected] ~]# sed -ri '/^SELINUX=/cSELINUX=disabled' /etc/selinux/config [[email protected] ~]# setenforce 0 [[email protected] ~]# systemctl stop firewalld.service [[email protected] ~]# systemctl