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

前端之家收集整理的这篇文章主要介绍了制作内网yum源 同步阿里的源前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

本文参考:http://www.studylinux.net/?p=4515

  1. 操作系统centos7(selinux firewalld关闭

  2. 安装cobbler命令修改为阿里的yum源 163的也可以

  1. wget-O/etc/yum.repos.d/CentOS-Base.repo
  2. wget-O/etc/yum.repos.d/epel.repohttp://mirrors.aliyun.com/repo/epel-7.repo

3.安装cobbler命令
最好都安装上

  1. yum-yinstallcobblerdhcphttpdxinetdtftp-server

4.启动服务器

  1. [root@localhost~]#systemctlstarthttpd
  2. [root@localhost~]#systemctlenablehttpd
  3. Createdsymlinkfrom/etc/systemd/system/multi-user.target.wants/httpd.serviceto/usr/lib/systemd/system/httpd.service.
  4. [root@localhost~]#systemctlstartcobblerd
  5. [root@localhost~]#systemctlenablecobblerd
  6. Createdsymlinkfrom/etc/systemd/system/multi-user.target.wants/cobblerd.serviceto/usr/lib/systemd/system/cobblerd.service.
  7. [root@localhost~]#
  8.  
  9. 如果出错:
  10. [root@localhost~]#rpm-qlcobbler|grepsetting
  11. /etc/cobbler/settings
  12. setting
  13. 文件中的serverserver_next
  14. 修改为本机的IP,默认是127.0.0.1
  15. 然后用cobblercheck确定没有问题

5.同步源

  1. mkdir-p/var/www/cobbler/repo_mirror
  2. cd/var/www/cobbler/repo_mirror
  3. cobblerrepoadd--name=zabbix--mirror=http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/--arch=x86_64--breed=yum
  4. cobblerreposync
  5.  
  6. taskstarted:2017-06-04_143254_reposync
  7. taskstarted(id=Reposync,time=SunJun414:32:542017)
  8. hello,reposync
  9. run,reposync,run!
  10. creating:/var/www/cobbler/repo_mirror/zabbix/config.repo
  11. creating:/var/www/cobbler/repo_mirror/zabbix/.origin/zabbix.repo
  12. 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-ax86_64
  13. 3.6kB00:00
  14. 4.3kB00:00
  15. 3.4kB00:00
  16. 3.4kB00:00
  17. 951B00:00
  18. 170kB00:01
  19. 155kB00:01
  20. 167kB00:01
  21. epel/x86_64/updateinfoFailed
  22. base/7/x86_64/primary_dbFailed
  23. 808kB00:08
  24. 4.7MB00:46
  25. 5.6MB01:19
  26. 5.6MB01:00
  27. 20kB00:00
  28. 230kB00:03
  29. 335kB00:07
  30. 714kB00:04
  31. 621kB00:15
  32. 622kB00:16
  33. 11kB00:00
  34. 240kB00:04
  35. 606kB00:08
  36. 1.7MB00:20
  37. 1.7MB00:16
  38. 5.1kB00:00
  39. 4.6kB00:00
  40. 4.7kB00:00
  41. 3.5MB00:48
  42.  
  43. receivedonstderr:
  44. running:createrepo-ccache-ssha/var/www/cobbler/repo_mirror/zabbix
  45. receivedonstdout:Spawningworker0with7pkgs
  46. Spawningworker1with7pkgs
  47. WorkersFinished
  48. SavingPrimaryMetadata
  49. SavingfilelistsMetadata
  50. SavingotherMetadata
  51. GeneratingsqliteDBs
  52. sqliteDBscomplete
  53.  
  54. receivedonstderr:
  55. running:chown-Rroot:apache/var/www/cobbler/repo_mirror/zabbix
  56. receivedonstdout:
  57. receivedonstderr:
  58. running:chmod-R755/var/www/cobbler/repo_mirror/zabbix
  59. receivedonstdout:
  60. receivedonstderr:
  61. ***TASKCOMPLETE***
  62. [root@localhostrepo_mirror]#
  63. 检查校验
  64. [root@localhostrepo_mirror]#cd/var/www/cobbler/repo_mirror/zabbix/
  65. [root@localhostzabbix]#ll
  66. total10644
  67. drwxr-xr-x2rootapache4096Jun414:35cache
  68. -rwxr-xr-x1rootapache111Jun414:32config.repo
  69. drwxr-xr-x2rootapache4096Jun414:35repodata
  70. -rwxr-xr-x1rootapache343120Apr2503:56zabbix-agent-3.0.9-1.el7.x86_64.rpm
  71. -rwxr-xr-x1rootapache235320Apr2503:57zabbix-get-3.0.9-1.el7.x86_64.rpm
  72. -rwxr-xr-x1rootapache730860Apr2503:57zabbix-java-gateway-3.0.9-1.el7.x86_64.rpm
  73. -rwxr-xr-x1rootapache636756Apr2503:57zabbix-proxy-MysqL-3.0.9-1.el7.x86_64.rpm
  74. -rwxr-xr-x1rootapache636252Apr2503:57zabbix-proxy-pgsql-3.0.9-1.el7.x86_64.rpm
  75. -rwxr-xr-x1rootapache620776Apr2503:57zabbix-proxy-sqlite3-3.0.9-1.el7.x86_64.rpm
  76. -rwxr-xr-x1rootapache11416Feb152016zabbix-release-3.0-1.el7.noarch.rpm
  77. -rwxr-xr-x1rootapache246096Apr2503:57zabbix-sender-3.0.9-1.el7.x86_64.rpm
  78. -rwxr-xr-x1rootapache1819916Apr2503:57zabbix-server-MysqL-3.0.9-1.el7.x86_64.rpm
  79. -rwxr-xr-x1rootapache1818888Apr2503:57zabbix-server-pgsql-3.0.9-1.el7.x86_64.rpm
  80. -rwxr-xr-x1rootapache3679892Apr2503:57zabbix-web-3.0.9-1.el7.noarch.rpm
  81. -rwxr-xr-x1rootapache5224Apr2503:57zabbix-web-japanese-3.0.9-1.el7.noarch.rpm
  82. -rwxr-xr-x1rootapache4756Apr2503:57zabbix-web-MysqL-3.0.9-1.el7.noarch.rpm
  83. -rwxr-xr-x1rootapache4768Apr2503:57zabbix-web-pgsql-3.0.9-1.el7.noarch.rpm
  84. [root@localhostzabbix]#

apache 映射的地址

http://192.168.56.113/cobbler/repo_mirror/zabbix/

wKiom1kz5vKBo8sgAALxFVuBYCM860.png-wh_50



  1. [root@bogon~]#vim/etc/yum.repos.d/zabbix.repo
  2. [local-zabbix]#可以自己定义
  3. name=localzabbix
  4. baseurl=http://192.168.56.113/cobbler/repo_mirror/zabbix/
  5. enabled=1
  6. gpgcheck=0


下面我就没接着写 参考链接

  1. [root@aqdl~]#cobblerrepoadd--name=epel--mirror=https://mirrors.aliyun.com/epel/7/x86_64/--arch=x86_64--breed=yum
  2. [root@aqdl~]#cobblerrepoadd--name=saltstack--mirror=http://repo.saltstack.com/yum/redhat/latest/x86_64/latest/--arch=x86_64--breed=yum
  3. [root@aqdl~]#cobblerrepoadd--name=openstack-mitaka--mirror=https://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-mitaka/--arch=x86_64--breed=yum
  4. [root@aqdl~]#cobblerrepoadd--name=updates--mirror=https://mirrors.aliyun.com/centos/7/updates/x86_64/--arch=x86_64--breed=yum
  5. [root@aqdl~]#cobblerrepoadd--name=extras--mirror=https://mirrors.aliyun.com/centos/7/extras/x86_64/--arch=x86_64--breed=yum
  6. [root@aqdl~]#cobblerrepoadd--name=os--mirror=https://mirrors.aliyun.com/centos/7/os/x86_64/--arch=x86_64--breed=yum
  7. [root@aqdl~]#cobblerreposync#在夜深人静的时候同步效果显著!

同步完毕制作一个repo文件放在 /etc/yum.repos.d/

下面就可以了

猜你在找的Bash相关文章