Changing the NIS master
I’d like to acknowledge Scott Frost for this explanation back in 2002.
Here are the steps you need to take to make a NIS slave a master server:
1. Ensure the NIS slave (the soon-to-be master) server has the current
version of the NIS maps. This should happen automatically if the push is
working between your current master and the slave server.
Each map must be rebuilt to reflect the new master. Copy the source files
/var/yp/Source and the makefile from the old master to the new one. Then
rebuild both servers maps. For example:
newmaster# cd /var/yp/
newmaster# rm *.time
newmaster# make NOPUSH=1
Removing all of the timestamp files forces all of the maps to be rebuilt;
Passing NOPUSH=1 to “make” prevennts the new maps from being pushed to the
other NIS slaves. This will keep you in service while your trying to build
the new master.
2. Install copies of the new master server’s maps on the old master server
oldmaster# ypxfr -h newmaster -f passwd.byuid
oldmaster# ypxfr -h newmaster -f passwd.bynmae
oldmaster# ypxfr -h newmaster -f hosts.byname
**Every NIS map must be transferred in this manner. I know that the syntax
seems wrong..trust it…it’s right. The -h flag sets NIS straight.
3. On the old master server push copies of the new maps to ALL o the NIS
oldmaster# yppush passwd.byuid
oldmaster# yppush passwd.byname
oldmaster# yppush hosts.byname
4. Remove the “oldmaster” host from the ypservers map