Changing the master NIS server
You may need to change your master server, for example,
if you rearrange server configuration or the master
server host is removed from service.
Any server in the NIS
domain can become the new master server because each one has
all active maps.
However, because the old NIS master's name
is contained in the existing map, you can neither
use an existing copy at the new master nor send a copy there
with ypxfr.
Rather, you must re-create these maps by running ypmake
(or make) on the new master server to associate the
new server listing with each map.
The old master server must be running NIS to complete this procedure. This is because nonmaster servers consult their own copies of maps, which include the name of the old master server, when they receive a map transfer request originating from yppush on the master. New maps with the new master server listing must come from the old master server for the maps to be incorporated on slave and copy-only servers. Therefore, if the old master is not available when you change master servers, you must rebuild your entire NIS system from scratch.
The procedures described here assume that the new master is running SCO NIS. Other implementations of NIS configure servers in a different way; consult the documentation for your version of NIS before changing master servers.
To change NIS master servers, follow these steps:
By removing the timestamp files, you force the maps to be rebuilt regardless of prior modifications. The NOPUSH option to ypmake prevents maps from being pushed to other servers until you have completed this entire procedure.
This command must be run on the old master for every current NIS map. The -h option forces ypxfr to transfer the map from the new master; the -f option forces the transfer even if the contents of the old and new maps are the same.
This command must be run on the old master for every current NIS map. When this is completed, all nonmaster servers will have received maps that include the new master listing.
\: MAPS=`oawk '{print $1 ; }' /etc/yp/YP_MAP_X_LATE` for map in $MAPS; do echo moving $map ypxfr -h new_master -f $map yppush $map doneMake sure your /etc/yp/YP_MAP_X_LATE file is current before running this command; for more information, refer to ``NIS maps''.
See also: