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

Exit Print View

Updated: July 2014
 
 

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

  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:

    172.16.0.1	master.example.com master
    172.16.0.2	slave1.example.com slave1
    172.16.0.3	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
      # svcadm restart network/nis/client
    2. If the client services are not running, start the client services.
      # svcadm enable network/nis/domain
      # svcadm enable network/nis/client
  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
    2. If the master NIS server is not running, start the service.
      # svcadm enable network/nis/server
  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.