Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
20.  Server-Use Customization Modifying Server Preferences How to Change a Server's Preference Number  Previous   Contents   Next 
   
 

How to Replace One Server With Another in a Preference List

To change one server for another in a preference list:

  • Run nisprefadm with the -m oldserver=newserver option.

#nisprefadm -L|-G -C name -m \
 oldserver=newserver(prefnumber)

Where:

  • -L|-G determine whether you are modifying a local or a domain-wide server list.

  • -C name is the IP number of a subnet or the name of a machine. This option is only used in when you are also using the -G option. The modifications you make with this command apply to the subnet or machine that you name.

  • -m is the modify-server-list option.

  • oldserver is the old server you are replacing.

  • newserver(prefnumber) is the new server (with an optional preference number) that is taking the old server's place in the preferred server list.

Keep in mind that when you replace a server in a global client_info table using the -G option, the replacement only applies to the subnet or machine identified by the -C option. Other listings of the replaced server are not affected.

For example, suppose you have a domain with three subnets, and the replica1 server is listed as a preferred server for two of those subnets. If replica1 is obsolete and you take it out of service, you then run nisprefadm -m to replace it with the new server for the first subnet. Until you do the same for the second subnet, replica1 is still listed as a preferred server for that subnet. The same principle applies to preferred servers for individual machines.

For example, to replace the replica3 server with the replica6 server for subnet 123.12.123.12 in the domain's global client_info table and assign replica6 a preference number of 1:

nismaster# nisprefadm -G -C 123.12.123.12 -m replica3 replica6(1)

How to Remove Servers From Preference Lists

To remove one or more servers from a preference list:

  • Run nisprefadm with the -r option.

#nisprefadm -L|-G -C name -r servers

Where:

  • -L|-G determines whether you are modifying a local or a domain-wide server list.

  • -C name is the IP number of a subnet or the name of a machine. This option is only used when you are also using the -G option. The preferred servers you remove with this command apply to the subnet or machine that you name.

  • -r removes the named servers from the list.

For example, in the domain's global client_info table, to remove the replica3 and replica6.manf servers for the machine polaris:

polaris# nisprefadm -G -C polaris -r replica3 replica6.manf

How to Replace an Entire Preferred Server List

To replace an entire list of preferred servers for a subnet or machine in either a global client_info table or a machine in its local client_info file, run nisprefadm with the -u option.

The -u option operates the same way as the -a option, except that -u first deletes any existing server preferences for the machine or subnet before adding the new ones that you specify. (If there are existing preferences, the -a option adds the new ones to the old list.)

See "How to Set Global Preferences for an Individual Machine" for an example using the -u option.

Specifying Preferred-Only Servers

You can specify what clients do when no preferred servers are available.

By default, if a client cannot reach a preferred server, it uses whatever other server it can find. You can specify that clients may only use preferred servers by setting the preferred-only option. See "Preferred Only Servers Versus All Servers" for background information on the preferred-only and all servers options.

To specify what clients do when no preferred servers are available, run nisprefadm with the -o value option.

How to Specify Preferred-Only Servers

To specify that clients using a server list may only obtain NIS+ information from servers named in the list:

  • Run nisprefadm with the -o pref_only option.

#nisprefadm -L|-G -o pref_only

Where:

  • -L|-G determines whether you are modifying a local or a domain-wide server list.

  • -o -pref_only specifies that clients can only obtain NIS+ information from servers on the list.


Note - This option is ignored for domains that are not served by any preferred servers.


For example, to specify in altair's local client_info file that altair must always use preferred servers and cannot use any server not on altair's preferred server list:

altair# nisprefadm -L -o pref_only

How to Revert to Using Non-Preferred Servers

To specify that clients using a server list may obtain NIS+ information from servers not named in the list if no preferred servers are available:

  • Run nisprefadm with the -o all option.

#nisprefadm -L|-G -o all

Where:

  • -L|-G determines whether you are modifying a local or a domain-wide server list.

  • -o -all specifies that clients may obtain NIS+ information from servers not on the list if no preferred servers are available.


Note - This is the default behavior. You only need to use the -o all option if you have previously specified preferred-only servers with the -o pref_only option.


For example, to specify in altair's local client_info file that altair can now use non-preferred servers if no preferred servers can be reached:

altair# nisprefadm -L -o all

Ending Use of Server Preferences

You can stop using server-use customization and revert to the obtaining NIS+ information as described in "Default Client Search Behavior".

To end server preferences, run nisprefadm with the -x option.


Note - When you end server preferences, clients do not stop using server preferences until the normal course of events as described "When Server Preferences Take Effect". You can force an immediate end to server preferences as described in"Putting Server Preferences Into Immediate Effect".


 
 
 
  Previous   Contents   Next