Get the App
SLTechnology News&Howtos  ›  Servers  › 

Openstack offline YUM source construction

Shulou Source: shulou.com Published: 2022-06-02 03:27:20 10月01日 Update

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

Tags: Server service enterprise file configuration necessary step cache private security two at the same time factor address official customer client tool manual data Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL MariaDB Shulou Tech Info vpn NVidia