Make Openstack-juno local Yum source on CentOS7.0. doc

Source: Internet
Author: User
Tags yum repolist

Make Openstack-juno local Yum source on CentOS7.0

Reference: 2014/09/27 | http://www.kekeyun.net/?p=222 Cocoa Cloud Computing Network

Take http://www.kekeyun.net/?p=222 as a reference, make a local source on CentOS7.0, the process is as follows:
First, create a CentOS7 virtual host
Installation process is a bit long, in order to follow up the need for learning, it is recommended to download the full version to install. Everything version Http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-Everything-1503-01.iso
To conserve resources, use the minimum installation mode.

Second, check the network, to ensure that can ping through rdo.fedorapeople.org
Systemctl Start Network.service
IP addr
Ping rdo.fedorapeople.org

Third, mount the CD-ROM, attach the disc before you remember to insert the CD
1.mkdir/media/cdrom
2.mount/dev/cdrom/media/cdrom


Four, the attached CD as a Yum source
1.mv/etc/yum.repos.d/*.*/mnt# to move the original source to a free folder
2.vi/etc/yum.repos.d/centos-media.repo
Input content:
[Centos-repo]
Name=centos-repo
Baseurl=file:///media/cdrom #注意//
Enabled=1
Gpgcheck=0

V. Installation source management tools and HTTP Services

1.yum Install yum-utils Createrepo yum-plugin-priorities
2.yum Install Crontabs
3.yum Install httpd
4.systemctl Start Httpd.service
5.systemctl Enable Httpd.service
6.systemctl Status Httpd.service

Six. Get the repo file and use the Reposync synchronization source

1.yum install-y http://rdo.fedorapeople.org/rdo-release.rpm
2.yum Repolist #可以看到源的id列表, remember that the source ID of OpenStack is Openstack-juno
3.yum Clean All
4.yum Makecache
5.cd/var/www/html/
6.reposync--repoid=openstack-juno
#openstack-juno is 2 see the OpenStack Source ID, the synchronization time is longer, I spent 2 hours
#这命令可能要反复执行几次 until the message is not prompted after execution.
7.createrepo--update/var/www/html/openstack-juno
8.ll/var/www/html/openstack-juno/repodata/#



Seven, open the firewall
1.firewall-cmd--add-service=http
2.firewall-cmd--permanent--add-service=http

Test source is available, test with a browser on the host that needs to use the source
Http://[ip]/openstack-juno, if you see a similar effect, it means the test was successful.

IX. application, create a repo file on the host on which you want to install OpenStack
Vi/etc/yum.repos.d/centos-media.repo
Input content:
[Openstack-repo]
Name=juno
baseurl=http://[ip]/openstack-juno/
Enabled=1
Gpgcheck=0

X. Automatic Update scripts
Simple version, update Openstack-juno only.
#!bin/bash
Base_path=/home/repo
Repo_name=openstack-juno
CD $BASE _path
Reposync--repoid= $REPO _name
Createrepo–-update $REPO _name
Done
Advanced version, update multiple local sources (Premium version No test, need to pay attention to modify parameters)







#!/bin/bash
Base_path=/home/repo

CD $BASE _path

repo_list= (Base extras updates foreman foreman-plugins Openstack-juno puppetlabs-deps puppetlabs-products Epel)

For Repo_name in ${repo_list[@]};d o

echo-------$REPO _name--------
Logfile_path= $BASE _path/reposync_log/$REPO _name
Mkdir-p $LOGFILE _path

Reposync--repoid= $REPO _name 2>&1 | Tee $LOGFILE _path/reposync_$ (date+ "%y%m%d%h"). Log

if [$REPO _name = Base] | | [$REPO _name = Extras] | | [$REPO _name = Updates];then createrepo--update $REPO _name/packages2>&1 | tee$logfile_path/createrepo_$ (date+ "%y%m%d%h"). Log

Else

Createrepo--update $REPO _name 2>&1 | Tee $LOGFILE _path/createrepo_$ (date+ "%y%m%d%h"). Log

Fi

Done
Xi. Daily Middle Automatic operation
Save the above update script as a file update-repo.sh
Crontab–e
* 3 * * */var/www/html/update-repo.sh



This article is from the "Stroll" blog, please be sure to keep this source http://walkthrough.blog.51cto.com/1683605/1641143

Make Openstack-juno local Yum source on CentOS7.0. doc

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.