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 Add a New 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 the ypinit command. Use this procedure to add a new NIS slave server.

  1. Become an administrator on the NIS master server.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.3.

  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.

    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

    The makedbm command then converts ypservers back into ndbm format.

  6. Verify that the ypservers map is correct.

    Because there is no ASCII file for ypservers, type the following on the slave server:

    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. Become an administrator on the new NIS slave server.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.3.

  8. Verify that the NIS domain name is set.
    # domainname
    example.com
  9. Set up the new slave server's NIS domain directory.

    Copy the NIS map set from the master server, then start the NIS client. When running the ypinit command, follow the prompts and list the NIS servers in order of preference.

    slave3# cd /var/yp
    slave3# ypinit -c
  10. Initialize this machine as a slave.
    slave3# /usr/sbin/ypinit –s ypmaster

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

  11. Stop the machine running as an NIS client.
    slave3# svcadm disable network/nis/client
  12. 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
  13. Determine if the NIS 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 NIS server is running, restart the service.
      slave3# svcadm restart network/nis/server:default
    2. If the NIS server is not running, start the service.
      slave3# svcadm enable network/nis/server:default