Discussion Locked

Move a NIS master server

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I need to move my NIS master server onto a new machine running Solaris 8.

Has anyone had experience in this or even better can someone please tell me the steps required?

7 replies

by ziminski

the best way would be to promote a NIS+ root replica server to a root master server. (make the new server a replica server first) then:

NOTE: In the following examples, indicates the name of the old
master server, indicates the name of the old replica server >>NEW SERVER<<,
and `domainname` indicates the domainname. Items such as
indicate the pid for the given process, obtained with the following
command:
ps -ef | grep
All other punctuation should be typed as written.
1 - Create master's objects for replica:
On Master machine:
# nsmkdir -m groups_dir.`domainname`.
# nsmkdir -m org_dir.`domainname`.
# nsmkdir -m `domainname`.
2 - Copy root.object ofmaster
On Replica machine:
# rcp :/var/nis/root.object /var/nis/
or for greater than Solaris 2.5
# rcp :/var/nis/root.object /var/nis/
Move root.object from master /var/nis/[|data] directory to somewhere
else (don't delete it as you may need to reverse the process if it
goes wrong)
3 - Kill rpc.nisd and nis_cachemgr on both master and replica:
# kill
4 - Restart rpc.nisd and nis_cachemgr on the new replica server:
On new replica machine:
# /usr/sbin/rpc.nisd -S 0
# /usr/sbin/nis_cachemgr -i
5 - Access the domainname directory and verify that the old replica is
now the master:
On new master machine:
# nisshowcache -v
# niscat -o groups_dir.`domainname`.
# niscat -o org_dir.`domainname`.
# niscat -o `domainname`.
6 - If the contents of the cache still shows the old master server to be
the old master, do the following on the new master:
# nsmkdir -m groups_dir.`domainname`.
# nsmkdir -m org_dir.`domainname`.

by ziminski

con't

7 - Change the ownership of the directories

# nischown groups_dir.`domainname`.
# nischown org_dir.`domainname`.

8 - Change the ownership of all the tables within the directories

# for tables in `nisls org_dir | grep -v org_dir`
> do
> nischown $tables.org_dir
> done
# for tables in `nisls groups_dir | grep -v groups_dir`
> do
> nischown $tables.groups_dir
> done

9 - Check the tables and directory structures are owned by the correct
newmaster

# niscat -o org_dir
# niscat -o hosts.org_dir etc...

10 - Remove the old replica from replicating the directory structures

# nisrmdir -s groups_dir.`domainname`.
# nisrmdir -s org_dir.`domainname`.
# nisrmdir -s `domainname`.

11 - Checkpoint the domain

# nisping -C groups_dir.`domainname`.
# nisping -C org_dir.`domainname`.
# nisping -C `domainname`.

12 - If they are all now owned and replicated by the correct machine,
stop and restart rpc.nisd in security level 2

# kill
# /usr/sbin/rpc.nisd
# /usr/sbin/nis_cachemgr -i

by ziminski

con't
13 - Check as users and root that all is well.

14 - On the old master, clear out the old info and make it a client of
the domain
Remove everything from /var/nis except NIS_COLD_START and
NIS_SHARED_DIRCACHE.
Put the name and IP number of the new master in the /etc/hosts
file.
# nisinit -c -H

15 - Make the old master a replica of the domain

On the new replica, start rpc.nisd.

On the master

# nismkdir -s groups_dir.`domainname`.
# nismkdir -s org_dir.`domainname`.
# nismkdir -s `domainname`.

# nisping -C groups_dir.`domainname`. (note: server busy messages are
# nisping -C org_dir.`domainname`. (generated because the previous
# nisping -C `domainname`. (command has not finished.

16 - On each client, kill nis_cachemgr

# kill

17 - On each client, get a new coldstart file from the new master server

# nisinit -c -H

18 - On each client, restart nis_cachemgr

# kill
# /usr/sbin/nis_cachemgr -i

This discussion is closed to new replies.