Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Openstack offline YUM source construction

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Server IP address: 192.168.0.213

Installation and deployment instructions for the Openstack yum source

For the enterprise openstack private cloud, for security and some factors, some servers cannot access the public network, resulting in servers unable to update some RPM packages. At the same time, there are often internal development requirements for new features of openstack, version maintenance and upgrade, so it is very necessary to build an enterprise private openstack yum source. There are two steps to build an openstack yum source: 1. Synchronize (download) the official source to the enterprise yum server; 2. Recreate the repo and publish it through (apache).

We use these two methods here, according to the openstack official website installation manual as an example.

To build a local sourc

1.yum source file download

(1) download the necessary tools:

[root@oracle-2] # yum-y install wget

[root@oracle-2] # yum-y install createrepo

(2) download the yum source locally:

[root@oracle-2] # mkdir-p / wget-yum

[root@oracle-2 ~] # cd / wget-yum/

Download the centos feed:

[root@oracle-2 wget-yum] # wget- S-c-r-np-L http://mirrors.sohu.com/centos/7/

Download the foreman feed:

[root@oracle-2 wget-yum] # wget- S-c-r-np-L http://yum.theforeman.org/plugins/1.5/el6/

Download the epel feed:

[root@oracle-2 wget-yum] # wget- S-c-r-np-L http://mirrors.yun-idc.com/epel/7/

Download the puppetlabs feed:

[root@oracle-2 wget-yum] # wget- S-c-r-np-L https://yum.puppetlabs.com/el/7

Download the openstack feed:

[root@oracle-2 wget-yum] # https://repos.fedorapeople.org/repos/openstack/openstack-ocata/

(3) delete unwanted software packages and files:

[root@oracle-2 wget-yum] # find. /-name index.html* | xargs rm-rf

[root@oracle-2 wget-yum] # find. /-name i386 | xargs rm-rf

(4) adjust the directory structure:

[root@oracle-2 wget-yum] # mkdir foreman

[root@oracle-2 wget-yum] # mv yum.theforeman.org/plugins/ foreman/

[root@oracle-2 wget-yum] # mv yum.theforeman.org/releases/ foreman/

[root@oracle-2 wget-yum] # rm-rf yum.theforeman.org/

[root@oracle-2 wget-yum] # mv mirrors.yun-idc.com/epel/. /

[root@oracle-2 wget-yum] # rm-rf mirrors.yun-idc.com/

[root@oracle-2 wget-yum] # mkdir puppetlabs

[root@oracle-2 wget-yum] # mv yum.puppetlabs.com/el/ puppetlabs/

[root@oracle-2 wget-yum] # rm-rf yum.puppetlabs.com/

[root@oracle-2 wget-yum] # mv repos.fedorapeople.org/repos/openstack/. /

[root@oracle-2 wget-yum] # rm-rf repos.fedorapeople.org/

2.http installation and configuration:

[root@oracle-2] # yum-y install httpd

[root@oracle-2] # / etc/init.d/httpd start

[root@oracle-2] # cd / var/www/html/

[root@oracle-2 html] # ln-s / wget-yum/ / var/www/html/

[root@oracle-2 html] # createrepo / var/www/html/

test

Use a browser to access http://192.168.0.213/wget-yum/ because the intranet server I use here is 192.168.0.213

3. Write repo files

[root@oracle-2 html] # cd / etc/yum.repos.d/

[root@oracle-2 yum.repos.d] # vi centos.repo

[openstack]

Name=CentOS-openstack

Baseurl= file:///wget-yum/

Gpgcheck=0

Enabled=1

Gpgkey= file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

[root@oracle-2 yum.repos.d] # yum clean all clears the yum cache

[root@oracle-2 yum.repos.d] # yum repolist re-gets the list of Yum sources

Loaded plugins: fastestmirror, refresh-packagekit

Determining fastest mirrors

Openstack | 3.0 kB 00:00...

Openstack/primary_db | 54 MB 00:06...

Repo id repo name status

Openstack CentOS-openstack 86519

Repolist: 86519

Client configure yum source

1. Configure the repo file

[root@controller ~] # cd / etc/yum.repos.d/

[root@controller yum.repos.d] # vi centos.repo

[openstack]

Name=CentOS-openstack

Baseurl= http://192.168.0.213/wget-yum/

Gpgcheck=0

Enabled=1

Gpgkey= file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

~

[root@controller yum.repos.d] # yum clean all clears the yum cache

[root@controller yum.repos.d] # yum repolist reacquires data from yum sources

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report