Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question on changing hostname under NIS+

Status
Not open for further replies.

0950

Technical User
May 22, 2002
12
0
0
SG
Can anyone tell me that what's the step to change the hostname & ip address for NIS+ master server? Need it urgently, thanks in advance!
 
congartulations; this is one of the worst things in NIS+


I think you can use this document
Code:
Document ID: ID16166 
Synopsis: How to move the NIS+ root master to a new machine 

--------------------------------------------------------------------------------

Document Body  

This tip sheet assumes that you already have a NIS+ setup configured and 
presently want to make another machine ( probably new) the root master for 
various reasons.

The sequence of the steps would be :
 
1) Dump the tables from the old master 
2) making the new machine the root master for the domain
3) gradually moving the existing clients towards the new root master 
   ( including the existing replicas), 
4) recreating required replicas, 
5) De-comission the old master(which can later be made a client/replica to
   the new master if needed)

SETTING UP THE NEW MACHINE AS THE ROOT-MASTER:
----------------------------------------------

1) Dump the nis+ datbase from the old master
  
  old-master# mkdir /var/nisfiles
  old-master# cd /var/nisfiles
  
  old-master# /usr/lib/nis/nisping -C groups_dir.`domainname`.
  old-master# /usr/lib/nis/nisping -C org_dir.`domainname`.
  old-master# /usr/lib/nis/nisping -C `domainname`.
  
  old-master# /usr/lib/nis/nisaddent -d aliases > aliases
  old-master# /usr/lib/nis/nisaddent -d bootparams > bootparams
  old-master# /usr/lib/nis/nisaddent -d ethers > ethers
  old-master# /usr/lib/nis/nisaddent -d group > group
  old-master# /usr/lib/nis/nisaddent -d hosts > hosts
  old-master# /usr/lib/nis/nisaddent -d netgroup > netgroup
  old-master# /usr/lib/nis/nisaddent -d netid > netid
  old-master# /usr/lib/nis/nisaddent -d netmasks > netmasks
  old-master# /usr/lib/nis/nisaddent -d networks > networks
  old-master# /usr/lib/nis/nisaddent -d passwd > passwd
  old-master# /usr/lib/nis/nisaddent -d protocols > protocols
  old-master# /usr/lib/nis/nisaddent -d publickey > publickey
  old-master# /usr/lib/nis/nisaddent -d rpc > rpc
  old-master# /usr/lib/nis/nisaddent -d services > services
  old-master# /usr/lib/nis/nisaddent -d shadow > shadow
  old-master# /usr/lib/nis/nisaddent -d timezone > timezone
  old-master# /usr/lib/nis/nisaddent -d -t auto_home.org_dir key-value > auto_home
  old-master# /usr/lib/nis/nisaddent -d -t auto_master.org_dir key-value > auto_master
  
2) Make a "/var/nisfiles" directory on the new master and copy all the files 
   under /var/nisfiles on the old master to /var/nisfiles on the new master. 
  
   new-master#rcp oldmaster:/var/nisfiles/* /var/nisfiles

  (rcp requires the presents of a .rhosts  file or a host.equiv file on the
   remote machine so the user is not prompted for a password.)

***NOTE:  If the same IP and the name are being used for the old-master and
   the new-master machine, the files need to be copied to a third machine,
   the old-master must be removed from the network, and the new master
   configured properly, so that it assumes the same name and IP address of the
   old-master
 
3) Build the new master

***NOTE: If the new-master is already an NIS+ machine (replica/client)
   belonging to the old domain, NIS+ has to be removed from the machine

  new-master# cp /etc/nsswitch.files /etc/nsswitch.conf
  new-master# kill <PID_of_rpc.nisd>
  new-master# kill <PID_of_rpc.nispasswdd>
  new-master# kill <PID_of_nis_cachemgr>
  new-master# rm -f /etc/.rootkey
  new-master# rm -rf /var/nis/*
  new-master# rm -rf /etc/defaultdomain

   *** REBOOT at this point).
  ]

  new-master# /usr/lib/nis/nisserver -v -r -d <domainame.with.railing.dot>
  
4) Remove the lines related to the new-master from /var/nisfiles/publickey

   e.g.: unix.new-master@domain
  
5) Add the new-master's present publickey to the /var/nisfiles/publickey
  
   new-master# /usr/lib/nis/nisaddent -d publickey >> /var/nisfiles/publickey
   
6) Populate the tables on the new master.
  
   new-master# cd /var/nisfiles
   new-master# nispopulate -v -F  
  
7) Update the database with the original publikeys.
  
   new-master# nisaddent -rv -f /var/nisfiles/publickey  publickey
     
8) Checkpoint the database
   
   new-master# /usr/lib/nis/nisping -C org_dir
   new-master# /usr/lib/nis/nisping -C groups_dir
   new-master# /usr/lib/nis/nisping -C
  
MOVING THE CLIENTS TO THE NEW MASTER:
-------------------------------------

9) Copy the /var/nis/NIS_COLD_START from the master on to the client's   
   /var/tmp and reinitialise the client.
  
   client# rcp new-master:/var/nis/NIS_COLD_START /var/tmp
   client# nisinit -c -C /var/tmp/NIS_COLD_START
   client# kill <PID_of_nis_cachemgr>
   client# rm /var/nis/.NIS_PRIVATE_DIRCACHE /var/nis/NIS_SHARED_DIRCACHE
   client# /usr/sbin/nis_cachemgr

REINITIALISE THE REPLICAS:
---------------------------
  
10) Remove nis+ from the old replicas (PSD section 3.17) and reinitialize as
    clients( PSD section 3.2 (and then as replicas for the new master if needed).
    (PSD section 3.3)

REMOVE THE NIS+ FROM THE OLD MASTER AND REINITAILIZE AS CLIENT:
--------------------------------------------------------------
  
11) Remove the nis+ from the old master and initialize as a client to the new 
    master (PSD section 3.17 and PSD section 3.2).

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top