Caching Proxy - Installation and Configuration
Here is where caching tools really help. They will cache the downloaded packages to one of the designated local machine (lets call it the cache server) and the other machines can point to the cache server to get the packages. This way the packages are downloaded from the internet for the first time and from then on the local cache server will be used for getting the packages. This approach will not only save the network bandwidth, but will also make the whole installation process faster. For debian systems, apt-cacher-ng is designed to cache the packages and is really easy to install and configure. Here are the steps involved:
a) On the cache machine install the apt-cache-ng using the below command. root previlages would be required to run the command.
1
| sudo apt-get install apt-cacher-ng |
1
| sudo echo 'Acquire::http { Proxy "http://cacheserver:3142"; };' | sudo tee /etc/apt/apt.conf.d/01apt-cacher-ng-proxy |
For a rpm based system it's a bit more complicated. For rpm based systems squid should be installed either on a debian or a rpm based systems and other systems will fetch the packages from squid. Below are the instructions for installing squid on a debian based system.
a) On the cache machine install squid using the below command for debian based system. Again root previlages would be required to run the command.
1
| sudo apt-get install squid3 |
1
| cache_dir ufs /var/spool/squid3 100 16 256 |
1
| http_access deny all |
1
2
| acl allcomputers src 192.168.1.0/255.255.255.0http_access allow allcomputers |
1
2
| export http_proxy=http://cacheserver:3128export ftp_proxy=http://cacheserver:3128 |
1
2
3
4
5
| # The proxy server - proxy server:port number# The account details for yum connectionsproxy_username=yum-userproxy_password=qwerty |
For the past couple of days, I had been working on setting up a two node Cloudera CDH on a Laptop using virtualization. It's not super fast, but decent enough to try some basic commands when access to a cluster is no there. I will follow up with a blog on the process for the same.
The more I spend time with Ubuntu/Linux, the more I am liking it. It is very much customizable and can be very easily tweaked for performance.
Happy Hadooping !!!

Comments
Post a Comment
thank you for your feedback