- Temporarily reconfigure your firewall to allow Internet access from your mirror server host. 
- Execute the following command to download the appropriate Hortonworks yum client configuration file and save it in - /etc/yum.repos.d/directory on the mirror server host.- Table 4.4. Deploying HDP - Option II - Cluster OS - HDP Repository Tarballs - RHEL/ CentOS 5.x - HDP Repository: - wget https://hdpweb.o.onslip.net/HDP-1.2.0/repos/centos5/hdp.repo -O /etc/yum.repos.d/hdp.repo 
- HDP-Utils Repository (Optional): - wget https://hdpweb.o.onslip.net/HDP-UTILS-1.1.0.15/repos/centos5/hdp-util.repo -O /etc/yum.repos.d/hdp-util.repo 
- Ambari Repository (Optional): - wget https://hdpweb.o.onslip.net/ambari/centos5/1.x/GA/ambari.repo -O /etc/yum.repos.d/ambari.repo 
 - RHEL/ CentOS 6.x - HDP Repository: - wget https://hdpweb.o.onslip.net/HDP-1.2.0/repos/centos6/hdp.repo -O /etc/yum.repos.d/hdp.repo 
- HDP-Utils Repository (Optional): - wget https://hdpweb.o.onslip.net/HDP-UTILS-1.1.0.15/repos/centos6/hdp-util.repo -O /etc/yum.repos.d/hdp-util.repo 
- Ambari Repository (Optional): - wget https://hdpweb.o.onslip.net/ambari/centos6/1.x/GA/ambari.repo -O /etc/yum.repos.d/ambari.repo 
 - SLES 11 - HDP Repository: - wget https://hdpweb.o.onslip.net/HDP-1.2.0/repos/suse11/hdp.repo -O /etc/zypp/repos.d/hdp.repo 
- HDP-Utils Repository (Optional): - wget https://hdpweb.o.onslip.net/HDP-UTILS-1.1.0.15/repos/suse11/hdp-util.repo -O /etc/zypp/repos.d/hdp-util.repo 
- Ambari Repository (Optional): - wget https://hdpweb.o.onslip.net/ambari/suse11/1.x/GA/ambari.repo -O /etc/zypp/repos.d/ambari.repo 
 ![[Note]](../common/images/admon/note.png) - Note - If you are using Ambari to perform the HDP installation, you will need to setup the Ambari repository using the information provided above. 
- Create an HTTP server. - On the mirror server, install an HTTP server (such as Apache - httpd) using the instructions provided here.
- Activate this web server. 
- Ensure that the firewall settings (if any) allow inbound HTTP access from your cluster nodes to your mirror server. ![[Note]](../common/images/admon/note.png) - Note - If you are using EC2, make sure that SELinux is disabled. 
- [Optional]: If your mirror server uses SLES, modify the - default-server.conffile to enable the docs root folder listing.- sed -e "s/Options None/Options Indexes MultiViews/ig" /etc/apache2/default-server.conf > /tmp/tempfile.tmp mv /tmp/tempfile.tmp /etc/apache2/default-server.conf 
 
- On your mirror server, create a directory for your web server. - For example, from a shell window, type: - For RHEL/CentOS: - mkdir –p- /var/www/html/hdp/
- For SLES: - mkdir –p- /srv/www/htdocs/rpms
 
- If you are using a symlink, enable the - followsymlinkson your web server.
 
- Copy the contents of entire HDP repository from the remote yum server to your local mirror server. - Continuing the previous example, from a shell window, type: - For RHEL/CentOS: - HDP Repository: - cd /var/www/html/hdp reposync -r HDP-1.2.0 
- HDP-Utils Repository (Optional): - cd /var/www/html/hdp reposync -r HDP-UTILS-1.1.0.15 
- Ambari Repository (Optional): - cd /var/www/html/hdp reposync –r ambari-1.x reposync –r Updates-ambari-1.x 
 
- For SLES: - HDP Repository: - cd /srv/www/htdocs/rpms reposync -r HDP-1.2.0 - HDP-Utils Repository (Optional): - cd /srv/www/htdocs/rpms reposync -r HDP-UTILS-1.1.0.15 
- Ambari Repository (Optional): - cd /srv/www/htdocs/rpms reposync –r ambari-1.x reposync –r Updates-ambari-1.x 
 
 
- Generate appropriate metadata. - This step defines each directory as a yum repository. - From a shell window, type: - For RHEL/CentOS: - HDP Repository: - createrepo /var/www/html/hdp/HDP-1.2.0 
- HDP-Utils Repository (Optional): - createrepo /var/www/html/hdp/HDP-UTILS-1.1.0.15 
- Ambari Repository (Optional): - createrepo /var/www/html/hdp/ambari-1.x createrepo /var/www/html/hdp/Updates-ambari-1.x 
 
- For SLES: - HDP Repository: - createrepo /srv/www/htdocs/rpms/hdp/HDP-1.2.0 - HDP-Utils Repository (Optional): - createrepo /srv/www/htdocs/rpms/hdp/HDP-UTILS-1.1.0.15 
- Ambari Repository (Optional): - createrepo /srv/www/htdocs/rpms/hdp/ambari-1.x createrepo/srv/www/htdocs/rpms/hdp/Updates-ambari-1.x 
 - You should see a new folder called - repodatainside the HDP directories.- If using Ambari, you should also see the - repodatadirectory under the- ambari-1.xand- Updates-ambari-1.xdirectories.
 
- Verify the configuration. - The configuration is successful, if you can access the above directory through your web browser. - To test this out, browse to the following URLs: - HDP Repository: - http://yourwebserver/hdp/HDP-1.2.0/repos/$os 
- HDP-Utils Repository (Optional): - http://yourwebserver/hdp/HDP-UTILS-1.1.0.15/repos/$os 
- Ambari Repository (Optional): - http://yourwebserver/hdp/ambari/$os/1.x/GA 
 - where, - $oscan be centos5, centos6, or suse11.
- You should now see directory listing for all the HDP components. 
 
- At this point, it is okay to disable external Internet access for the mirror server, so that the mirror server is once again entirely within your data center firewall. 
- Configure the - yumor- zypperclients on all the nodes in your cluster.- Edit the repo file(s), changing the value of the baseurl property to the local mirror URL. - Edit the - /etc/yum.repos.d/hdp.repofile changing the baseurl property as shown below:- http://yourwebserver/hdp/HDP-1.2.0/repos/$os/hdp.repo 
- Edit the - /etc/yum.repos.d/hdp-utils.repofile changing the baseurl property as shown below:- http://yourwebserver/hdp/HDP-UTILS-1.1.0.15/repos/$os/hdp-utils.repo 
- Edit the - /etc/yum.repos.d/ambari.repofile changing the baseurl property as shown below:- [ambari-1.x] name=Ambari 1.x baseurl=http://yourwebserver/hdp/ambari/$os/1.x/GA/ambari.repo gpgcheck=1 gpgkey=//public-repo-1.hortonworks.com/ambari/centos5/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1 [HDP-UTILS-1.1.0.15] name=Hortonworks Data Platform Utils Version - HDP-UTILS-1.1.0.15 baseurl=http://yourwebserver/HDP-UTILS-1.1.0.15/repos/centos5 gpgcheck=0 gpgkey=//public-repo-1.hortonworks.com/ambari/centos5/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1 [Updates-ambari-1.x] name=ambari-1.x - Updates baseurl=http://yourwebserver/ambari/centos5/1.x/updates gpgcheck=1 gpgkey=//public-repo-1.hortonworks.com/ambari/centos5/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1 
 - where, - $oscan be centos5, centos6, or suse11.
- Copy the yum/zypper client configuration file to all nodes in your cluster. - For RHEL and CentOS: Use scp or pdsh to copy the client yum configuration file to - /etc/yum.repos.d/directory on every node in the cluster.
- For SLES: On every node, invoke the following command: - HDP Repository: - zypper addrepo -r http://yourwebserver/hdp/HDP-1.2.0/repos/suse11/hdp.repo 
- HDP-Utils Repository (Optional): - zypper addrepo -r http://yourwebserver/hdp/HDP-UTILS-1.1.0.15/repos/suse11/hdp-utils.repo 
- Ambari Repository (Optional): - zypper addrepo -r http://yourwebserver/hdp/ambari/suse11/1.x/GA/ambari.repo 
 
- If using Ambari, verify the configuration by deploying Ambari server on one of the cluster nodes. - yum install ambari-server 
 
 
- If your cluster runs CentOS or RHEL, and if you have multiple repositories configured in your environment, deploy the following plugin on all the nodes in your cluster. - Install the plugin. - For RHEL and CentOS v5.x - yum install yum-priorities 
- For RHEL and CentOS v6.x - yum install yum-plugin-priorities 
 
- Edit the - /etc/yum/pluginconf.d/priorities.conffile to add the following:- [main] enabled=1 gpgcheck=0 
 


