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/03 Report--
This article mainly introduces how to create and configure your own YUM warehouse, focusing on the specific steps of release and configuration, the steps are simple and easy to operate, and the content of the article is compact step by step. I hope you can get something according to this article.
1. Self-built YUM warehouse
When the network is not good, or there is no link to the official yum warehouse, as well as the third-party yum repository (zabbix source), we need to build a yum warehouse to meet our needs. In addition to network conditions, our production environment needs to release and update our own software, which we can package into RPM packages, put in our own warehouse, and then perform yum updates on various machines.
1.1 build a YUM repository using some RPM packages
The following RPM package is prepared in the directory / data/yum/repo/custom. Prepare RPM packages according to your own needs
$pwd/data/yum/repo/custom$ tree.. ├── dos2unix-3.1-37.el6.x86_64.rpm └── iftop-1.0-0.21.pre4.el7.src.rpm0 directories, 2 files
Create repodata
$yum install-y createrepo$ createrepo / data/yum/repo/custom/Spawning worker 0 with 2 pkgsWorkers FinishedSaving Primary metadataSaving file lists metadataSaving other metadataGenerating sqlite DBsSqlite DBs complete$ ls / data/yum/repo/custom/dos2unix-3.1-37.el6.x86_64.rpm iftop-1.0-0.21.pre4.el7.src.rpm repodata
After the createrepo is completed, you can see that there is an extra repodata directory in the / data/yum/repo/custom directory.
At this point, the yum warehouse has been built, and the remaining operation is to publish the warehouse so that other users can access it. The publishing methods are http, ftp, rsync, and filesystem. When the release is complete, the user has configured the yum source to access it.
Release our YUM Warehouse 2.1 release using HTTP
Build Nginx on the machine where the yum warehouse is located
$yum install-y nginx
Replace the / etc/nginx/nginx.conf content with the following
Worker_processes 1 leads events {worker_connections 1024;} http {include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server {listen 80; server_name localhost; root / data/yum/repo/custom; autoindex on; autoindex_exact_size off; autoindex_localtime on;}}
Restart nginx
$systemctl restart nginx
At this point, visiting http://your_host, in the browser should be able to see the two packages of our yum repository.
At this point, the yum repository has been released, and you need to configure the yum source to point to the self-built repository.
3. Configure yum source
This step belongs to the user, and should be done when the user needs to use our yum source.
Assuming that the address of our yum repository is http://192.168.30.10, and the name is loveshell, then we need to create the file lovezsh.repo in the / etc/yum.repos.d/ directory, which is as follows:
[lovezsh] name=lovezshbaseurl= http://192.168.30.10enable=1gpgcheck=0priority=1
Then, we need to execute
$yum clean all$ yum makecache
After adding, we execute yum repolist and can drive to a yum source called lovezsh.
$yum repolistLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * epel: mirrors.aliyun.com * extras: mirrors.cn99.com * updates: mirror.bit.edu.cnlovezsh | 2.9 kB 00:00:00 lovezsh/primary_db | | 2.3 kB 00:00:00 repo id repo name | Statusbase/7/x86_64 CentOS-7-Base 10097epel/x86_64 Extra Packages for Enterprise Linux 7-x861464 13517extras/7/x86_64 CentOS-7-Extras 323lovezsh lovezsh 2updates/7/x86_64 CentOS-7-Updates 1115repolist: 25054
This is the end of the steps for creating a configuration YUM repository. I hope the above can help you and learn more. If you think the article is good, you can share it for more people to see.
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.