I've also felt that it was getting archaic.Ant P. wrote:I've been looking for alternatives, but would it be better to just get rid of a fetch proxy entirely and share $DISTDIR over NFS? What happens when two emerge processes try to download the same file in that setup?
Code: Select all
sync-uri = rsync://rsync.gentoo.org/gentoo-portage Code: Select all
sync-uri = rsync://192.168.0.102/gentoo-portage
Code: Select all
$ rsync nas::
portage Gentoo Portage tree
bdist Gentoo Portage distfiles repository
backup backup file system
wbkup windows backup pics & stuff
media media/movies,etcCould you amplify this? i.e. I understand what you are saying but not how to do it.Anon-E-moose wrote:Both are set up to do emerge --sync from my nas box (although I typically only update laptop once a week)
Both check the distfiles storage area (mirror file) before they go to the internet to get a file

At this point I've outsourced everything to NFS:Tony0945 wrote:Ant P, maybe this isn't a bad way to go. My server that gets portage from the internet is up 24/7 anyway, barring reboots or maintenance problems.
Generally, I like backups in situations like this, but replacing portage is only an "emerge --sync" away, right?
Do you share /usr/portage? or one or more sub-directories?
How about using rsync with the server as source? pro's and con's? I'd be interested in your thoughts.

Code: Select all
[portage]
path = /tmp/portage
comment = Gentoo Portage tree
exclude = /distfiles /packages
[bdist]
path = /mnt/backup/portage
comment = Gentoo Portage distfiles repository
include = /distfiles
exclude = "*"
read only = falseCode: Select all
[portage]
path = /usr/portage
comment = Gentoo Portage tree
exclude = /distfiles /packages
[distfiles]
path = /usr/portage
comment = Gentoo distfiles
include = /distfiles
exclude = "*"Code: Select all
$ cat /etc/portage/mirrors
local rsync://192.168.1.11/bdistCode: Select all
$ cat /etc/portage/repos.conf/gentoo.conf
[DEFAULT]
...
[gentoo]
location = /usr/portage
sync-type = rsync
sync-uri = rsync://192.168.1.11/portage
...Code: Select all
$ cat /etc/portage/mirrors
local rsync://192.168.1.10/distfiles rsync://192.168.1.11/bdistCode: Select all
$ cat /etc/portage/repos.conf/gentoo.conf
[DEFAULT]
...
[gentoo]
location = /usr/portage
sync-type = rsync
sync-uri = rsync://192.168.1.11/portageCode: Select all
$ rsync nas::
portage Gentoo Portage tree
bdist Gentoo Portage distfiles repositoryCode: Select all
$ rsync don64::
portage Gentoo Portage tree
distfiles Gentoo distfilesCode: Select all
Listen 8088
<IfDefine DEFAULT_VHOST>
<VirtualHost *:8088>
ServerName distproxy.mytld.dom
ServerAlias distproxy
ErrorLog /var/log/apache2/distproxy-error_log
CustomLog /var/log/apache2/distproxy-access_log common
ProxyRequests On
ProxyVia On
#Cache
CacheEnable disk http://
CacheRoot /path/to/distfiles/
CacheIgnoreNoLastMod On
CacheDefaultExpire 86400
#Allow caching files up to 300MB
CacheMaxFileSize 300000000
<Proxy "*">
#Make sure only local IPs can use the proxy
Require ip 192.168
</Proxy>
</VirtualHost>
</IfDefine>
Yeah, that was one nice thing about http-replicator's flat layout... just point PORTAGE_RO_DISTDIRS at it and it symlinks instead of fetching them.Havin_it wrote:Not really what *I* was hoping for, as the on-disk cache isn't just a big ol' pile of files with their original names as was the case with http-replicator. That means the server has to "download" the distfiles itself into its $DISTDIR when emerging, meaning two copies of every file. Better if the cache was in a form you could just point the server's $DISTDIR towards.

Code: Select all
exclude=distfiles/ packages/Code: Select all
exclude= packages/Code: Select all
MSI ~ # du -hs /usr/portage/distfiles
40G /usr/portage/distfiles
Code: Select all
[distfiles]
comment = Central System Portage Distfiles
path=/usr/portage/distfiles
force user = portage
browseable = yes
public = yes
create mask = 0644
directory mask = 07ff
writeable = yes
read only = no
hosts allow = 192.168.0.96/27 127.
acl allow execute always = True
Code: Select all
//trantor/distfiles /usr/portage/distfiles cifs auto,vers=1.0,users,user=guest,password=none,rw 0 0Code: Select all
MSI ~ # cat /var/log/messages
Executed nightly log rotation
Feb 25 02:15:01 MSI root[20042]: /home/tony/.VirtualBox: 311.6 GiB (334578769920 bytes) trimmed on /dev/sdc3
Feb 25 02:15:43 MSI root[20042]: /boot/efi: 96.5 MiB (101144064 bytes) trimmed on /dev/sda1
Feb 25 02:15:43 MSI root[20042]: /: 125.4 GiB (134606393344 bytes) trimmed on /dev/sda2
Feb 25 14:56:47 MSI kernel: cifs_setlk: 9 callbacks suppressed
Feb 25 17:01:08 MSI kernel: CIFS: Attempting to mount //trantor/distfiles
Code: Select all
ewarn "Before starting http-replicator, please follow the next few steps:"
elog "- Modify /etc/conf.d/http-replicator if required."
ewarn "- Run /usr/bin/repcacheman to set up the cache."
elog "- Add http_proxy=\"http://serveraddress:8080\" to make.conf on"
elog " the server as well as on the client machines."
elog "- Make sure FETCHCOMMAND adds the X-unique-cache-name header to"
elog " HTTP requests in make.conf (or maybe portage will add it to"
elog " the default make.globals someday). Example:"
elog ' FETCHCOMMAND="wget -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" --header=\"X-unique-cache-name: \${FILE}\" \"\${URI}\""'
elog ' RESUMECOMMAND="wget -c -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" --header=\"X-unique-cache-name: \${FILE}\" \"\${URI}\""'
elog "- Arrange to periodically run repcacheman on this server,"
elog " to clean up the local /usr/portage/distfiles directory."
elog "- Arrange to periodically run something like the following"
elog " on this server. 'eclean' is in app-portage/gentoolkit."
elog " ( export DISTDIR=/var/cache/http-replicator/"
elog " eclean -i distfiles )"
elog "- Even with FETCHCOMMAND fixing most cases, occasionally"
elog " an older invalid version of a file may end up in the cache,"
elog " causing checksum failures when portage tries to fetch"
elog " it. To recover, either use eclean (above), manually delete"
elog " the relevant file from the cache, or temporarily comment"
elog " out the http_proxy setting. Commenting only requires"
elog " access to client config, not server cache."
elog "- Make sure GENTOO_MIRRORS in /etc/portage/make.conf starts"
elog " with several good http mirrors."
elog
elog "For more information please refer to the following forum thread:"
elog " http://forums.gentoo.org/viewtopic-t-173226.html"
elog
