If you are sitting behind a network proxy server when running Bright, then if you try to update or install software it will fail with timeouts or errors contacting the repository mirrors.
We’ll discuss how to deal with this for a RHEL based distribution and for a SLES distribution.
RHEL based distributions
Setting up YUM to work with proxies for RHEL:
1 The options (a) and (b) here are configuration file changes, so they will persist after reboots for the head node. For a regular node, if its configuration file is changed (by default the node images are stored under /cm/images/ on the head node), then the changes will also persist after a reboot of the node.
(a) if the proxy does not require authentication, then add the following lines to the /etc/yum.conf file:
# anonymous proxy configuration:
proxy=http://proxyaddress:port/
(replace proxyaddress:port with your proxy address and port).
(b) if the proxy requires authentication, then add the following lines to the /etc/yum.conf file instead:
# authenticating proxy configuration:
proxy=http://proxyaddress:port/
proxy_username=username
proxy_password=password
Change the username, and password to the values needed by the proxy.
2 Instead of 1(a) or 1(b), you can change the environment variable, by doing this:
(a) you can either directly export the http_proxy variable, before attempting to connect to the repository:
[root@bright61 ~]# export http_proxy=”http://proxyaddress:port/”
[root@bright61 ~]# yum update
(b) or you can export the http_proxy variable by adding the line to the appropriate bash login script (.bash_profile, .bash_login, or similar).
[root@bright61 ~]# cat .bash_profile
...
export http_proxy=”http://proxyaddress:port/”
...
This way, the http_proxy variable is automatically exported everytime you login.
If authentication is required, the format can be:
export http_proxy=”http://username:password@proxyaddress:port/”
3. Use the yum update command to verify that it is working.
(a) If the proxy wasn’t configured properly then an error message similar to the following will be displayed:
[root@bright61 ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.nl.webzilla.com
* extras: centos.mirror.triple-it.nl
* updates: mirror.nl.webzilla.com
http://mirror.nl.webzilla.com/CentOS/6.4/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 5 - "Couldn't resolve proxy 'adel60-centos6-sge-f'"
Trying other mirror.
(b) If the proxy was configured properly then the update will continue as expected:
[root@bright61 ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.prolocation.net
* extras: centos.mirror.triple-it.nl
* updates: centos.mirror1.spango.com
base | 3.7 kB 00:00
cm-rhel6-6.1 | 1.3 kB 00:00
cm-rhel6-6.1-updates | 1.3 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
Setting up Update Process
...
SLES-based distributions
Setting up Zypper to work with proxies for SLES:
1(a) If the proxy does not require authentication, then the following lines should be placed in the /etc/sysconfig/proxy file:
# Anonymous proxy configuration:
PROXY_ENABLED="yes"
HTTP_PROXY=”http://proxyaddress:port”
FTP_PROXY="http://proxyaddress:port"
HTTPS_PROXY="http://proxyaddress:port"
(b) if the proxy server does require authentication, then the following lines should be placed in the /etc/sysconfig/proxy file instead
# Anonymous proxy configuration:
PROXY_ENABLED="yes"
HTTP_PROXY=”http://username:password@proxyaddress:port”
FTP_PROXY="http://username:password@proxyaddress:port"HTTPS_PROXY="https://username:password@proxyaddress:port"
2 yast or zypper commands can be used to verify that the repositories are accessible
(a) For a zypper update, if the proxy wasn’t configured properly then an error message similar to the following will be displayed:
# zypper update
Download (curl) error for 'https://nu.novell.com/repo/$RCE/SLE11-SDK-SP1-Pool/sle-11-x86_64/repodata/repomd.xml?credentials=NCCcredentials':
Error code: Connection failed
Error message: couldn't connect to host
(b) If the proxy was configured properly then the update will continue as expected:
# zypper update
Loading repository data...
Reading installed packages...