In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Foreword:
YUM is mainly used to automatically install and upgrade rpm software packages. It can automatically find and solve the dependencies between rpm packages. To successfully install updated software or systems using YUM tools, you need to have a repository (software repository) containing various rpm packages, which we used to call the yum source. There are a large number of yum sources on the network, but due to the limitations of the network environment, the installation of the software takes too long or even fails. The slow progress bar is unbearable, especially when there are a lot of servers and a lot of software packages to install. Therefore, when we optimize the system, we will change the domestic source.
Comparatively speaking, the biggest advantage of local YUM source server is the fast network connection and stability of local area network. With the YUM source server in the local area network, even if the Internet connection is interrupted, it will not affect the software installation and upgrade of other YUM clients.
1. Create the yum repository directory mkdir-p / application/yum/centos6.6/x86_64/cd / application/yum/centos6.6/x86_64/rz # to upload the rpm package to this directory, and this directory can also include folder 2. Install createrepo softwar
Yum-y install createrepo
3. Initialize the repodata index file createrepo-pdo / application/yum/centos6.6/x86_64/ / application/yum/centos6.6/x86_64/4. Provide yum services # you can use Apache or nginx to provide web services, but the http module of Python is simpler and is suitable for private network environment cd / application/yum/centos6.6/x86_64/python-m SimpleHTTPServer 80 & > / dev/null & you can enter native IP through the browser to view it. 5. Add a new rpm package # download only the software without installing yumdownloader pcre-devel openssl-develcreaterepo-update / application/yum/centos6.6/x86_64/ # update each time you add a rpm package.
Usually the installation package is not deleted when yum installs the software.
# cat / etc/yum.conf keepcache=1# installation package storage directory cachedir=/var/cache/yum/$basearch/$releasever# / var/cache/yum/x86_64/6/base/packages6. Client configuration # cd / etc/yum.repos.d [root@B yum.repos.d] # vi oldboy.repo.repo.oldboy] name=Serverbaseurl=enable=1gpgcheck= 0 [root @ YUM ~] # yum-- enablerepo=oldboy-- disablerepo=base,extras,updates,epel list # specifies the use of oldboy libraries
The above is the temporary use of private network yum source. If you want to use the yum-y install lrzsz command permanently and simply, you need to modify the configuration file to close the default repo file.
[root@oldboy ~] # cd / etc/yum.repos.d/ [root@oldboy yum.repos.d] # vim CentOS-Base.repo# is enabled when each startup source is changed from # enabled=0 # to 1, and is enabled without this parameter. # other open warehouses are closed using this method. 7. Mirror yum source
The above is just to put the self-made rpm package into the yum source. But there is also a kind of enterprise demand, to be more specific, students usually download yum installation software from the public network and occupy bandwidth, so build an intranet yum server in the school, but also consider that students have to use yum installation software when they go home. If the database file repodata of yum software is different, there will be problems. So the solution I can think of is to directly use the repodata of the public network yum source.
Image synchronization public network yum source upstream yum source must support rsync protocol, otherwise rsync cannot be used for synchronization. Http://mirrors.ustc.edu.cn/status/CentOS official standard source: rsync://mirrors.ustc.edu.cn/centos/ epel source: rsync://mirrors.ustc.edu.cn/epel/ synchronization command: # use rsync to synchronize yum sources. In order to save bandwidth, disk and download time, I only synchronized CentOS6's rpm packets, so that all rpm packages only take up 21G, and all synchronization needs about 300G. # synchronize base feeds, tips. The CD image of our installation system contains some rpm packages, about 3G, so you don't have to download them again. / usr/bin/rsync-av rsync://mirrors.ustc.edu.cn/centos/6/os/x86_64/ / data/yum_data/centos/6/os/x86_64//usr/bin/rsync-av rsync://mirrors.ustc.edu.cn/centos/6/extras/x86_64/ / data/yum_data/centos/6/extras/x86_64//usr/bin/rsync-av rsync://mirrors.ustc.edu.cn/centos/6/ Updates/x86_64/ / data/yum_data/centos/6/updates/x86_64/# epel source / usr/bin/rsync-av-- exclude=debug rsync://mirrors.ustc.edu.cn/epel/6/x86_64/ / data/yum_data/epel/6/x86_64/ students can build an intranet dns by using the intranet yum source method # If not, you can use hosts parsing. Echo '192.168.0.200 mirrors.aliyun.com' > > / etc/hosts results display [root@KVM data] # du-sh yum_data 21G yum_ data [root @ KVM data] # tree-L 3 yum_data/yum_data/ ├── centos │ ├── 6 │ │ ├── extras │ │ ├── os │ │ └── updates │ └── RPM-GPG-KEY-CentOS-6 ├ ── epel │ └── 6 │ └── x86_64
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.