System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)

Adding a Slave Server

After NIS is running, you might need to create an NIS slave server that you did not include in the initial list given to ypinit.

To add a NIS slave server:

How to Add a Slave Server
  1. Log in to the master server as a superuser.

  2. Change to the NIS domain directory.

    # cd /var/yp/domainname

  3. Disassemble the ypservers file.

    # makedbm -u ypservers >/tmp/temp_file

    The makedbm command converts ypservers from ndbm format to a temporary ASCII file /tmp/temp_file.

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

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

  6. Verify that the ypservers map is correct (since there is no ASCII file for ypservers) by typing the following on the slave.

    slave3# makedbm -u ypservers

    The makedbm command displays each entry in ypservers on your screen.


    Note –

    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.


  7. Set up the new slave server's NIS domain directory by copying the NIS map set from the master server.

    To do this, become superuser on the new NIS slave and run the ypinit and ypbind commands.

    slave3# cd /var/yp

    slave3# ypinit -c list of servers

    slave3# /usr/lib/netsvc/yp/ypbind

  8. Initialize this machine as a slave.

    slave3# /usr/sbin/ypinit -s ypmaster

    where ypmaster is the machine name of the existing NIS master server.

  9. Run ypstop to stop the machine running as an NIS client.

    # /usr/lib/netsvc/yp/ypstop

  10. Run ypstart to start NIS slave service.

    # /usr/lib/netsvc/yp/ypstart