Two comments:
In article <5e217o$6s...@unix2.glink.net.hk>, kin...@glink.net.hk (King Chung Ho) writes:
>William Malloy (w...@quincy.eng.sun.com) wrote:
>: Another even simpler method for this problem is to build a 2.5.1 machine
>: and then rename it to the the oldmaster's name (including the IP address, the
>: /etc/.rootkey and copy over the /var/nis directory). This replacement is
>: much faster so long as you do not have to change the servers IP address.
>I think there is a difference between the 2.4 and 2.5.1 nis+ directory
>structure. Am I correct to assume that 2.5.1's nis+ server can read the
>/var/nis directory from 2.4 machine or will do the conversion automatically
>if it sees the old directory structure?
This is right: On 2.4 the master has the directory /var/nis/<hostname> while
2.5 uses /var/nis/data. But probably the contens is the same?!
In article <855856528.11...@dejanews.com>, ssny...@cecom.com writes:
>Greetings all!
>From what I have read, it doesn't appear to be an easy way to upgrade
>from 2.4 to 2.5.1 without breaking NIS+, and moving the NIS+ master
>doesn't seem terribly easy, either. So, the solution that I'm planning
>is to export the relevant NIS+ tables into flat files, completely
>remove NIS+ from the network, and then do a fresh install of NIS+ on
>newmaster (Unless anyone can suggest a better alternative). FYI: We've
>only got about 20 NIS+ clients on the network, so removing NIS+ and then
>reinitializing the clients from the new server shouldn't be TOO much
>work...
Doing this you'll loose all your credentials ... everybody gets 'nisplus'
as nis+-password.
Actually, I did what you proposed first: Moving NIS+ from one host to another
(without waiting 12 hours twice!). There is a description on how to do that
available from the NIS+ FAQ (http://www.eng.auburn.edu/users/rayh/solaris/NIS+_FAQ.html), but be careful
with that ... there are a couple of bugs. I'll append this document including
some notices I made while I was doing the procedure (actually I did it three
times):
...
I attached the document as I received it from Sun
and included some comments in lines starting with '!'. The old lines
are preceeded by a '<' the new once by a '>'.
----- Begin Included Message -----
INFODOC ID: 11742
STATUS: Issued
SYNOPSIS: How to convert a NIS+ root replica server to a root master server.
DETAIL DESCRIPTION:
Use the following steps if you need to convert one of your root replica
servers to be the root master server:
< NOTE: In the following examples, <master> indicates the name of the old
< master server, <replica> indicates the name of the old replica server,
! this sounds nice but obviously there appears 'old master' 'new replica'
! and even 'master' when the old replica is meant. So we should better
! call the old master 'hostA' and the old replica 'hostB'
> NOTE: In the following examples, <hostA> indicates the name of the old
> master server, <hostB> indicates the name of the old replica server,
and `domainname` indicates the domainname. Items such as <rpc.nisd pid>
indicate the pid for the given process, obtained with the following
command:
ps -ef|grep <processname>
All other punctuation should be typed as written.
1 - Create master's objects for replica:
< On Master machine:
< # nsmkdir -m <replica> groups_dir.`domainname`.
< # nsmkdir -m <replica> org_dir.`domainname`.
< # nsmkdir -m <replica> `domainname`.
> On hostA:
> # nismkdir -m <hostB> groups_dir.`domainname`.
> # nismkdir -m <hostB> org_dir.`domainname`.
> # nismkdir -m <hostB> `domainname`.
<2 - Copy root.object of master
<
< On Replica machine:
< # rcp <master>:/var/nis/<master>/root.object /var/nis/<replica>
< Move root.object from master /var/nis/<master> directory to somewhere
< else (don't delete it as you may need to reverse the process if it goes wrong)
! Hm, on most systems root is not allowed to do 'rcp' *and* only root should be
! allowed to read /var/nis.
! Furthermore from Solaris 2.5 on the directories are no longer called
! /var/nis/<hostname> but /var/nis/data.
>2 - Temporary move root.object of hostA to a public place where root at hostB
can read it (don't delete it as you may need to reverse the process if it goes wrong):
> On hostA:
> # cp /var/nis/data/root.object <public_dir>
> # rm /var/nis/data/root.object
> On hostB:
> # cp <public_dir>/root.object /var/nis/data
! One thing I'm not sure about is, whether it is a good advice to keep the
! root.object *after* it was changed for the 'reverse process if it goes wrong'.
! To me it seems much more plausible to keep the original file ... but I never
! tried either.
3 - Kill rpc.nisd and nis_cachemgr on both master and replica:
> On hostA and hostB:
# kill <rpc.nisd pid> <nis_cachemgr pid>
4 - Restart rpc.nisd and nis_cachemgr on the new replica server:
< On new replica machine:
> On hostA:
# /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:
> 5 - Restart rpc.nisd on the new master, access the domainname directory, and verify that
> it is now the master. This is for sure the worst part of the whole procedure if you type
> 'nisshowcache -v' on hostA it probably knows that is is *not* master anymore but at this
> moment hostB doesn't know that it is the master now. Now you have to make hostB to get
> these information from hostA:
< On new master machine:
> On hostB:
# 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:
! I'm really not sure whether the following work always. The first time I tried it, I made
! what the original document said and I know that this did *not* work. What I'm sure about
! is that 'nismkdir' does not work without the rpc.nisd being startet
< # nsmkdir -m <hostB> groups_dir.`domainname`.
< # nsmkdir -m <hostB> org_dir.`domainname`.
> On hostB:
> # /usr/sbin/rpc.nisd -S 0
> # nismkdir -m <hostB> groups_dir.`domainname`.
> # nismkdir -m <hostB> org_dir.`domainname`.
> # nismkdir -m <hostB> `domainname`.
> If hostB still doesn't want to be the master:
> - Kill or disconnect other replica servers (if you have more than the one involved
> here)
> - Kill and restart rpc.nisd and nis_cachemgr on the old master (see 4)
> - ... kill this rpc.nisd start that nis_cachemgr until 'nisshowcache -v' tells
> hostB to be the master
7 - Change the ownership of the directories
> On hostB:
# nischown <hostB> groups_dir.`domainname`.
# nischown <hostB> org_dir.`domainname`.
> # nischown <hostB> `domainname`.
8 - Change the ownership of all the tables within the directories
< # for tables in `nisls org_dir groups_dir`
< > do
< > nischown <master> $tables
< > done
! The above certainly does not work. This should do what we wanted ...
> On hostB:
> # for table in `nisls org_dir | grep -v org_dir`
> > do
> > nischown <hostB> $table.org_dir
> > done
> # for table in `nisls groups_dir | grep -v groups_dir`
> > do
> > nischown <hostB> $table.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
> On hostB:
# nisrmdir -s <oldmaster> groups_dir.`domainname`.
# nisrmdir -s <oldmaster> org_dir.`domainname`.
# nisrmdir -s <oldmaster> `domainname`.
11 - Checkpoint the domain
> On hostB:
# 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
> On hostB:
# kill <rpc.nisd pid> <nis_cachemgr pid>
# /usr/sbin/rpc.nisd
# /usr/sbin/nis_cachemgr -i
13 - Check as users and root that all is well.
! This advice is really great! A good check would be ...
> E.g. log in to hostB as user and see if there is more that '*NP*' in the second
> column when trying 'niscat passwd.org_dir'.
14 - On the old master, clear out the old info and make it a client of the
domain
> On hostA:
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 <master>
> # nisinit -c -H <hostA>
> # /usr/sbin/nis_cachemgr -i
15 - Make the old master a replica of the domain
> (If you killed the other replicas in 6 it time to restart them here)
< On the new replica, start rpc.nisd.
< On hostA, start rpc.nisd:
> # /usr/sbin/rpc.nisd
< On the master
< # nismkdir -s <replica> groups_dir.`domainname`.
< # nismkdir -s <replica> org_dir.`domainname`.
< # nismkdir -s <replica> `domainname`.
> On hostB:
> # nismkdir -s <hostA> groups_dir.`domainname`.
> # nismkdir -s <hostA> org_dir.`domainname`.
> # nismkdir -s <hostA> `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 <nis_cachemgr pid>
17 - On each client, get a new coldstart file from the new master server
...
read more »