Setting up NIS

Setting up slave servers

Your network can have one or more NIS slave servers. Having slave servers ensures the continuity of NIS services in the event of the master server being down. Before actually running ypinit(1Mnis) to create the slave servers, take several precautions.

First, as you did with the master NIS server, you must check that every slave server's password database contains an entry for the daemon user name and that it precedes other entries with the same user ID.

Also, make sure that the network is working properly before you set up a slave NIS server. In particular, check that you can use rcp(1tcp) to send files from the master NIS server to NIS slaves. If you cannot, follow the procedures outlined in ``Administering Remote Procedure Calls (RPC)'' to permit the use of rcp.

Now you are ready to create a new slave server. Perform the following procedure:

  1. Log in to each slave server as NIS administrator.

  2. Create a directory named /var/yp/domainname, where domainname is the name of the domain of the master NIS server.

  3. Enter:

    /usr/sbin/ypinit -c

    ypinit prompts for the domain name for the slave server.

  4. Give the slave the same domain name as the domain name of the NIS master server.

    ypinit prompts for the name of the servers for the domain.

  5. Enter the names of the NIS servers in order of preference; that is, type first the names of the servers that are physically closest to the machine in the network. If the client is also a server, type its name first. This initializes the client and establishes its servers for binding.

  6. Enter:

    /usr/sbin/ypinit -s master

    where master is the host name of the existing NIS master server.

    Ideally, the named host is the master server, but it can be any host with a stable set of NIS maps, such as another slave server.

    ypinit will not prompt you for a list of other servers as it does when you create the master server, nor will it run ypbuild again. However, it will stop executing if you have not used ypinit -c to initialize the list of servers, and it lets you choose whether or not to halt at the first non-fatal error. ypinit then calls the program ypxfr(1Mnis), which transfers a copy of the master's NIS map set to the slave server's /var/yp/domainname directory.

  7. When ypinit terminates, make backup copies of the /etc/passwd and /etc/group files, and edit the original files by adding ``+:'' to the end so they refer to the NIS maps. This applies also to whatever non-default maps you may have added to the Makefile. For instance, if there is an auto.direct NIS map, the file /etc/auto.direct should also be copied to another file and the original should contain a line similar to:
    +auto.direct
    
    Thus, whenever the automounter reads this file, it will consult the NIS auto.direct map upon reaching this line.

    This step ensures that processes on the slave server also use the NIS services, rather than files in the local /etc directory. In this way, you ensure that the NIS slave server is also an NIS client.

Repeat this procedure for each machine you want configured as an NIS slave server.
© 1999 The Santa Cruz Operation, Inc. All rights reserved.
UnixWare 7 Release 7.1.1 - 5 November 1999