nisprefadm - NIS+ utility to set server preferences for NIS+ clients
/usr/bin/nisprefadm -a {-L | -G} [-o opt-string] [-d domain] [-C client] server...
/usr/bin/nisprefadm -m {-L | -G} [-o opt-string] [-d domain] [-C client] oldserver=newserver...
/usr/bin/nisprefadm -r {-L | -G} [-o opt-string] [-d domain] [-C client] server...
/usr/bin/nisprefadm -u {-L | -G} [-o opt-string] [-d domain] [-C client] server...
/usr/bin/nisprefadm -x {-L | -G} [-d domain] [-C client]
/usr/bin/nisprefadm -l {-L | -G} [-d domain] [-C client]
/usr/bin/nisprefadm -F
nisprefadm defines which servers are to be preferred by NIS+ clients. This information is used by nis_cachemgr(1M) to control the order in which it selects which server to use for a particular domain. On a client system, the cache manager first looks for a local preferred server list in /var/nis. If it doesn't find one, it looks for an entry with its host name in the NIS+ table. Finally, if it doesn't find it there, it looks for an entry for its subnet.
By default, nis_cachemgr puts all servers that are on the same subnet as the client system (that is, local servers) are on the preferred server list. In some cases this default preferred server list is inadequate. For example, if all of the servers for a domain are remote, but some are closer than others, the cache manager should try to select the closer one. Because the cache manager has no reliable way to determine the distance to remote servers, nisprefadm is used to provide this information.
The preferred server information is stored either globally in a NIS+ table (with the -G option) or locally in a file, /var/nis/client_info (with the -L option). It is preferable to store the information globally so that it can be used by all clients on a subnet. The nis_cachemgr process on a client machine reloads the preferred server information periodically, depending on the machine's setup. If the local file is used, the information is reloaded every 12 hours. If the global table is used, the information is reloaded based on the TTL value of the client information table. This TTL value can be changed using nischttl(1). If you want your changes to take effect immediately, use the nisprefadm -F command. When changing local information (-L), nisprefadm automatically forces nis_cachemgr to reload the information.
The cache manager assigns weights to all of the servers on the preferred list. By default, local servers (that is, servers on the same subnet) are given a weight of 0. Other servers are given the weight, "infinite". This can be changed by using the nisprefadm command and giving a weight in parentheses after the server name. When selecting a server for a domain, the cache manager first tries to contact the servers with the lowest weight. If it doesn't get a response, it tries the servers with the next lowest weight, and so on. If it fails to get a response from any of the preferred servers, it tries to contact the non-preferred servers.
The use of weights gives fine control over the server selection process, but care must be given to avoid assigning too many different weights. For example, if weights 0, 1, 2, and 3 are used, but all of the servers with weight 0, 1, and 2, are unavailable, then there will be a noticeable delay in selecting a server. This is because the cache manager waits 5 seconds for a response at each weight level before moving on to the next one. As a general rule, one or two weight levels provides a good balance of server selection control and performance.
When specifying a server name, it is not necessary to fully qualify the name. When the cache manager tries to access a domain, it compares the list of servers for the domain with the list of preferred servers. It will find a match if a preferred server name is a prefix of the name of a server for the domain. If a domain is served by two servers with the same prefix, the preferred server name must include enough of the domain name to distinguish the two.
The nis_cachemgr(1M) process automatically adds local servers (same subnet as the client) to the preferred server list with a weight of 0. Thus, it is not necessary to specify them, though it does no harm.
If you specify a weight for a server, you probably should quote the parentheses to avoid having the shell interpret them. The following command illustrates this:
example% nisprefadm -G -a -C client1 "srv1(2)"
In general, nis_cachemgr does a fairly good job of selecting servers on its own. Therefore, the use of nisprefadm is not usually necessary. Some situations in which it is recommended are:
No local servers, many remote servers
Very remote servers
In the SYNOPSIS, when several options are surrounded by braces (that is, by `{' and `}') one of the options must be specified.
-a
-C client
-d domain
-F
This option must be executed as root.
-l
-L | -G
The -L option must be run as root.
-m
-o
-r
-u
-x
nisprefadm returns the following values:
0
1
Example 1 Using nisprefadm
This command sets the preferred server list for the system on which it is run:
example% nisprefadm -L -a srv1 srv2
The information is stored in a file, /var/nis/client_info, so it will only affect this one system.
The following command has the same effect, but the information is stored in a NIS+ table in the default domain.
example% nisprefadm -G -a srv1 srv2
As a system administrator, you might want to set the preferred server information for a client system other than the one you are running the command on. The following command sets the preferred server information for a client system named client1:
example% nisprefadm -G -a -C client1 srv1 srv2
It is common for all client systems on a subnet to use the same set of preferred servers. The following command sets a preferred server list that applies to all clients on subnet, 192.85.18.0:
example% nisprefadm -G -a -C 192.85.18.0 srv1 srv2
See attributes(5) for descriptions of the following attributes:
|
nischttl(1), nis_cachemgr(1M), attributes(5)
NIS+ might not be supported in future releases of the Solaris Operating system. Tools to aid the migration from NIS+ to LDAP are available in the current Solaris release. For more information, visit http://www.sun.com/directory/nisplus/transition.html.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |