When updating the nodes I have to download several times (N for N nodes) the same packages, so a good idea is to have a proxy that would do it for me once and all nodes get from the local copy. For that we have the good old squid.

On the Master node:

$ sudo apt-get install squid

Than edit the config file. It’s rather huge but search for acl localhost and add the line below:

acl cluster src
http_access allow cluster

assuming your cluster is on that subnet.

Now, on each node (also on Master) set the environment variable (on .bashrc):

export http_proxy="http://master-node:3128/"
export ftp_proxy="http://master-node:3128/"

Also, a good idea is to increase the max cache object from 4Mb to, say 400M because the idea is to cache deb packages and not webpages. You can also limit the global size of the cache (like 1Gb) so old packages will be deleted.

# Per object (400MB)
maximum_object_size 409600 KB
minimum_object_size 64 KB
# Global (1GB)
cache_dir ufs /var/spool/squid 1000 16 256

Restart squid and you’re ready to go:

$ sudo /etc/init.d/squid restart

Leave a Reply

Your email address will not be published. Required fields are marked *