Go to main content

Working With Oracle® Solaris 11.3 Directory and Naming Services: DNS and NIS

Exit Print View

Updated: October 2017

How to Set Up a Slave Server

The following procedure explains how to set up a slave server. Repeat this procedure for each machine you want configured as an NIS slave server.

  1. Become an administrator.

    For more information about obtaining the appropriate rights to perform specific tasks, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.3.

  2. Edit the /etc/inet/hosts file.

    Add the name and IP address of each of the other NIS servers. Use the following format: IPaddress FQDN-hostname aliases.

    For example:	master.example.com master	slave1.example.com slave1	slave2.example.com slave2
  3. 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 obtain the NIS maps from the master server for the first time. See Administering NIS Clients for details. After a NIS master map is changed, use the yppush command to propagate the new map to the NIS slave server. For information about propagating an NIS map, see Updating and Modifying Existing Maps.
  4. Initialize the slave server as an NIS client.
    # /usr/sbin/ypinit -c

    The ypinit command prompts you for a list of NIS servers. Type the name of the local slave you are working on first, then type the name of the master server, followed by names of the other NIS slave servers in your domain. For the other slave servers, follow the order from the physically closest to the furthest in network terms.

  5. Determine if the client services are running, then start or restart the services as needed.
    # svcs \*nis\*
    STATE          STIME     FMRI
    online         20:32:56  svc:/network/nis/domain:default
    online         20:32:56  svc:/network/nis/client:default

    If the services are displayed with an online state, then NIS is running. If the service state is disabled, then NIS is not running.

    1. If the client services are running, restart the client services.
      # svcadm restart network/nis/domain:default
      # svcadm restart network/nis/client:default
    2. If the client services are not running, start the client services.
      # svcadm enable network/nis/domain:default
      # svcadm enable network/nis/client:default
  6. Determine if the NIS master server is running, then start or restart the service as needed.
    # svcs network/nis/server
    STATE          STIME     FMRI
    offline        20:32:56  svc:/network/nis/server:default
    1. If the master NIS server is running, restart the service.
      # svcadm restart network/nis/server:default
    2. If the master NIS server is not running, start the service.
      # svcadm enable network/nis/server:default
  7. Initialize this machine as a slave server.
    # /usr/sbin/ypinit –s master

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