#ifdef it all out so we compile with heimdal-0.7.2
[arla.git] / doc / afs-basics.texi
blob29c1a030d5192d0afeebc81e8e16e8614842b2d5
1 @c Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
2 @c (Royal Institute of Technology, Stockholm, Sweden).
3 @c All rights reserved.
5 @c $Id$
7 @node AFS infrastructure, Organization of data, Introduction, Top
8 @comment  node-name,  next,  previous,  up
9 @chapter AFS infrastructure
11 This is an overview of the AFS infrastructure as viewed from a Transarc
12 perspective, since most people still run Transarc cells.
14 @section AFS Filespace
16 @cindex AFS Filespace
17 @cindex Filespace
18 @cindex Cell
20 AFS filespace is split up in smaller parts called cells. These cells are
21 usually listed under @file{/afs}. A cell is usually a whole organization
22 or an adminstative unit within an organization. An example is e.kth.se
23 (with the path @file{/afs/e.kth.se}), that is the department of
24 electrical engineering at KTH, which obviously has the @file{e.kth.se}
25 domain in DNS.  Using DNS domains for cell names is the typical and most
26 convenient way.
28 Note that cell names are written in lowercase by convention.
30 @section CellServDB
32 @cindex CellServDB
33 All cells (and their db-servers) in the AFS world are listed in a file
34 named @file{CellServDB}. There is a central copy that is maintained by
35 Transarc at @file{/afs/transarc.com/service/etc/CellServDB}.  
37 In spite of being organized in IPnumber - name pairs, where the name
38 parts resemble comments, both values are used by Transarc software and
39 confusion may arise if they are not synchronized with each other.
41 @example
43 >e.kth.se               # Royal Institute of Technology, Elektro
44 130.237.48.8                    #sonen.e.kth.se.
45 130.237.48.7                    #anden.e.kth.se.
46 130.237.48.244                  #fadern.e.kth.se.
48 @end example
50 Again, please note that the text after the # in the cell-name is a
51 comment, @strong{but} the hostnames after the # on the rows of an
52 IP-address is @strong{not} a comment. The host and the ip-address needs
53 to point at the same computer.
55 @section AFSDB
57 @cindex AFSDB
58 @cindex DNS
60 In addition Arla can use DNS to find the db-servers of a cell. The DNS
61 resource record that is used is the @samp{AFSDB}. The resourcerecord was
62 created by Transarc but have never been implemeted in released
63 software.
65 @samp{AFSDB} tells you what machines are db servers for a particular
66 cell.  The @samp{AFSDB} resourcerecord is also used for DCE/DFS.  An example
67 (the 1 means AFS, 2 is used for DCE):
69 @example
70 e.kth.se.               IN AFSDB     1 fadern.e.kth.se.
71 e.kth.se.               IN AFSDB     1 sonen.e.kth.se.
72 e.kth.se.               IN AFSDB     1 anden.e.kth.se.
73 @end example
75 @section Shortcut names
77 Some cells use the abbreviated version
78 @file{/afs/<word-before-first-dot>} (in the example above that would be
79 @file{/afs/e/}.  This might be convenient when typing them, but is a bad
80 idea, because it does not create the same name space everywhere.  If you
81 create a symbolic link to @file{/afs/e/foo/bar}, it will not work for
82 people in other cells.
84 @section Server organization
86 There are several servers running in an AFS cell. For performance and
87 redundancy reasons, these servers are often run on different hosts.
88 There is a built in hierarchy within the servers (in two different
89 dimensions).
91 There is one server that keeps track of the other servers within a host,
92 restart them when they die, make sure they run in the correct order,
93 save their core-files when they crash, and provide an interface for the
94 sysadmin to start/stop/restart the servers. This server is called
95 bos-server (Basic Overseer Server).
97 Another hierarchy is the one who keeps track of data (volumes, users,
98 passwords, etc) and who is performing the real hard work (serving files)
99 There is the the database server that keeps the database (obviously),
100 and keeps several database copies on different hosts relpicated with
101 Ubik (see below). The fileserver and the client software (like the
102 afsd/arlad, pts and, vos) are pulling meta-data out of the dbserver to
103 find where to find user-privileges and where volumes resides.
105 @section Basic overseer - boserver
107 @cindex Bos server
108 The Bos server is making sure the servers are running. If they crash, it
109 saves the corefile, and starts a new server. It also makes sure that
110 servers/services that are not supposted to run at the same time do not.
111 An example of this is the fileserver/volserver and salvage. It would be
112 devastating if salvage tried to correct data that the fileserver is
113 changing. The salvager is run before the fileserver starts. The
114 administrator can also force a file server to run through salvage again.
116 @section Ubik
118 @cindex Ubik
119 Ubik is a distributed database. It is really a (distributed) flat file
120 that you can perform read/write/lseek operation on. The important
121 property of Ubik is that it provides a way to make sure that updates are
122 done once (transactions), and that the database is kept consistent. It
123 also provides read-only access to the database when there is one (or
124 more) available database-server(s).
126 This works the following way: A newly booted server sends out a message
127 to all other servers that tells them that it believes that it is the new
128 master server. If the server gets a notice back from an other server
129 that tells it that the other server believes that it (or a third server)
130 is the master, depending on how long it has been masterserver it will
131 switch to the new server. If they can't agree, the one with the lowest
132 ip-address is supposed to win the argument. If the server is a slave it
133 still updates the database to the current version of the database.
135 A update to the database can only be done if more than half of the
136 servers are available and vote for the master. A update is first
137 propaged to all servers, then after that is done, and if all servers
138 agree with the change, a commit message is sent out from the server, and
139 the update is written to disk and the serial number of the database is
140 increased.
142 All servers in AFS use Ubik to store their data.
144 @section Volume Location database server - vlserver
146 @cindex Vlserver
147 @cindex Vldbserver
148 The vldb-server is resposible for the information on what fileserver
149 every volume resides and of what kind of volumes exists on each
150 fileserver.
152 To confuse you even more there are three types of support for the
153 clients. Basically there is AFS 3.3, 3.4, and 3.6 support. The different
154 interfaces look the same for the system administrator, but there are
155 some important differences.
157 AFS 3.3 is the classic interface. 3.4 adds the possibility of multihomed
158 servers for the client to talk to, and that introduces the N interface.
159 To deal with multihomed clients AFS 3.5 was introduced. This is called
160 call the U interface. The name is due to how the functions are named.
162 The N interface added more replication-sites in the database-entry
163 structure. The U interface changed the server and clients in two ways.
165 When a 3.5 server boot it registers all its ip-addresses. This means
166 that a server can add (or remove) an network interface without
167 rebooting. When registering at the vldb server, the file server presents
168 itself with an UUID, an unique identifier. This UUID will be stored in a
169 file so the UUID keeps constant even when network addresses are changed,
170 added, or removed.
172 @section Protection server - ptserver
174 @cindex Ptserver
175 The protection server keeps track of all users and groups. It's used a
176 lot by the file servers. Users can self create, modify and delete
177 groups.
179 When a fileserver is access they are durring the authentication giving
180 the name of the client. This name if looked up in the
181 protection-database via the protection server that returns the id of the
182 user and all the groups that the user belongs too.
184 This information is used when to check if the user have access to a
185 particular file or directory. All files created by the user are assigned
186 the user id that the protectionserver returned.
188 @section Kerberos server - kaserver
190 The kaserver is a Kerberos server, but in other clothes. There is a new
191 RPC interface to get tickets (tokens) and administer the server.  The
192 old Kerberos v4 interface is also implemented, and can be used by
193 ordinary Kerberos v4 clients.
195 You can replace this server with an Heimdal kdc, since it provides a
196 superset of the functionality.
198 @section Backup server - buserver
200 @cindex Backup server
201 @cindex Buserver
202 The backup server keeps the backup database that is used when backing up
203 and restoring volumes. The backup server is not used by other servers,
204 only operators.
206 @section Update server - upserver
208 @cindex Upserver
209 With the update server its possible to automagicly update configuration
210 files, server binaries.  You keep masters that are supposed to contain the
211 correct copy of all the files and then other servers can fetch them from there.
213 @section Fileserver and Volume Server - fs and volser
215 @cindex Fileserver
216 @cindex Fsserver
217 @cindex Volser
218 @cindex Volumeserver
219 The file server serves data to the clients, keeps track of callbacks,
220 and breaks callbacks when needed. Volser is the administative interface
221 where you add, move, change, and delete volumes from the server.
223 The volume server and file server are ran at the same time and they sync
224 with each other to make sure that fileserver does not access a volume
225 that volser is about to modify.
227 Every time a fileserver is started it registers it IP addresses with the
228 vldbserserver using the VL_RegisterAddrs rpc-call. As the unique identifier
229 for itself it uses its afsUUID. 
231 The afsUUID for a fileserver is stored in /usr/afs/local/sysid. This is
232 the reson you must not clone a server w/o removing the sysid
233 file. Otherwise the new filserver will register as the old one and all
234 volumes on the old fileserver are pointed to the new one (where the
235 probably doesn't exist).
237 The fileserver doesn't bind to a specific interface (read address), gets
238 all packets that are destined for port 7000 (afs-fileserver/udp). All
239 outgoing packets are send on the same socket, and means that your
240 operatingsystem will choose the source-address of the udp datagram. 
242 This have the side-effect that you will have asymmetric routing on
243 mulithomed fileserver for 3.4 (and older) compatible clients if they
244 don't use the closest address when sorting the vldb entry. Arla avoids
245 this problem.
247 @section Salvage
249 @cindex Salvage
250 Salvage is not a real server. It is run before the fileserver and volser
251 are started to make sure the partitions are consistent.
253 It's imperative that salvager is NOT run at the same time as the
254 fileserver/volser is running.
256 @section Things that milko does differently.
258 Fileserver, volumeserver, and salvage are all in one program.
260 There is no bu nor ka-server. The ka-server is replaced by kth-krb or
261 Heimdal. Heimdal's kdc even implements a ka-server readonly interface,
262 so your users can keep using programs like klog.