Setting Up NIS Slave Servers
Your network can have one or more slave servers. Having slave servers ensures the continuity of NIS services when the master server is not available.
Preparing a Slave Server
Before actually running ypinit to create the slave servers, you should run the domainname command on each NIS slave to make sure the domain name is consistent with the master server.
Note - Domain names are case-sensitive.
Make sure that the network is working properly before you configure an NIS slave server. In particular, check to be sure you can use rcp to send files from the master NIS server to NIS slaves.
Setting Up a Slave Server
The following procedure shows how to set up a slave server.
How to Set up a Slave Server
Become superuser.
Edit the /etc/hosts or /etc/inet/ipnodes file on the slave server to add the name and IP addresses of all the other NIS servers.
Change directory to /var/yp on the slave server.
Note - You must first configure the new slave server as an NIS client so that it can get the NIS maps from the master for the first time. See "Setting Up NIS Clients" for details.
To initialize the slave server as a client, type the following.
# /usr/sbin/ypinit -c
The ypinit command prompts you for a list of NIS servers. Enter the name of the local slave you are working on first, then the master server, followed by the other NIS slave servers in your domain in order from the physically closest to the furthest in network terms.
To determine if ypbind is running, type the following.
# ps -ef | grep ypbind
If a listing is displayed, ypbind is running.
If ypbind is running, stop it.
# /usr/lib/netsvc/yp/ypstop
Type the following to restart ypbind.
# /usr/lib/netsvc/yp/ypstart
To initialize this machine as a slave, type the following.
# /usr/sbin/ypinit -s master
Where master is the machine name of the existing NIS master server.
Repeat the procedures described in this section for each machine you want configured as an NIS slave server.
The following procedure shows how to start NIS on a slave server.
How to Start NIS on a Slave Server
Become superuser.
Stop all existing yp processes.
# /usr/lib/netsvc/yp/ypstop
Start ypserve on the slave and run ypbind.
# /usr/lib/netsvc/yp/ypstart
Alternatively, you can reboot the slave server and the daemons start automatically.
Setting Up NIS Clients
Configuring a Machine to Use NIS
The two methods for configuring a machine to use NIS as its naming service are explained below.
ypinit. The recommended method for configuring a client machine to use NIS is to login to the machine as root and run ypinit -c.
# ypinit --c
You will be asked to name NIS servers from which the client obtains naming service information. You can list as many master or slave servers as you want. The servers that you list can be located anywhere in the domain. It is a better practice to first list the servers closest (in network terms) to the machine, than those that are on more distant parts of the net.
Broadcast method. An older method of configuring a client machine to use NIS to log in to the machine as root, set the domain name with the domainname command, then run ypbind.
# domainname doc.com
# ypbind -broadcast
When you run ypbind, it searches the local subnet for an NIS server. If it finds a subnet, ypbind binds to it. This search is referred to as broadcasting. If there is no NIS server on the client's local subnet, ypbind fails to bind and the client machine is not able to obtain namespace data from the NIS service.