文章目录

  • 1. 准备
  • 2. 部署
    • 2.1 先安装cobbler命令
    • 2.2 以zabbix3.0为例

搭建内网yum源镜像仓库
主要解决内网服务器,无法访问外网,但需安装必要包,搭建内部yun源

1. 准备
  • 准备2台虚拟机centos7
  • 2块网卡,1个连接内网1个连接外网
  • 内存4g
  • cpu2核
2. 部署
2.1 先安装cobbler命令
# 安装epel源
wget wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# 安装cobble
yum install cobble
# 启动cobble,httpd,关闭selinux
getenforce 0
systemctl start cobbled
systemctl enable cobbled
systemctl start httpd
systemctl enable httpd
2.2 以zabbix3.0为例
  • 添加repo源文件

    [root@centos7 yum.repos.d]# cobbler  repo add  --name=zabbix --mirror=http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/ --arch=x86_64  --breed=yum
    
  • 执行同步

    [root@centos7 yum.repos.d]# cobbler reposync
    task started: 2020-10-27_104742_reposync
    task started (id=Reposync, time=Tue Oct 27 10:47:42 2020)
    hello, reposync
    run, reposync, run!
    creating: /var/www/cobbler/repo_mirror/zabbix/config.repo
    creating: /var/www/cobbler/repo_mirror/zabbix/.origin/zabbix.repo
    #其实就是通过命令/usr/bin/reporsync 进行的同步
    running: /usr/bin/reposync -l -n -d - config=/var/www/cobbler/repo_mirror/zabbix/.origin/zabbix.repo --repoid=zabbix --download_path=/var/www/cobbler/repo_mirror -a x86_64
    2.9 kB     00:00
    204 kB   00:00
    348 kB   00:00
    244 kB   00:00
    651 kB   00:00
    725 kB   00:01
    650 kB   00:00     11 kB   00:00
    635 kB   00:01
    254 kB   00:00
    1.8 MB   00:02
    1.8 MB   00:03
    7.3 kB   00:00
    6.8 kB   00:00
    6.8 kB   00:00
    2.3 MB   00:02     received on stderr:
    running: createrepo  -c cache -s sha /var/www/cobbler/repo_mirror/zabbix
    received on stdout: Spawning worker 0 with 7 pkgs
    Spawning worker 1 with 7 pkgs
    Workers Finished
    Saving Primary metadata
    Saving file lists metadata
    Saving other metadata
    Generating sqlite DBs
    Sqlite DBs completereceived on stderr:
    running: chown -R root:apache /var/www/cobbler/repo_mirror/zabbix
    received on stdout:
    received on stderr:
    running: chmod -R 755 /var/www/cobbler/repo_mirror/zabbix
    received on stdout:
    received on stderr:
    *** TASK COMPLETE ***
    
  • 查看同步后的目录

    [root@centos7 zabbix]# ll /var/www/cobbler/repo_mirror/zabbix
    总用量 9568
    drwxr-xr-x 2 root apache    4096 10月 27 10:47 cache
    -rwxr-xr-x 1 root apache     111 10月 27 10:47 config.repo
    drwxr-xr-x 2 root apache    4096 10月 27 10:47 repodata
    -rwxr-xr-x 1 root apache  356564 4月  27 23:57 zabbix-agent-3.0.31-1.el7.x86_64.rpm
    -rwxr-xr-x 1 root apache  249372 4月  27 23:57 zabbix-get-3.0.31-1.el7.x86_64.rpm
    -rwxr-xr-x 1 root apache  742020 4月  27 23:57 zabbix-java-gateway-3.0.31-1.el7.x86_64.rpm
    -rwxr-xr-x 1 root apache  666752 4月  27 23:57 zabbix-proxy-mysql-3.0.31-1.el7.x86_64.rpm
    -rwxr-xr-x 1 root apache  665856 4月  27 23:57 zabbix-proxy-pgsql-3.0.31-1.el7.x86_64.rpm
    -rwxr-xr-x 1 root apache  650356 4月  27 23:57 zabbix-proxy-sqlite3-3.0.31-1.el7.x86_64.rpm
    -rwxr-xr-x 1 root apache   11416 2月  16 2016 zabbix-release-3.0-1.el7.noarch.rpm
    -rwxr-xr-x 1 root apache  260096 4月  27 23:57 zabbix-sender-3.0.31-1.el7.x86_64.rpm
    -rwxr-xr-x 1 root apache 1850868 4月  27 23:57 zabbix-server-mysql-3.0.31-1.el7.x86_64.rpm
    -rwxr-xr-x 1 root apache 1849284 4月  27 23:57 zabbix-server-pgsql-3.0.31-1.el7.x86_64.rpm
    -rwxr-xr-x 1 root apache 2440236 4月  27 23:57 zabbix-web-3.0.31-1.el7.noarch.rpm
    -rwxr-xr-x 1 root apache    7436 4月  27 23:57 zabbix-web-japanese-3.0.31-1.el7.noarch.rpm
    -rwxr-xr-x 1 root apache    6972 4月  27 23:57 zabbix-web-mysql-3.0.31-1.el7.noarch.rpm
    -rwxr-xr-x 1 root apache    6984 4月  27 23:57 zabbix-web-pgsql-3.0.31-1.el7.noarch.rpm
    
  • 使用另一台内网服务器配置yum源进行测试

    cd /etc/yum.repo.d/
    vim zabbix.repo
    [local-zabbix]
    name=local zabbix
    baseurl=http://192.168.133.131/cobbler/repo_mirror/zabbix/
    enabled=1
    gpgcheck=0
    
  • 测试是否可以安装

    yum repolist
    yum install zabbix-agent
    

搭建内网yum源镜像仓库相关推荐

  1. Centos搭建内网yum源

    Centos搭建内网yum源 手动创建repo文件 使用yum-config-manager配置yum源 安装yum-utils 手工指定yum源 将gpgcheck设置为0 Centos搭建内网yu ...

  2. #centos7 创建内网yum源 OpenStack源部署

    #centos7 创建内网yum源 #centos7 自动化安装 本地 内网 web源创建.更新 createrepo http OpenStack源部署 Elven原创 http://www.cnb ...

  3. php71+yum源+epel,搭建CentOS在线yum源镜像服务器

    说明: 操作系统:CentOS 6.7 Nginx版本:1.8.0 rsync版本:3.0.6 IP地址和端口:192.168.3.100:8080 目标:同步CentOS镜像站点的内容到此服务器,通 ...

  4. 这次是在没有外网yum仓库的情况下搭建内网yum仓库和无人值守pxe装机

    额 表达能力不行大家之间看看把   有什么问题可以和我说说 我是之间发的脚本可以之间使用 ks.cfg文件在最后 #!/bin/bash #filename: yumandpxe.sh DI=/med ...

  5. 银河麒麟服务器操作系统V10搭建内网YUM源服务器

    文章目录 系统环境 YUM源拉取服务器(外网)配置 安装createrepo组件 添加repo仓库 拉取repo数据 YUM源服务端(内网)配置 YUM源客户端(内网)配置 系统环境 YUM源拉取服务 ...

  6. 搭建centos在线yum源镜像服务器,搭建CentOS在线yum源镜像服务器(上)

    说明: 操作系统:CentOS 6.x IP地址:192.168.21.188 实现目的:同步CentOS镜像站点的内容到此服务器,并且通过配置http服务器,能够向外提供yum服务 准备篇: 一.安 ...

  7. linux 配置内网yum源

    一.yum服务器端配置 1.安装FTP软件 #yum install vsftpd  #service vsftpd start #chkconfig --add vsftpd #chkconfig ...

  8. 制作内网yum源 同步阿里的源

    本文参考:http://www.studylinux.net/?p=4515 操作系统centos7(selinux  firewalld关闭 ) 安装cobbler命令修改为阿里的yum源  163 ...

  9. 搭建内网yum服务器

    yum介绍 为什么要使用yum Linux系统维护中令管理员很头疼的就是软件包之间的依赖性了,往往是你要安装A软件,但是编译的时候告诉你X软件安装之前需要B软件,而当你安装Y软件的时候,又告诉你需要Z ...

最新文章

  1. 防火墙 iptables 禁止某个域名访问
  2. 2019年4月8日 1021. Remove Outermost Parentheses
  3. 基于ARM A53开发板,使用按键中断及中断底半部实现《led灯状态取反》的驱动
  4. 添加three20模板的方法
  5. 央行降准,房价可能又要骚动了!
  6. P1552 [APIO2012]派遣
  7. 数十万应用结点全息监控,ARMS新上线的应用监控神器到底有多牛?
  8. html+css+js中的小知识点汇聚(无序 停更)
  9. Configuration property name ‘fdfs.thumbImage‘ is not valid---springcloud工作笔记163
  10. Mac OS系统修改Hosts文件的方法
  11. linux百分比查看文件,Linux 如何查看内存使用率百分比?
  12. WIN10平板 如何关闭自动更新
  13. python3之环境搭建以及基础语法
  14. windows彻底删除php,win10如何彻底删除wps
  15. 计算机的安全保障机制,技术安全保障管理制度
  16. 凉鞋问题之贝叶斯公式
  17. 【你觉得这些技术值多少钱?】
  18. 计算机知识竞赛拉赞助,知识竞赛活动方案策划书
  19. Dell 730xd 加外部硬件 风扇变快
  20. 追赶时代浪潮的“脸商”,刷脸支付市场前景广阔

热门文章

  1. 004coursera网站中的VTT字幕的使用
  2. PDF文件格式转换攻略:PDF格式转换图片格式
  3. JVAV SE学习总结(01)
  4. 中信建投X袋鼠云:实时数仓,证券机构的“速度与稳定”
  5. 《新神榜:杨戬》亮点抢先看!追光新神话宇宙再添超燃国风巨作
  6. 【vue+springboot】excel模板下载、导入功能实现
  7. bluehost中国和bluehost美国的区别?应该选择哪个?
  8. 计算机切换器鼠标反应慢,kvm切换器故障操作解决方法详解
  9. 【Java 入门】(六)表设计
  10. 34岁IBM工程师电脑被抢身亡:以命相争背后,是无处安放的生活