Article ID: 3448, created on Nov 30, 2007, last review on May 2, 2014

  • Applies to:
  • H-Sphere

Resolution

If you have 2 and more boxes with the same operating system or you want to speed up package downloads, you can create a mirror server and set an alternative URL for package downloads in updater.

Important: Since H-Sphere 3.0, we introduce http://mirror.psoft.net/ (Europe) as an alternative location for PSoft documentation, installation and update scripts and packages.

You will be able to choose mirror.psoft.net for H-Sphere installation or update by setting the mirror parameter to [1] in the install/update script. You can also download H-Sphere system packages manually from http://mirror.psoft.net/shiv/HS/ and its respective subdirectories.

On our website we have created a directory hierarchy for supported OS:
HS 2.5.0: http://www.psoft.net/shiv/HS/releases/U25.0/pkgs
HS 2.5.1: http://www.psoft.net/shiv/HS/releases/U25.1/pkgs
HS 3.0.0: http://www.psoft.net/shiv/HS/releases/U30.0/pkgs

This hierarchy is formed by the cron script on psoft.net based on files with package listing (pkglist, sspkglist, subpkglist, pkglist.priv) for all H-Sphere versions HS 2.5.0/HS 2.5.1 accordinlgy.

To create a mirror:

  1. Configure apache on the box to be used as a mirror (example):
    URL: http://mirror.server.com/HS will correspond to DocumentRoot: /var/www/psoft.net/HS/.

  2. Specify the OSCODE (the code of the operating system) you are configuring mirror for. To do this, run on every HS cluster box:
    /hsphere/shared/bin/oscode
  3. Create corresponding sub-directories in DocumentRoot for the OSCODE(s) you arrange mirroring for.
    For instance, if you have to create mirroring for boxes with OSCODE RHES4 i FBSD54, run:
    mkdir -m 0755  /var/www/psoft.net/HS/RHES4
    mkdir -m 0755  /var/www/psoft.net/HS/FBSD54
  4. Create corresponding cron tasks. For instance, mirroring for boxes with RHES4 and FBSD54 oscode for HS 2.5.1:
    0 5 * * * (cd /var/www/psoft.net/HS/RHES4/; wget --mirror --limit-rate=45k -np -nH --cut-dirs=7 
    -erobots=off http://www.psoft.net/shiv/HS/releases/U25.1/pkgs/RHES4/)
    0 5 * * * (cd /var/www/psoft.net/HS/FBSD54/; wget --mirror --limit-rate=45k -np -nH --cut-dirs=7 
    -erobots=off http://www.psoft.net/shiv/HS/releases/U25.1/pkgs/FBSD54/)

    Note: you can change the wget format. For instance, if you don't have VPS servers, you can run wget with --reject=hsphere-vps parameter (--reject=LIST sets comma-separated list of rejected extensions).

  5. On all boxes where mirror server will be used, execute:
    echo 'http://mirror.server.com/HS' >/hsphere/shared/etc/mirror

Notes:

  • If you want to cancel mirroring and download packages from psoft.net server, run:
    rm -f /hsphere/shared/etc/mirror
  • Package lists (pkglist, sspkglist, subpkglist, pkglist.priv) are downloadable mainly from psoft.net.

f213b9fa8759d57bee5d547445806fe7 6311ae17c1ee52b36e68aaf4ad066387

Email subscription for changes to this article
Save as PDF