Together with other students, openstack is installed on several servers to virtualize more machines and test various distributed/parallel data analysis platforms.
Currently, the openstack platform has just been built and various systems to be tested are being installed. A more practical problem is that due to the relationship between data center routes, the server and the virtual machine cannot directly access the Internet, and the download speed through the proxy is slow, so you need to build a software source in the LAN. We chose CentOS as the operating system for our tests, so of course we set up the yum software source (A Debian software source has been built before)
The procedure is as follows:
1. Install the system
Find a machine that will be used as the software source server (that is, the server that provides package reppsitory). The operating system above should be centos, and the static IP address should be set (10.77.30.60 in this article ), open the corresponding port (80 or 21) on the firewall )...... It's not long ......
2. install an http or ftp Server
We recommend that you use apache http server to build an http server. The installation process of apache is skipped.
Install the package to download the package. The installed apache working directory is/var/www/html by default. This directory is used below.
3. Prepare the rpm package
Download the latest bin-DVD system image:
Http://mirror.bit.edu.cn/centos/ (now with beili's mirror site)
Download DVD1 and DVD2.iso, extract all the content in DVD1.iso, and put it in the/var/www/html/centos-6 directory, then copy the rpm package under the Packages directory decompressed by DVD2.iso to the/var/html/centos-6/Packages directory, so/var/html/centos-6/Packages has more than 6000 rpm Packages. Check the http: // 10.77.30.60/centos-6 from the browser, as shown in:
The repodata directory of the preceding topology does not exist at this time. It will only be available after the createrepo command is used to generate the repository.
4. Create a repository
Install createrepo, which can be installed with yum or rpm.
After installation, create repository:
$ Createrepo/var/www/html/centos-6/
Wait for several minutes until the creation is complete. After creation is complete, some files are generated under/var/www/html/centos-6/repodata.
5. Use software sources
Try the software source on other centos machines.
First, modify the software source configuration file on the machine:
# Cd/etc/yum. repos. d/
# Mkdir bk
# Mv *. repo bk/
# Cp bk/CentOS-Base.repo ./
# Vi CentOS-Base.repo
The CentOS-Base.repo file is modified as follows:
[Base]
Name = CentOS-$ releasever-Base
Baseurl = http: // 10.77.30.60/centos-6/
Gpgcheck = 1
Gpgkey = http: // 10.77.30.60/centos-6/RPM-GPG-KEY-CentOS-6
Enabled = 1
# Released updates
# [Updates]
# Name = CentOS-$ releasever-Updates
# Baseurl = http: // 10.77.30.60/centos-6/
# Gpgcheck = 1
# Gpgkey = http: // 10.77.30.60/centos-6/RPM-GPG-KEY-CentOS-6
# Enabled = 1
After saving, you can use the LAN software source:
# Yum update
Build an intranet yum Server
Build a local network CentOS Yum Server