How to create local repository with HDP.repo in
Centos / Redhat
Step1: Download the relevant HDP.repo from
Hortonworks site. (Refer to docs.hortonworks.com)
$ wget -nv
http://private-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.1.12-7/hdp.repo
-O /etc/yum.repos.d/hdp.repo
Step2:- Import the GPG keys to your
machine where you going to host local repository
GPG keys will be inside the hdp.repo and this is
to make sure the download is from trusted source. So than you can download the
actual software from the HDP.repo URL.
[root@localrepo ~]# cat
/etc/yum.repos.d/hdp.repo
#VERSION_NUMBER=2.6.1.12-7
[HDP-2.6.1.12-7]
name=HDP Version - HDP-2.6.1.12-7
baseurl=http://private-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.1.12-7
gpgcheck=1
gpgkey=http://private-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.1.12-7/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[HDP-UTILS-1.1.0.21]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.21
baseurl=http://private-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos6
gpgcheck=1
gpgkey=http://private-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.1.12/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
Importing:-
$ rpm --import
http://private-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.1.12-7/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
Step3:- Install the yum-utils, reposync
& createrepo utilities in your machine
yum -y install yum-utils createrepo
Step 4:- Create local repository directory & Get repo id
mkdir -p /var/www/html/
[root@localrepo html]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id
repo name
status
HDP-2.6.1.12-7
HDP Version - HDP-2.6.1.12-7
232
HDP-UTILS-1.1.0.21
HDP-UTILS Version - HDP-UTILS-1.1.0.21
51
base
CentOS-6
- Base
6,706
epel
Extra
Packages for Enterprise Linux 6 - x86_64
12,381
extras
CentOS-6 - Extras
45
updates
CentOS-6 - Updates
472
repolist: 19,887
Step 5:- Download the software using reposync
Got the repo id from the above step and using
with -r option
reposync
-gdlt --source hdp.repo -p /var/www/html
-r HDP-2.6.1.12-7
reposync
-gdlt --source hdp.repo -p /var/www/html -r
HDP-UTILS-1.1.0.21
step6:-
Do this for HDP repo and HDP-utils repo
cd /var/www/html/HDP*
createrepo .
Do this for HDP repo and HDP-utils repo
cd /var/www/html/HDP*
createrepo .
No comments:
Post a Comment