Pages

Monday, January 3, 2011

How to configure NIS slave server

You can use tips below to configure host as NIS slave server. You should have at least one NIS slave server as backup in case NIS master server become unavailable.

  1. Modify your /etc/inet/hosts file to include IP address – hostname of NIS master, all NIS slave servers and NIS clients.
  2. Set NIS domain on your host.
    # vi /etc/defaultdomain
    sun.com
    # domainname sun.com
  3. Initialize your system as NIS client. When system prompts for list of NIS servers, enter the name of NIS master server and all NIS slave servers.
    # ypinit -c
  4. Modify your /etc/nsswitch.conf to contain NIS. For instance, copy from /etc/nsswitch.nis file
    # cp /etc/nsswitch.nis /etc/nsswitch.conf
  5. Make sure ypserv process is running on NIS master server. If it is not running, run the NIS service on your NIS master server.
    # pgrep -fl ypserv
    # svcadm enable svc:/network/nis/server:default (optional if ypserv is not running)
    Note : Remember to work this step 5 in NIS master server, not on NIS slave server
  6. Return to your NIS slave server and start your NIS client service
    # svcadm enable svc:/network/nis/client:default
  7. Initialize your system as NIS slave servers that will refer to NIS master server. In this example your NIS master server hostname is jupiter. This command also pull and get all NIS map from NIS master server. So your NIS slave server maps is updated with the current NIS master server maps.
    # ypinit -s jupiter
  8. Stop your NIS client service
    # svcadm disable svc:/network/nis/client:default
  9. Start your NIS slave server service
    # svcadm enable svc:/network/nis/server:default
  10. Test your NIS client functionality. List NIS maps and NIS server for each map.
    # ypwhich -m

No comments:

Post a Comment