By Alasdair Lumsden on 26 Jun 2010
This is just a quick post to let people know that we run a UK OpenSolaris IPS mirror, including the full /dev branch.
To use it, simply run:
# Add the mirror repository pkg set-authority -m http://pkg.osol.mirror.everycity.co.uk opensolaris.org
It’s also worth mentioning that when using the mirror, pkg search/install still requests the metadata from the origin server, which by default is in North America. Sun/Oracle run a European mirror in the Czech Republic (which is faster from the UK). You can set your publisher by doing:
# Set new European origin pkg set-publisher -g http://pkg-eu-2.opensolaris.org/dev opensolaris.org # Remove USA origin pkg set-publisher -G http://pkg.opensolaris.org/dev opensolaris.org
What IPS mirrors won’t do for you
As I mentioned, unfortunately a mirror doesn’t mirror the metadata, so when you do a search or request an install, pkg still connects to the origin server. This kind of defeats the purpose of running a mirror as the metadata operations are often the slowest bit, and is a yet another stupid limitation of IPS as a system.
If you like to live life dangerously, there’s an abusive method of creating your own package authority/origin by tearing the packages out of the repo, but it hammers the origin server for each package request and is frowned upon. Don’t let that stop you – perhaps the IPS gods will get the message that they need to implement this feature for people who want to deploy IPS mirrors in closed networks.
I’m not going to run our own origin until there’s an official supported method of doing this, as I’m not sure of the consequences. Sucking down all the packages this way resets all the timestamps, and I’m not sure if this might cause problems later down the line. Hopefully an official method of creating your own origin will spring up soon.
Fellow LoSUG presenter Andrew Watkins wrote up rather good details of how to create your own origin server using the unsupported method over here. I believe he had pretty good success with it, and presented this method at his LoSUG talk on the Automated Installer. His article is a tidied up version on a post by Christopher Kampmeier. I’ve posted a comment on his article asking for comments on this method.
Running your own mirror
Running your own mirror isn’t too hard, with instructions here. As of the date of this blog post, the whole mirror is 56GB on a compression=on ZFS dataset. Dedupe might reduce this significantly, but I’m not that brave.
If you create a mirror and your IPS Repo reports “0 packages”, it’s because you’ve started a full repo server and not a mirror. Double check you did this bit:
# svccfg -s pkg/server > add mirror > select mirror > addpg pkg application > addpg start method > setprop pkg/mirror = boolean: true > setprop pkg/inst_root = astring: "/export/pkg" > setprop pkg/threads = count: 50 > exit # svcadm refresh pkg/server:mirror # svcadm enable pkg/server:mirror