[OpenAFS] OpenAFS algorithm

Harald Barth haba@kth.se
Fri, 16 Apr 2010 18:16:22 +0200 (CEST)

> My question is how to permit client in B to use server in B ? I
> didn't found any document explaining the algorithm used by OpenAFS
> to decide the server contacted by the client.

The algoritm is very old and if your IP numbers do not reflect your
network topology it probably yields incorrect results.

Have a look at man fs_setserverprefs and man fs_getserverprefs

a lower value indicates a greater preference

but first check that the clients really knows that there is more than one copy (something like this):

$ fs where /afs/pdc.kth.se/home/
File /afs/pdc.kth.se/home/ is on hosts kinilaw.pdc.kth.se morena.pdc.kth.se sculpin.pdc.kth.se houting.pdc.kth.se 

As my list from fs gets is quite long, I came up with this to find out
which one should be the prefered server:

$ fs gets | awk '$1 ~ "'$(echo $(fs where /afs/pdc.kth.se/home/ | awk -Fhosts\  '{print $2}') | sed "s/\ /|/g")'"' | sort +1 -2n