CVMFS

CVMFS is a FUSE module which implements an HTTP read-only filesystem.

CVMFS Server Setup
To get an cvmfs server system working you will need the following steps.

Kernel with aufs options enabled
The contains Linux Kernel with the aufs support module. First, you must install this package:

Note that in order to use genkernel to generate Linux kernel and initramfs, you must:

Config Apache server
The cvmfs server utility will /srv/cvmfs as storage location. Therefore, the DocumentRoot should be config to the /srv.

Config /etc/apache2/vhosts.d/default_vhost.include

DocumentRoot "/srv"

 .... 

Create CVMFS repository
1. Build&&Install cvmfs

Download cvmfs code from github cvmfs.

The cvmfs build system uses cmake. In order to compile and install, run from the source directory.

2. Create the two directories and ensure adequate sapce.
 * /cvmfs
 * /srv

3. Create a new cvmfs server "file system" and repository structure:

If there is an error in creation, remove the repository:

repository update
In cvmfs server, switch repo to a copy-on-write enabled cvmfs volume.

Then, make the necessary changes to the repository.

Run cvmfs_server publish to finalize your new repository revision. or run cvmfs_server abort to clear all changes and start over again.

Installation
Install the cvmfs package from cvmfs. See the above section.

Install the AutoFS. Typically, mounting of cvmfs repositories is handled by AutoFS. For Gentoo, you must both install autofs utility and open kernel option.

Check the /etc/auto.master has contains /cvmfs /etc/auto.cvmfs. Then, do the base setup:

Create /etc/cvmfs/default.local to set base options of cvmfs client.

This is the minimal sample of config file: CVMFS_REPOSITORIES=your.cvmfs.repo CVMFS_CACHE_BASE = /path/to/your/cache CVMFS_RELOAD_SOCKETS = /path/to/your/cache CVMFS_SERVER_URL = http://cvmfs-stratum-one.cern.ch/cvmfs/your.cvmfs.repo CVMFS_HTTP_PROXY = DIRECT

Then, use the cvmfs2 command line to mount cvmfs to local for example: cvmfs2 -o config=/etc/cvmfs/default.local your.cvmfs.repo path/to/mount/cvmfs

At last, check if cvmfs mounts correctly.

Reload the updated repository
Internally cvmfs checks for file system updates once per hour by default. You can certainly configure a lower update interval. In order to force frequent catalog updates, you can set the configuration variable CVMFS_MAX_TTL to a value in seconds. But be warned, that a very short TTL might result in high load on your server infrastructure.

if you want to invest a bit of scripting, you can also use cvmfs_talk remount or cvmfs_config reload to trigger a reload of the newest snapshot (without service interruption).