If you plan to use public repositories (i.e. available on the Internet) for installing Apache Ambari and deploying a Hadoop stack in your cluster, you must provide Ambari and the hosts in the cluster Internet access to obtain the software from those repositories. Specifically:
1. On the Ambari Server host, stop Ambari Server:
2. Add proxy settings to the following script: /var/lib/ambari-server/ambari-env.sh
This: -Dhttp.proxyHost=<yourProxyHost> -Dhttp.proxyPort=<yourProxyPort>
3. Optionally, to prevent some host names from accessing the proxy server, define the list of excluded hosts, as follows:
4. If your proxy server requires authentication, add the username and password, as follows:
This: -Dhttp.proxyUser=<username> -Dhttp.proxyPassword=<password>
5. Restart the Ambari Server to pick up this change.
To configure yum to use internet proxy settings for all hosts:
Setting up yum to use a proxy server depends a lot on your environment and operating system. The instructions below provide some guidance but we strongly recommend you consult with your system administrators and operating system documentation for assistance & specific instructions.
1. On each host in the cluster, specify the proxy settings in /etc/yum.conf by adding the following entry:
2. If your proxy server requires authentication, add the username and password, as follows:
enableProxyAuth=1 proxy_username=<username> proxy_password=<password>
3. Save the yum configuration file.
It is important to highlight that defining a proxy server, username and password in /etc/yum.conf means all users of yum connect to the proxy server with those details.
CentOS / Red Hat https://www.centos.org/docs/5/html/yum/sn-yum-proxy-server.html