Applicable scenarios:
1. Application servers in large clusters can only be accessed by intranet
2. Want to maintain a stable local repository, to ensure uniform installation of member servers
3. Avoid poor access to foreign yum sources or domestic source networks
Server configuration:
Create an application local Yum source configuration file to ensure network access to the public network source, taking CDH as an example
[Email protected] ~]# Cat/etc/yum.repos.d/cdh.repo [cloudera-cdh5]# Packages for Cloudera ' s distribution for Hadoop, Ver Sion 5, on Redhator CentOS 6 X86_64name=cloudera's distribution for Hadoop, Version 5baseurl=http://archive.cloudera.com/ Cdh5/redhat/6/x86_64/cdh/5/gpgkey = Http://archive.cloudera.com/cdh5/redhat/6/x86_64/cdh/RPM-GPG-KEY-cloudera Gpgcheck = 1
2. Install a Web file server such as Apache/nginx or FTP on the RPM server, allowing other servers to access the source through the network
[Email protected] ~]#/etc/init.d/httpd startstarting httpd: [OK]
3. Installing the Createrepo,reposync tool
[[Email protected] ~] #yum Install yum-utils createrepo-y
4. Synchronize the RPM in the source to the local
[[email protected] html]# Pwd/var/www/html[[email protected] html~] #reposync-R cloudera-cdh5 #cloudera-cdh5 refers to Cdh.repo source name [[email protected] html]# MV Cloudera-cdh5 CDH
5. Specification directory and naming method,/local directory/project name/version number/rpms/schema platform
[[email protected] html]# tree .└── cdh └── 5 └── RPMS ├── noarch │ ├── avro-doc-1.7.6+cdh5.4.8+97-1.cdh5.4.8.p0.5.el6.noarch.rpm │ ├── avro-libs-1.7.6+cdh5.4.8+97-1. cdh5.4.8.p0.5.el6.noarch.rpm │ ├── avro-tools-1.7.6+cdh5.4.8+97-1.cdh5.4.8.p0.5.el6.noarch.rpm │ ├── bigtop-tomcat-0.7.0+cdh5.4.8+0-1. cdh5.4.8.p0.5.el6.noarch.rpm │ ├── bigtop-utils-0.7.0+cdh5.4.8+0-1.cdh5.4.8.p0.5.el6.noarch.rpm │ ├── crunch-0.11.0+cdh5.4.8+76-1.cdh5.4.8.p0.5.el6.noarch.rpm │ ├── crunch-doc-0.11.0+cdh5.4.8+ 76-1.cdh5.4.8.p0.5.el6.noarch.rpm │ ├── flume-ng-1.5.0+cdh5.4.8+137-1.cdh5.4.8.p0.5.el6.noarch.rpm │ ├── flume-ng-agent-1.5.0+cdh5.4.8+ 137-1.cdh5.4.8.p0.5.el6.noarch.rpm │ ├── flume-ng-doc-1.5.0+cdh5.4.8+137-1.cdh5.4.8.p0.5.el6.noarch.rpm │ ├── hbase-solr-1.5+cdh5.4.8+ 60-1.cdh5.4.8.p0.5.el6.noarch.rpm │ ├── hbase-solr-doc-1.5+cdh5.4.8+60-1.cdh5.4.8.p0.5.el6.noarch.rpm └── x86_64 ├── bigtop-jsvc-0.6.0+cdh5.4.8+684-1.cdh5.4.8.p0.5.el6.x86_64.rpm ├── bigtop-jsvc-debuginfo-0.6.0+cdh5.4.8+684-1.cdh5.4.8.p0.5.el6.x86_64.rpm ├── hadoop-0.20-conf-pseudo-2.6.0+cdh5.4.8+ 669-1.cdh5.4.8.p0.5.el6.x86_64.rpm ├── hadoop-0.20-mapreduce-2.6.0+cdh5.4.8+669-1.cdh5.4.8.p0.5.el6.x86_64.rpm &nbsP; ├── hadoop-0.20-mapreduce-jobtracker-2.6.0+cdh5.4.8+669-1. cdh5.4.8.p0.5.el6.x86_64.rpm ├── hadoop-0.20-mapreduce-jobtrackerha-2.6.0+cdh5.4.8+669-1.cdh5.4.8.p0.5.el6.x86_64. Rpm
6. Build Repository Information
[Email protected] html]# CD Cdh/5/[[email protected] 5]# Createrepo. Spawning worker 0 with 118 pkgsworkers finishedgathering worker resultssaving Primary metadatasaving file lists Metadatasa Ving Tsun Other metadatagenerating sqlite dbssqlite DBs complete[[email protected] 5]# lsrepodata RPMS
7. Client Off-screen testing
[[Email protected] ~]# cat /etc/yum.repos.d/cdh5.repo [cloudera-cdh5]name=cdh5baseurl =http://192.168.2.54/cdh/5/gpgcheck=0[[email protected] ~]# yum makecacheloaded plugins: fastestmirror, securityloading mirror speeds from cached hostfilecloudera-cdh5 | 2.9 kb 00:00 cloudera-cdh5/filelists_db | 390 kb 00:00 cloudera-cdh5/ primary_db | 66 kB 00:00 cloudera-cdh5/other_db | 7.7 kB 00:00 metadata cache created
This article is from the "technical Side dish" blog, please make sure to keep this source http://390892467.blog.51cto.com/2006821/1712588
Create an app Yum repository