[Apt-cacher-ng-users] acngfs

Jasper Mackenzie jasper.mackenzie at gmail.com
Sun Oct 30 05:48:31 UTC 2011


>> >This sounds familiar, please have a look at
>> >http://www.unix-ag.uni-kl.de/~bloch/acng/html/howtos.html#mirroring .
>>  OK... some n00bish questions. Sorry I dont uderstand perl to well.
>> I assume that expire-caller.pl needs to be modified to do the
>> precaching.
>
> Using a Perl script doesn't mean you need to hack it. Just copy
> /etc/cron.daily/apt-cacher-ng to /etc/cron.daily/apt-cacher-ng-mirror
> and edit the new script, add something like:
>
> ACNGREQ='?doDownload=dd&asNeeded=an&useDebDelta=ud&doMirror=Start+Mirroring'
> export ACNGREQ
>
    Maybe I am trying to do too much at once, anyway, I dont think it is all
working as it should:
    I setup as many of the cached repo's to be updated this morning in my
free bandwidth time. This seems to be successful, as looking at the we
page and getting it to tell me how much would be downloaded in a mirroring
scenario it reports 704k... so I think that part is working... but:
On once client (a) machine using apt-cacher-ng via proxy and acngfs, I get
no updates at all with apt-get dist-upgrade (debian sid)
     Changing the sources.list to not use acngfs produces the expected  
result
of a ~100mb update. Using iftop on the server it is very hard to see what
is actually being taken from the cache and what is being downloaded
directly (i.e did the mirror command work). It looked like about half came
localy (due to speed), and half was downlaoded from an external
mirror (no doubt via apt-cacher-ng)
    Independent of whether prechache/mirroring was working or not, there
should have been something to upgrade using acngfs -- what am I doing
wrong here???

Same update/upgrade behaviour on the 'server' which is also using acngfs.

On another client (b) using only the apt-cacher-ng, no acngfs, I get a
dist upgrade with heaps of downloads, and these are downloaded, not from
the cache (as they should as far as I can tell) (Ubuntu natty/oneiric) -
i.e I think the mirror command didn't work, probably due to my faulty
Precache stanza.


The conf files here for completeness:
    The 'server'
Uncommented lines of /etc/apt-cacher-ng/acng.conf

CacheDir: /var/cache/apt-cacher-ng
LogDir: /var/log/apt-cacher-ng
Port:9999
Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian # Debian
Archives
Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu # Ubuntu
Archives
Remap-debvol: file:debvol_mirror*.gz /debian-volatile ;
file:backends_debvol # Debian Volatile Archives
Remap-cygwin: file:cygwin_mirrors /cygwin # ; file:backends_cygwin #
incomplete, please create this file or specify preferred mirrors here
Remap-sfnet:  file:sfnet_mirrors # ; file:backends_sfnet # incomplete,
please create this file or specify preferred mirrors here
Remap-alxrep: file:archlx_mirrors /archlinux # ; file:backend_archlx #
Arch Linux
Remap-fedora:  file:fedora_mirrors # Fedora Linux
Remap-epel:   file:epel_mirrors # Fedora EPEL
Remap-slrep:  file:sl_mirrors # Scientific Linux
ReportPage: acng-report.html
ExTreshold: 4
PrecacheFor: debrep/dists/unstable/*/source/Sources*
debrep/dists/unstable/*/binary-amd64/Packages*
debrep/dists/unstable/*/binary-i386/Packages*
ubrep/dists/unstable/*/source/Sources*
ubrep/dists/unstable/*/binary-amd64/Packages*
ubrep/dists/unstable/*/binary-i386/Packages*
deb.opera.com/opera*/dists/stable/non-free/*/Packages*
packages.medibuntu.org/dists/*/free/*/Packages*
packages.medibuntu.org/dists/*/non-free/*/Packages*
ppa.launchpad.net/*/ppa/ubuntu/dists/*/main/*/Packages.bz2
mirror.optus.net/debian-multimedia/dists/*/main/*/Packages.bz2


ls /var/cache/apt-cacher-ng
_actmp                 debrep              _expending_damaged
_import           packages.medibuntu.org  uburep
archive.canonical.com  dl.google.com       _expending_dat
liveusb.info      ppa.launchpad.net       winswitch.org
deb.opera.com          download.jitsi.org  _impkeycache
mirror.optus.net  screenshots.getdeb.net


cat /etc/apt/apt.conf
## Cache options on localhost, minihaha
Acquire::http { Proxy "http://192.168.1.9:9999"; };


/etc/apt/sources.list
deb file:/srv/acngfs/debrep unstable main contrib non-free
deb file:/srv/acngfs/launchpad natty main
deb file:/srv/acngfs/winswitch sid main
deb file:/srv/acngfs/multimedia unstable main


/etc/fstab (relating to acngfs)

# Apt-cacher-ng mounts for fuse filesystem
http://ftp.nz.debian.org/debian /srv/acngfs/debrep acngfs
/var/cache/apt-cacher-ng/debrep 0 0
http://mirror.optus.net/debian-multimedia /srv/acngfs/multimedia acngfs
/var/cache/apt-cacher-ng/mirror.optus.net/debian-multimedia 0 0
http://winswitch.org/           /srv/acngfs/winswitch/          acngfs
/var/cache/apt-cacher-ng/winswitch.org 0 0
http://ppa.launchpad.net/deluge-team/ppa/ubuntu /srv/acngfs/launchpad/
acngfs /var/cache/apt-cacher-ng/ppa.launchpad.net/deluge-team/ppa/ubuntu/
0 0

The mount script, /sbin/mount.acngfs (differs on the clients only by
hostname)
#! /bin/bash
/usr/lib/apt-cacher-ng/acngfs $1 localhost:9999 $4 $2 -o allow_root

#/usr/lib/apt-cacher-ng/acngfs http://mirror.optus.net/debian-multimedia
localhost:9999 /var/cache/apt-cacher-ng/mirror.optus.net/debian-multimedia
/srv/acngfs/multimedia -o allow_root

ls /srv/acngfs/
debrep  launchpad  multimedia  ubrep  winswitch

-===================-
On client (a)

/etc/apt/apt.conf
## Cache options on minihaha
Acquire::http { Proxy "http://192.168.1.9:9999"; };

/etc/apt/sources.list
##ACNGFS -- apt-cacher-ng FS to save double handling
## See fstab and mount.acngfs
deb file:/srv/acngfs/debrep unstable main contrib non-free
deb-src file:/srv/acngfs/debrep unstable main contrib non-free
deb file:/srv/acngfs/debrep experimental main contrib non-free
deb-src file:/srv/acngfs/debrep experimental main contrib non-free
deb file:/srv/acngfs/winswitch sid main

acngfs mounted as on the 'server'

apt-get update ;apt-get dist-upgrade
Get:1 file: unstable InRelease [146 kB]
Get:2 file: experimental InRelease [139 kB]
Ign file: sid InRelease
Ign file: unstable/contrib TranslationIndex
Get:3 file: unstable/main TranslationIndex [2,045 B]
Ign file: unstable/non-free TranslationIndex
Ign file: experimental/contrib TranslationIndex
Ign file: experimental/main TranslationIndex
Ign file: experimental/non-free TranslationIndex
Get:4 file: sid Release.gpg [198 B]
Get:5 file: sid Release [1,839 B]
Ign file: sid/main TranslationIndex
Ign file: unstable/contrib Translation-en_NZ
Ign file: unstable/contrib Translation-en
Ign file: unstable/non-free Translation-en_NZ
Ign file: unstable/non-free Translation-en
Ign file: experimental/contrib Translation-en_NZ
Ign file: experimental/contrib Translation-en
Ign file: experimental/main Translation-en_NZ
Ign file: experimental/main Translation-en
Ign file: experimental/non-free Translation-en_NZ
Ign file: experimental/non-free Translation-en
Ign file: sid/main Translation-en_NZ
Ign file: sid/main Translation-en
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

-+++++++++==============++++++-
Client (b)
/etc/apt/apt.conf
##Use the APT cache on minihaha
Acquire::http { Proxy "http://192.168.1.9:9999"; };

/etc/apt/sources.list
deb http://ucmirror.canterbury.ac.nz/ubuntu/ natty main restricted
multiverse universe
deb-src http://ucmirror.canterbury.ac.nz/ubuntu/ natty restricted main
multiverse universe
deb http://archive.canonical.com/ubuntu natty partner
deb-src http://archive.canonical.com/ubuntu natty partner
deb http://ucmirror.canterbury.ac.nz/ubuntu/ natty-updates restricted main
multiverse universe
deb-src http://ucmirror.canterbury.ac.nz/ubuntu/ natty-updates restricted
main multiverse universe
deb http://ucmirror.canterbury.ac.nz/ubuntu/ natty-proposed restricted
main multiverse universe
deb-src http://ucmirror.canterbury.ac.nz/ubuntu/ natty-proposed restricted
main multiverse universe
deb http://ucmirror.canterbury.ac.nz/ubuntu/ natty-backports restricted
main multiverse universe
deb-src http://ucmirror.canterbury.ac.nz/ubuntu/ natty-backports
restricted main multiverse universe
deb http://liveusb.info/multisystem/depot all main
deb http://winswitch.org/ oneiric main

----
Wow, thats alot. I thought better here than pastbin

    I'me sure its something stupid that I'me doing...

Cheers.

Jasper



More information about the Apt-cacher-ng-users mailing list