Solaris Naming Setup and Configuration Guide

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 NIS Slave Servers -- Task Map

Table 10-2 Setting Up NIS Slave Servers

Task 

Description 

For Instructions, Go To 

Setting Up NIS Slave Servers 

Set up NIS slave servers 

"How to Set Up a Slave Server"

How to Set Up a Slave Server

Now you are ready to create a new slave server, as follows:

  1. As root, 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.

  2. Change directory to /var/yp on the slave server.

  3. 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).


    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.)


  4. To determine if ypbind is running, type:


    # ps -ef | grep ypbind

    If a listing is displayed, ypbind is running.

  5. If ypbind is running, stop it by typing:


    # /usr/lib/netsvc/yp/ypstop
  6. Type the following to restart ypbind:


    # /usr/lib/netsvc/yp/ypstart
  7. 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.

Starting NIS Service on a Slave Server

Now you can start daemons on the slave server and begin NIS service. All existing yp processes must be stopped, by typing:


# /usr/lib/netsvc/yp/ypstop

To start ypserv on the slave server and run ypbind, type:


# /usr/lib/netsvc/yp/ypstart

Alternatively, you can reboot the slave server and daemons will be started automatically.