How do I replace an NIS master server?
I need to take down my current NIS master server because it is running on RHEL 4 which is too old for the auditors to approve now.
I think I need to copy some files off the master over to a slave server and run make?
I know there are files listed in the makefile but which ones are necessary for this and which ones should be left alone?
The slave server is running Ubuntu 12.04.
Solution 1:
- Let's assume that the domain configuration is under
/var/yp/<domainname>
; - Let's assume the NIS server configuration is under
/var/yp
; - Let's assume you have some NIS related configuration files under
/etc/
as well. Those could be/etc/yp.conf
,/etc/ypserv.conf
,/etc/ypserv.securenets
and possible others (their filenames usually begin withyp...
.
What you need to do in order to move your NIS to the new server:
Copy all of these files from the old server to the new one. Make sure they are not existent there beforehand or if they are - take backups before overwriting them!
Decide if the new server will have the same hostname and IP address as the original master.
If the name is the same you would skip the clients reconfiguration, otherwise it will be necessary to point to the right server (host or IP). I would rather reconfigure the clientsCopy the passwords, groups, shadow files from the old server to the new one
Once you have all files on the new server, run
make -C /var/yp
You may need to stop the NIS service on the old server, as the domains are to be the same and can't have two master servers. If no errors - continue with following steps. Otherwise - well ... troubleshoot.Run
ypwhich
on the new server and verify it returns its own hostnameRun
ypcat passwd | grep <username>
,ypcat group | grep <groupname>
Verify this works as expected;Stop the NIS service on the old server, if not done earlier
Reconfigure all NIS clients
Change their/etc/yp.conf
to point to the respective server:echo -e "ypserver new_NIS_server" >> /etc/yp.conf
.
(alternatively this is where you would give the new machine the old one's IP/Hostname).
Good luck!