Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / doc / man-pages / pod1 / fs_setserverprefs.pod
... / ...
CommitLineData
1=head1 NAME
2
3fs_setserverprefs - Sets the preference ranks for file servers or VL servers
4
5=head1 SYNOPSIS
6
7=for html
8<div class="synopsis">
9
10B<fs setserverprefs> S<<< [B<-servers> <I<fileserver names and ranks>>+] >>>
11 S<<< [B<-vlservers> <I<VL server names and ranks>>+] >>>
12 S<<< [B<-file> <I<input from named file>>] >>> [B<-stdin>] [B<-help>]
13
14B<fs sets> S<<< [B<-se> <I<fileserver names and ranks>>+] >>>
15 S<<< [B<-vl> <I<VL server names and ranks>>+] >>>
16 S<<< [B<-f> <I<input from named file>>] >>> [B<-st>] [B<-h>]
17
18B<fs sp> S<<< [B<-se> <I<fileserver names and ranks>>+] >>>
19 S<<< [B<-vl> <I<VL server names and ranks>>+] >>>
20 S<<< [B<-f> <I<input from named file>>] >>> [B<-st>] [B<-h>]
21
22=for html
23</div>
24
25=head1 DESCRIPTION
26
27The B<fs setserverprefs> command sets the local Cache Manager's preference
28ranks for one or more file server machine interfaces or, if the
29B<-vlserver> argument is provided, for Volume Location (VL) Server
30machines. For file server machines, the numerical ranks determine the
31order in which the Cache Manager attempts to contact the interfaces of
32machines that are housing a volume. For VL Server machines, the ranks
33determine the order in which the Cache Manager attempts to contact a
34cell's VL Servers when requesting VLDB information.
35
36The B<fs getserverprefs> reference page explains how the Cache Manager
37uses preference ranks when contacting file server machines or VL Server
38machines. The following paragraphs explain how the Cache Manager
39calculates default ranks, and how to use this command to change the
40defaults.
41
42=head2 Calculation of Default Preference Ranks
43
44The Cache Manager stores a preference rank in kernel memory as a paired IP
45address and numerical rank. If a file server machine is multihomed, the
46Cache Manager assigns a distinct rank to each of the machine's addresses
47(up to the number of addresses that the VLDB can store per machine). Once
48calculated, a rank persists until the machine reboots, or until this
49command is used to change it.
50
51The Cache Manager sets default VL Server preference ranks as it
52initializes, randomly assigning a rank from the range 10,000 to 10,126 to
53each of the machines listed in the local F</usr/vice/etc/CellServDB>
54file. If DNS is used to locate VL Servers, the Cache Manager will assign a
55rank to every server configured in an AFSDB or SRV record for that
56cell. Currently, the priority and weight information from SRV records is
57not used. Machines from different cells can have the same rank, but this
58does not present a problem because the Cache Manager consults only one
59cell's ranks at a time.
60
61The Cache Manager sets default preference ranks for file server machine as
62it fetches volume location information from the VLDB. Each time it learns
63about file server machine interfaces for which it has not already set
64ranks, it assigns a rank to each interface. If the local client machine
65has only one IP address, the Cache Manager compares it to the server
66interface's IP address and sets a rank according to the following
67algorithm. If the client machine is multihomed, the Cache Manager applies
68the algorithm to each of the client machine's addresses and assigns to the
69file server machine interface the lowest rank that results.
70
71=over 4
72
73=item *
74
75If the local machine is a file server machine, the base rank for each of
76its interfaces is 5,000.
77
78=item *
79
80If the file server machine interface is on the same subnetwork as the
81client interface, its base rank is 20,000.
82
83=item *
84
85If the file server machine interface is on the same network as the client
86interface, or is at the distant end of a point-to-point link with the
87client interface, its base rank is 30,000.
88
89=item *
90
91If the file server machine interface is on a different network than the
92client interface, or the Cache Manager cannot obtain network information
93about it, its base rank is 40,000.
94
95=back
96
97After assigning a base rank to a file server machine interface, the Cache
98Manager adds to it a number randomly chosen from the range 0 (zero) to
9914. As an example, a file server machine interface in the same subnetwork
100as the local machine receives a base rank of 20,000, but the Cache Manager
101records the actual rank as an integer between 20,000 and 20,014. This
102process reduces the number of interfaces that have exactly the same
103rank. As with VL Server machine ranks, it is possible for file server
104machine interfaces from foreign cells to have the same rank as interfaces
105in the local cell, but this does not present a problem. Only the relative
106ranks of the interfaces that house a given volume are relevant, and AFS
107only supports storage of a volume in one cell at a time.
108
109=head2 Setting Non-default Preference Ranks
110
111Use the B<fs setserverprefs> command to reset an existing preference rank,
112or to set the initial rank of a file server machine interface or VL Server
113machine for which the Cache Manager has no rank. To make a rank persist
114across a reboot of the local machine, place the appropriate B<fs
115setserverprefs> command in the machine's AFS initialization file.
116
117Specify each preference rank as a pair of values separated by one or more
118spaces:
119
120=over 4
121
122=item *
123
124The first member of the pair is the fully-qualified hostname (for example,
125C<fs1.example.com>), or the IP address in dotted decimal format, of a file
126server machine interface or VL Server machine
127
128=item *
129
130The second member of the pair is an integer. The possible ranks range from
131C<1> through C<65535>.
132
133=back
134
135As with default ranks, the Cache Manager adds a randomly chosen integer to
136a rank specified by this command. For file server machine interfaces, the
137integer is from the range 0 (zero) to 14; for VL Server machines, it is
138from the range 0 (zero) to 126. For example, if the administrator assigns
139a rank of 15,000 to a file server machine interface, the Cache Manager
140stores an integer between 15,000 to 15,014.
141
142There are several ways to provide ranks for file server machine interfaces
143(but not for VL Server machines):
144
145=over 4
146
147=item *
148
149On the command line, following the B<-servers> argument.
150
151=item *
152
153In a file named by the B<-file> argument. Place each pair on its own line
154in the file. Directing the output from the B<fs getserverprefs> command to
155a file automatically generates a file with the proper format.
156
157=item *
158
159Via the standard input stream, by providing the B<-stdin> flag. This
160method enables the issuer to feed in values directly from a program or
161script that generates preference ranks by using an algorithm appropriate
162to the local cell. The AFS distribution does not include such programs or
163scripts.
164
165=back
166
167When setting file server machine preference ranks, it is legal to combine
168the B<-servers>, B<-file>, and B<-stdin> options on a single command
169line. If different options specify a different rank for the same
170interface, the Cache Manager stores and uses the rank assigned with the
171B<-servers> argument.
172
173The B<-vlservers> argument is the only way to assign VL Server machine
174ranks. It can be combined with one or more of the B<-servers>, B<-file>,
175and B<-stdin> options, but the Cache Manager applies the values provided
176for those options to file server machine ranks only.
177
178The fs command interpreter does not verify hostnames or IP addresses, and
179so assigns preference ranks to invalid machine names or addresses. The
180Cache Manager never uses such ranks unless the same incorrect information
181is in the VLDB.
182
183=head1 OPTIONS
184
185=over 4
186
187=item B<-servers> <I<file server names and ranks>>+
188
189Specifies one or more file server machine preference ranks. Each rank
190pairs the fully-qualified hostname or IP address (in dotted decimal
191format) of a file server machine's interface with an integer rank,
192separated by one or more spaces; also separate each pair with one or more
193spaces. Acceptable values for the rank range from C<1> through C<65521>; a
194lower value indicates a greater preference. Providing ranks outside this
195range can have unpredictable results. Providing a value no larger than
196C<65521> guarantees that the rank does not exceed the maximum possible
197value of 65,535 even if the largest random factor (14) is added.
198
199This argument can be combined with the B<-file> argument, B<-stdin> flag,
200or both. If more than one of the arguments sets a rank for the same
201interface, the rank set by this argument takes precedence. It can also be
202combined with the B<-vlservers> argument, but does not interact with it.
203
204=item B<-vlservers> <I<VL server names and ranks>>+
205
206Specifies one or more VL Server preference ranks. Each rank pairs the
207fully-qualified hostname or IP address (in dotted decimal format) of a VL
208Server machine with an integer rank, separated by one or more spaces; also
209separate each pair with one or more spaces. Acceptable values for the rank
210range from C<1> through C<65521>; a lower value indicates a greater
211preference. Providing ranks outside this range can have unpredictable
212results. Providing a value no larger than C<65521> guarantees that the
213rank does not exceed the maximum possible value of 65,535 even if the
214largest random factor (14) is added.
215
216This argument can be combined with the B<-servers> argument, B<-file>
217argument, B<-stdin> flag, or any combination of the three, but does not
218interact with any of them. They apply only to file server machine ranks.
219
220=item B<-file> <I<input file>>
221
222Specifies the full pathname of a file from which to read pairs of file
223server machine interfaces and their ranks, using the same notation and
224range of values as for the B<-servers> argument. In the file, place each
225pair on its own line and separate the two parts of each pair with one or
226more spaces.
227
228This argument can be combined with the B<-servers> argument, B<-stdin>
229flag, or both. If more than one of the arguments sets a rank for the same
230interface, the rank set by the B<-server> argument takes precedence. It
231can also be combined with the B<-vlservers> argument, but does not
232interact with it.
233
234=item B<-stdin>
235
236Reads pairs of file server machine interface and integer rank from the
237standard input stream. The intended use is to accept input piped in from a
238user-defined program or script that generates ranks in the appropriate
239format, but it also accepts input typed to the shell. Format the interface
240and rank pairs as for the B<-file> argument. If typing at the shell, type
241Ctrl-D after the final newline to complete the input.
242
243This argument can be combined with the B<-servers> argument, the B<-file>
244argument, or both. If more than one of the arguments sets a rank for the
245same interface, the rank set by the B<-server> argument takes
246precedence. It can also be combined with the B<-vlservers> argument, but
247does not interact with it.
248
249=item B<-help>
250
251Prints the online help for this command. All other valid options are
252ignored.
253
254=back
255
256=head1 EXAMPLES
257
258The following command sets the Cache Manager's preference ranks for the
259file server machines named C<fs3.example.com> and C<fs4.example.com>, the
260latter of which is specified by its IP address, 192.12.105.100. The machines
261reside in another subnetwork of the local machine's network, so their
262default base rank is 30,000. To increase the Cache Manager's preference
263for these machines, the issuer assigns a rank of C<25000>, to which the
264Cache Manager adds an integer in the range from 0 to 15.
265
266 # fs setserverprefs -servers fs3.example.com 25000 192.12.105.100 25000
267
268The following command uses the B<-servers> argument to set the Cache
269Manager's preference ranks for the same two file server machines, but it
270also uses the B<-file> argument to read a collection of preference ranks
271from a file that resides in the local file F</etc/fs.prefs>:
272
273 # fs setserverprefs -servers fs3.example.com 25000 192.12.105.100 25000 \
274 -file /etc/fs.prefs
275
276The /etc/fs.prefs file has the following contents and format:
277
278 192.12.108.214 7500
279 192.12.108.212 7500
280 138.255.33.41 39000
281 138.255.33.34 39000
282 128.0.45.36 41000
283 128.0.45.37 41000
284
285The following command uses the B<-stdin> flag to read preference ranks
286from the standard input stream. The ranks are piped to the command from a
287program, B<calc_prefs>, which was written by the issuer to calculate
288preferences based on values significant to the local cell.
289
290 # calc_prefs | fs setserverprefs -stdin
291
292The following command uses the B<-vlservers> argument to set the Cache
293Manager's preferences for the VL server machines named C<fs1.example.com>,
294C<fs3.example.com>, and C<fs4.example.com> to base ranks of 1, 11000, and
29565521, respectively:
296
297 # fs setserverprefs -vlservers fs1.example.com 1 fs3.example.com 11000 \
298 fs4.example.com 65521
299
300=head1 PRIVILEGE REQUIRED
301
302The issuer must be logged in as the local superuser root.
303
304=head1 SEE ALSO
305
306L<fs_getserverprefs(1)>
307
308=head1 COPYRIGHT
309
310IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
311
312This documentation is covered by the IBM Public License Version 1.0. It was
313converted from HTML to POD by software written by Chas Williams and Russ
314Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.