Coda File System

Re: Quick DNS Setup (Was: Re: Coda IRC channel / Wiki)

From: Jan Harkes <>
Date: Sat, 10 Feb 2007 12:00:50 -0500
On Sat, Feb 10, 2007 at 05:10:05PM +0100, Davor Ocelic wrote:
> On Sat, 10 Feb 2007 16:14:50 +0100
> wrote:
> > On Sat, Feb 10, 2007 at 08:17:55AM -0500, Davor Ocelic wrote:
> > > Here, updated. Works great.
> > > 
> > >
> > 
> > Hi Davor!
> > 
> > Good work, appreciated!
> > 
> > One remark, the line
> > EXAMPLE.COM.                    A      CODA_SERVER_IP
> > in the config file is not necessary and in fact can be confusing.
> > There is no need to resolve the realm name in any other way than
> > via the SRV records. Check if your setup works without that line (it should).
> It does. But, for reference, how does that work then? Srv record
> returns a hostname, which you then have no way of resolving further to
> its actual IP?

The realm -> realm servers lookup works as follows,

    1. check /etc/coda/realms for 'realm' (or /usr/local/etc/coda/realms)
       If we find a match goto step 4

    2. perform a SRV record lookup for 'realm'
       If we get a result goto step 4

    3. Use getaddrinfo to map the realm name to an ip address. Libc
       breaks this down into,
    3a. check if /etc/hosts has an entry for 'realm'
    3b. perform A record lookup 'realm'
       If this succeeded got an address goto step 5.
       If we failed to find a (list of) hostnames or ip addresses at
       this point, the realm doesn't exist or is unreachable the user
       will temporarily see a dangling symlink in /coda.

    4. We got a (list of) hostnames that are responsible for volume
       queries. Resolve these to ip-addresses with getaddrinfo.

    5. At this point we have a list of one or more ip-addresses for the
       root servers. But we don't really know if there are Coda servers
       running on these hosts, so we actually have to do some more work
       before we can instantiate the new /coda/realm mount.

       Set up an RPC2 connection to any of the root servers and perform
       a ViceGetRootVolume RPC call. If this fails assume the root is
       named '/'.

    6. Connect to any of the root servers (reuse connection if possible)
       and get the list of volume replicas for the root volume.

    7. Connect to any of the root servers (reuse connection if possible)
       and get the ip addresses of the servers that host replicas of the
       root volume.

    8. Connect to the individual servers that host the replicas of the
       root volume. Bind all successfully completed connections into a
       single MultiRPC channel, this way we can parallelize sending of
       identical messages to a group of servers.

    9. Use the MultiRPC channel to send a ViceGetAttr rpc to all
       replicas in parallel. The servers return the attributes for the
       top-level, or root object in the root volume.

    10. Using the returned attributes we can instantiate the /coda/realm
	object. Now the user will be able to see the newly discovered realm.

Received on 2007-02-10 12:02:39