In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you about the process of building yum warehouse servers based on file and http. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.
YUM: Yellowdog Update Modifier, a front-end program for rpm, solves package-related dependencies, locates software packages among multiple libraries, and is an alternative tool for up2date
Yum repository: yum repo, which stores a large number of rpm packages and related metadata files (placed in a specific directory repodata)
The file servers are:
Http://
Https://
Ftp://
File://
First, based on the local CD of file:// to create yum warehouse process 1, specify the yum warehouse server.
First of all, it is necessary to understand the location of the Yum metafile in the local CD, and the path is: / misc/cd/,. The CD will be used as the yum warehouse server. The file:// file server is used here.
The rpm package is placed in Package, and the Yum metafile is placed in the repodata folder. When configuring the warehouse path, use the directory where the repodata directory is located, that is, / misc/cd/
2. Create a yum client configuration file.
The yum main configuration file, which records the configuration information for yum, as shown below
Use the yum repolist command to query the currently configured yum repository.
Here, I create a configuration file named test.repo and do some basic configuration.
After completing the configuration file, a simple yum repository is created, and then you can yum install the command to install a program for testing to see if it can be successfully installed.
Note: if the centos environment is Centos5, the location of the repodata directory on the CD is / misc/cd/Server/
Second, the construction of network yum warehouse service based on http
The yum warehouse based on file:// file server can only realize local operation. If users want to access the data y of remote hosts across the network and carry out related operations, it is necessary to build network-based services. Here I choose to build a http service.
1. Install httpd and start the httpd service
Before building the yum repository for the http service, you need to install the corresponding package for the http service, which is named httpd. After the installation is complete, use rpm-ql httpd to view the file list of the package, find the file httpd.service with the .service suffix, and start it with the command systemctl start service
At this point, a yum repository of a basic http service is built, and the native IP can now be accessed through a browser, and you can see that the http service is connected.
Note: if you find that the connection is not available on the browser, the firewall may not be turned off, and the cache can be cleared through iptables-F in Centos7; in Centos6, you can use the service iptables stop command to close it.
2. Create the corresponding http repository directory
The last step completed the construction of the basic service, but at this time the warehouse is empty and there is no data inside it. The directory where the http service is stored in the warehouse is / var/www/html/,. Now you need to create a new directory. Referring to the structure of Ali Cloud, I created the directory structure as centos/7/os/x86_64/,. At this time, you can view the directory structure by accessing the host address + / centos/7/os/x86_64/ through the browser.
Next, you can copy the Packages and repodata folders under the / misc/cd/ directory to the http service directory / var/www/html, but it may be slow to do so. Therefore, we can also choose to mount the CD directly to the directory / var/www/html/ of the http service. Mounting method:
After the mount is completed, the corresponding data in the CD will be mounted to the http service, and then you can visit the host address + / centos/7/os/x86_64/ to view the contents of the CD through the browser. As shown in the figure:
3. Create a yum client configuration file
In the previous step, we have completed the construction of the yum warehouse based on http network. Next you need to create a yum client configuration file.
At this point, the configuration files related to the yum client are completed, and the entire http-based network yum service is built, and then you can use the yum repository to download the installer.
Third, build a yum repository accessible to Centos6 in Centos7
The yum warehouse established in the above way can only be accessed by Centos7 users, and if Centos6 users want to use it, they need to create Centos6's yum repository. The method is similar to the method of building network yum services based on http.
This is how the yum warehouse is built based on file and http servers shared by the editor. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.