Case study for setting up local repository

Review this case study to understand - how to prepare a local repository for Ambari 7.1.x.x and HDP 7.1.x.x on Centos7:

yum install yum-utils createrepo -y
yum install httpd -y
//firewall configuration
sudo systemctl start httpd
sudo systemctl status httpd
mkdir -p /var/www/html/
wget -nv https://archive.cloudera.com/p/ambaridc/7.x/7.1.7.2000/centos7/ambaridc.repo -O /etc/yum.repos.d/ambari.repo
wget -nv archive.cloudera.com/p/HDPDC/7.x/7.1.7.2000/centos7/hdp.repo -O /etc/yum.repos.d/hdp.repo
yum repolist
cd /var/www/html
mkdir -p ambari/centos7
cd ambari/centos7/
reposync -r ambari-7.1.x.x
cd ../..
mkdir -p hdp/centos7
cd hdp/centos7/
reposync -r HDP-7.1.x.x
reposync -r HDP-UTILS-1.1.0.22
createrepo /var/www/html/ambari/centos7/ambari-7.1.x.x
createrepo /var/www/html/hdp/centos7/HDP-7.1.x.x
createrepo /var/www/html/hdp/centos7/HDP-UTILS-1.1.0.22/
Result:
The repositories will be available at the local web server:
http://<web.server>/ambari/centos7/ambari-7.1.x.x/
http://<web.server>/hdp/centos7/HDP-7.1.x.x/
http://<web.server>/hdp/centos7/HDP-UTILS-1.1.0.22/