Updating HDP repo files

When the cluster settings for the HDP repository URL is updated, repository files on hosts are not immediately regenerated. The files are re-generated when you add a new component or service. But an inaccessible repository URL causes the Package Manager to display an error about the unavailable repository URL when you update the package lists. Cloudera recommends you to manually update the URLs in the HDP repository files (for example, /etc/yum.repos.d/ambari-hdp-1.repo) on all agent hosts.

Case study for setting up a 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:

  1. yum install yum-utils createrepo -y
  2. yum install httpd -y
  3. //firewall configuration
  4. sudo systemctl start httpd
  5. sudo systemctl status httpd
  6. mkdir -p /var/www/html/
  7. wget -nv https://archive.cloudera.com/p/ambaridc/centos7/7.x/updates/7.1.x.x/ambaridc.repo -O /etc/yum.repos.d/ambari.repo
  8. wget -nv https://archive.cloudera.com/p/HDPDC/centos7/7.x/updates/7.1.x.x/hdpdc.repo -O /etc/yum.repos.d/hdp.repo
  9. yum repolist
  10. cd /var/www/html
  11. mkdir -p ambari/centos7
  12. cd ambari/centos7/
  13. reposync -r ambari-7.1.x.x
  14. cd ../..
  15. mkdir -p hdp/centos7
  16. cd hdp/centos7/
  17. reposync -r HDP-7.1.x.x
  18. reposync -r HDP-UTILS-1.1.0.22
  19. createrepo /var/www/html/ambari/centos7/ambari-7.1.x.x
  20. createrepo /var/www/html/hdp/centos7/HDP-7.1.x.x
  21. createrepo /var/www/html/hdp/centos7/HDP-UTILS-1.1.0.22/

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/