cancel
Showing results for 
Search instead for 
Did you mean: 

Slave to Master NIS

SOLVED
Go to solution
shyuejyh
Occasional Visitor

Slave to Master NIS

Hi All:
i have a question in myself lab.

if my master nis crash, how can i rebuild my master nis db and /etc/passwd shadow .. etc

i already read this post
http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1287487611506+28353475&threadId=1189861

but i don't know how to do , from db to /etc/passwd
because when I in master /var/yp/ type make . my db and passwd will not sync ( i guess).

anyone can help ? i want sync NIS DB to my new NIS Master Server .

thanks a lot. :)
4 REPLIES
Steven Schweda
Honored Contributor

Re: Slave to Master NIS

> [...] how can i rebuild [...]

What, exactly, did you lose?

> but i don't know how to do , from db to
> /etc/passwd

Normally, on an NIS master, the NIS data base
is generated from a source file, like, say,
"/etc/passwd", not the other way around.

> [...] because when I in master /var/yp/
> type make . my db and passwd will not sync
> ( i guess).

Perhaps showing us exactly what you do and
exactly what happens when you do it would be
better than your guessing.

> i want sync NIS DB to my new NIS Master
> Server .

I don't understand that. What is "my new NIS
Master Server"?
shyuejyh
Occasional Visitor

Re: Slave to Master NIS

3 computers , 1 master , 1 slave , 1 client.
3 account in NIS DB, like 1111,2222,3333.

The master add new user than update new use account,password to NIS DB and yppush to slave.

The client use ypbind authentication from slave.

my question is:
first,if master NIS data lost (mabey system or disk broken), when i reinstall a new machine, how can i move slave DB to Master DB , and make master NIS system work ?

second,the new master NIS "/etc/passwd" is empty (i mean it's new,so don't have any system account) , how can i use NIS DB to update system account ?

very thanks >.<
Steven Schweda
Honored Contributor
Solution

Re: Slave to Master NIS

> first,if master NIS data lost [...]

I'd probably restore the source files from a
backup. I think of NIS as a way to _share_
file-based data ("/etc/passwd", "/etc/hosts",
...), not a complete replacement for the
file-based data.

> [...] how can i move slave DB to Master DB
> , and make master NIS system work ?

Perhaps you could move the data base files
around, but then what happens when you do the
next "ypmake"? I think that you really want
to have the right _source_ files on the NIS
master, and then getting a good NIS data base
should not be a problem.

> second,the new master NIS "/etc/passwd" is
> empty (i mean it's new,so don't have any
> system account) , how can i use NIS DB to
> update system account ?

Same answer. I'd restore the source files,
not the NIS data base files.

As usual, many things are possible. For
example, you could keep backup copies of the
NIS master's source files on an NIS slave.
(Restoring a few files from a local disk is
normally easier than restoring a few files
from a tape filled with other files.) Then,
when the NIS master system dies, you could
move those backup copies into position on the
slave (if they're not already where they need
to be), and then use "ypinit -m" on the slave
to make _it_ the master (while you work on
rebuilding the NIS master system).

Look at "/var/yp/Makefile" (?) to see which
files it's using to make the NIS data base.

General warning: You're getting free advice
from someone who hasn't used NIS very much in
recent years. (But I think that it makes
sense.)
shyuejyh
Occasional Visitor

Re: Slave to Master NIS

Dear Steven:
I'm very thanks for your help . It's very useful to me :)