SUMMARY: How to change the master in a NIS environment

From: Goodson Alex A (Alex.Goodson@CTS.zeneca.com)
Date: Tue Mar 09 1999 - 03:44:47 CST


Apologies for taking so long to Summarise this but I wanted to make sure it
worked. It does work but with a few conditions. Firstly, it assumes you have
at least 2 slaves and 1 master. Secondly it's quite ruthless with ypbind and
rpcbind which can cause problems with your nfs processes and also Legato
Networker processes (not sure why but we had to stop and start them).
Probably the safest bet is to reboot each server after you've finished all
the nis work. I'm also not certain that you need to move the `domainname`
directories out of the way but it doesn't hurt.

However, in the end this does work which is what I was looking for. Many
thanks to those who replied. This is a combination of their suggestions plus
a bit of my own work.

Ensure all servers bind to themselves. Create
/var/yp/binding/`domainname`/ypservers

Stop NIS on oldmaster
oldmaster:/etc/init.d/yp stop
oldmaster:kill ypbind
oldmaster:/etc/init.d/rpc stop
mv /var/yp/`domainname` /var/yp/`domainname`.alex
mv /var/yp/binding/`domainname` /var/yp/binding/`domainname`.alex

Stop NIS on newmaster
newmaster:/etc/init.d/yp stop
newmaster:kill ypbind
newmaster:/etc/init.d/rpc stop
mv /var/yp/`domainname` /var/yp/`domainname`.alex
mv /var/yp/binding/`domainname` /var/yp/binding/`domainname`.alex

NIS Check on slave
slave:ypwhich
slave:ypcat passwd

Make newmaster a master server
# get source files from oldmaster
ftp oldmaster:/yp_master/* newmaster:/yp_master/*
ftp oldmaster:/var/yp/Makefile newmaster:/var/yp/Makefile
newmaster:/etc/init.d/rpc start # ypbind wont start but it doesn't matter
newmaster:ypinit -m
newmaster:/etc/init.d/yp start

Make oldmaster a slave server
oldmaster:/etc/init.d/rpc start
oldmaster:ypinit -s newmaster
If ypbind is not running re-run /etc/init.d/rpc start # This will be the
case
If ypinit hangs create /var/yp/binding/`domainname`/ypservers # This will
also happen
oldmaster:ypinit -s newmasteroldmaster:ypinit -s newmaster
oldmaster:/etc/init.d/yp start

Check NIS on oldmaster
oldmaster: ypwhich
oldmaster: ypwhich -m
oldmaster: ypcat passwd

Sort out existing Slave servers to receive maps from new master
slave:/etc/init.d/yp stop
slave:kill ypbind
slave:/etc/init.d/rpc stop
mv /var/yp/`domainname` /var/yp/`domainname`.alex
mv /var/yp/binding/`domainname` /var/yp/binding/`domainname`.alex
slave:/etc/init.d/rpc start
slave:ypinit -s newmaster
Create /var/yp/binding/`domainname`/ypservers
If ypbind is not running re-run /etc/init.d/rpc start # This will be the
case
slave:ypinit -s newmaster
If ypinit hangs create /var/yp/binding/`domainname`/ypservers # This will
also happen
slave:ypinit -s newmaster
slave:/etc/init.d/yp start

Check NIS on slave
slave: ypwhich
slave: ypwhich -m
slave: ypcat passwd

Hope this proves useful.

Alex



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:16 CDT