After NIS is running, you may need to create a new NIS slave server that you did not include in the initial list given to ypinit.
To add a new NIS server:
Log in to the master server as root.
Change to the NIS domain directory by typing:
# cd /var/yp/domainname |
Disassemble the ypservers file, as follows:
# makedbm -u ypservers >/tmp/temp_file |
The makedbm command converts ypservers from ndbm format to a temporary ASCII file /tmp/temp_file.
Edit the /tmp/temp_file file using a text editor. Add the name of the new slave server to the list of servers. Then save and close the file.
Run the makedbm command with temp_file as the input file and ypservers as the output file:
# makedbm /tmp/temp_file ypservers |
makedbm then converts ypservers back into ndbm format.
Verify that the ypservers map is correct (since there is no ASCII file for ypservers) by typing:
slave3# makedbm -u ypservers |
The makedbm command displays each entry in ypservers on your screen.
If a machine name is not in ypservers, it will not receive updates to the map files because yppush consults this map for the list of slave servers.
Set up the new slave server's NIS domain directory by copying the NIS map set from the master server.
To do this, log in to the new NIS slave as superuser and run the ypinit and ypbind commands:
slave3# cd /var/yp slave3# ypinit -c list of servers slave3# /usr/lib/netsvc/yp/ypbind |
To initialize this machine as a slave, type the following:
# /usr/sbin/ypinit -s ypmaster |
Where ypmaster is the machine name of the existing NIS master server.
Run ypstop to stop the machine running as a NIS client.
#/usr/lib/netsvc/up/ypstop |
Run ypstart to start NIS slave service.
#/usr/lib/netsvc/up/ypstart |
See the Solaris Naming Setup and Configuration Guide for a more detailed description of setting up NIS slave servers.