loading table of contents...

Chapter 9. Setting up Ambari to use an Internet Proxy Server

If you plan to use the public repositories (i.e. available on the Internet) for installing the cluster software, you need to make sure Ambari and the hosts in the cluster have Internet access to obtain the software from those repositories. Specifically:

  • Ambari Server: uses Internet access to validate the repositories.

  • yum (or equivalent package manager depending on your operating system): performs the software installation from the repositories.

Therefore, if your environment requires use of an Internet proxy server for access, you must configure Ambari Server component and “yum” on all the hosts to use the proxy server.

[Note]Note

Ambari can install software if you have no Internet access. If you have no Internet access (via a proxy server or otherwise), you can use local repositories for installing the cluster software. In that case, configuring Ambari to use a proxy server is not required. However, Ambari and the hosts in the cluster must have access to your local repositories. See Using a Local Repository for more information on setting up and using local repositories.

Configure Internet Proxy Settings for Ambari Server

  1. On the Ambari Server host, stop Ambari Server:

    ambari-server stop

  2. Add proxy settings to the following script: /var/lib/ambari-server/ambari-env.sh.

    -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:

    -Dhttp.nonProxyHosts=<pipe|separated|list|of|hosts>

  4. If your proxy server requires authentication, add the username and password, as follows:

    -Dhttp.proxyUser=<username> -Dhttp.proxyPassword=<password>

  5. Restart the Ambari Server to pick up this change.

Configure yum for 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:

    proxy=http://<yourProxyHost>:<yourProxyPort>

  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. Please consult your System Administrators and refer to your Operating System documentation for more details on this configuration and possible alternatives.

Operating System Reference
CentOS / Red Hat

https://www.centos.org/docs/5/html/yum/sn-yum-proxy-server.html

Oracle Linux

https://docs.oracle.com/cd/E37670_01/E37355/html/ol_proxy_config.html

Ubuntu / Debian

https://help.ubuntu.com/community/AptGet/Howto