Configure An AFS Fileserver
From Syscore
These are basic configuration steps to perform when setting up one of our Solaris-based AFS fileservers.
System Tuning
If the server has crazy RAM, crank up ncsize in /etc/system
set ncsize=2000000
AFS Software
The easiest thing to do is copy /usr/afs from an existing server. BE SURE TO REMOVE /usr/afs/local/sysid BEFORE STARTING THE FILESERVER OR ULTIMATE DOOM WILL BEFALL YOU. This cannot be stressed enough.
ULTIMATE DOOM.
Do not let this happen. If it does happen, this fileserver will notify the vldb servers that it is now the fileserver you stole /usr/afs from, and clients will go to it looking for their volumes. Recovering from this is a SERIOUS PAIN IN THE ASS. Don't do it. I only know because I did once, a very long time ago.
We're currently running OpenAFS 1.4.2 with the following patches:
ZFS Setup
Here's a simple ZFS setup for a four-partition server called hfs1.
# zpool create hfs1 mirror device1 device2 # zfs set compression=on hfs1 # zfs set atime=off hfs1 # zfs set recordsize=65536 hfs1
At this point, do a "df" and figure out the size of that hfs1 filesystem; divide it by 4 * 1024 and make a note of it.
# zfs set mountpoint=none hfs1 # for x in a b c d; do > zfs create -b 65536 hfs1/vicep$x > zfs set mountpoint=/vicep$x hfs1/vicep$x > zfs set quota=<numberfromabove>M hfs1/vicep$x > touch /vicep$x/AlwaysAttach > done
Now, you're ready to rock-n-roll.
The 64k block/record size was chosen after staring at some dtrace'd stats of an active AFS fileserver, and it seems to work. The default was causing the fileserver to be all read-happy and it would monopolize on the backend storage.
We set the quota on each partition to the appropriate fraction of the partition's true size, as the AFS volserver & vos utils seem to hate really big partitions and start doing strange things.
