OPS 535 * Open System Clustering - Advanced Network Administration


top

Overview

NIS (Network Information System) uses a centeralize management concept to distribute  the network configuration information to all the systems which are part of the network. NIS converts the common plain text configuration files (e.g. /etc/passwd, /etc/groups, /etc/hosts, /etc/services, etc) into database files called maps. These database files are maintained on a central server, called the master server, this eliminates the need to manage those files on each individual host on the network.

NIS was developed by Sun Microsystems to address the difficulties in maintaining the consistency of the separate copies of configuration files on each system on a large network.

NIS uses a client-server RPC model. The NIS master server stores all the NIS maps files. NIS clients request configuration information the server gets from these maps. There are two types of NIS servers: master and slave. The NIS master server is responsible for maintaining the maps and distributing them to the slave servers.

NIS is divided into groups called NIS domains. An NIS domain consists of all systems that share a single set of NIS maps. A NIS domain has its own uniqe name, one master server, one or more clients, and optionally, one or more slave servers.

Originally, NIS was called Yellow Page, or YP. However, Sun was forced to drop the name due to trademark issue with British Telecom, who is the owner of the "Yellow Page" trademark name. You will notice that many of the key programms associated with NIS have kept their original name beginning with yp.

top

Objectives


top

Reference


top

Pre-Lab Arrangement

  1. Boot up your virtula network and verify that your VMs are using the correct assigned IP and proper network settings.
  2. Configure your VM3 as the NIS server (192.168.x.3)
  3. Create three new user accounts using your learn account with the prefix "nis" and ended with the digits "1", "2" and "3" on your NIS server. For example, if your learn account is "jsmith", the three new account names should be nisjsmith1, nisjsmith2, and nisjsmith3.
In this lab, you will perform the following tasks:
  1. Create three new user accounts on your NIS server
  2. Gether and record the versions of all the NIS related rpm packages
  3. Set the NIS domain name
  4. Start and Stop the NIS server
  5. Configure the NIS master server
  6. Configure the NIS client on your NIS server and other VMs, and resolve NIS related problems
  7. Add new NIS (network) users and Update NIS maps
top

Lab Procedure

  1. Create three new user accounts on your NIS server
    • Use the useradd command to create three new user accounts using your learn account name with the prefix "nis" and ended with the digit "1", "2" and "3".
    • Use the passwd command to set the login password for the new accounts
    • Test the new logins.
  2. Gether and record the versions of NIS rmp packages, and find out the man pages included with each package.
    • Enter the command "rpm -qa | grep ^yp"
    • Record the version of yp-tools, ybbind and ypserv
    • Enter the command "rpm -ql yp-tools" to list the programs, files, man pages.
    • Enter the command "rpm -ql ypbind" to list the programs, files and man pages.
    • Enter the command "rpm -ql ypserv" to list the programs, files and man pages.
  3. Set your NIS domain name on your NIS server
    • Enter the command "domainname nis.pc[x].com" to set your NIS domain name. Please replace [x] with your assigned network id x.
  4. Start and Stop NIS Server
      Before you run the NIS server's startup script, you should check and make sure that "portmapper" is running on your system.
    • Enter the command "rpcinfo -p" to verify that portmapper is up and running.
    • Make notes of the program IDs, version numbers, and the ports used by each RPC program from the output of the above command.
    • Enter the command "service ypserv start" to start the NIS server.
    • Enter the command "rpcinfo -p" to view the RPC program registry and make notes of the program ID, version numbers, and the ports used by the "ypserv" program.
    • Enter the command "service ypserv stop" to stop the NIS server.
    • Enter the command "rcpinfo -p" again to check the RPC program registry and note the difference.
  5. Configure the NIS (master) server
    • Backup the file "/var/yp/Makefile" to "/var/yp/Makefile.org"
    • Study the file "/var/yp/Makefile" and locate the following information:
      • the value of MINUID and its meaning
      • the value of MINGID and its meaning
    • Edit the file "/var/yp/Makefile" with the following changes:
      • Comment out the line starts with the word "all" and insert the following line before the line that you commented out:
        all: passwd group hosts services                
    • Start the NIS server program (note: NIS server program must be running in order to create NIS maps)
    • Initialize the NIS database (map files) with the "/usr/lib/yp/ypinit" command (use "/usr/lib64/yp/ypinit" on 64-bit system)
      • /usr/lib/yp/ypinit -m

        At this point, we have to construct a list of the hosts which will run NIS
        servers. localhost.localdomain is in the list of NIS server hosts. Please continue to add
        the names for the other hosts, one per line. When you are done with the
        list, type ctrl+D.
        next host to add: localhost.localdomain
        next host to add: l
        The current list of NIS servers looks like this:

        localhost.localdomain

        Is this correct? [y/n: y] y
        We need a few minutes to build the databases...
        Building /var/yp/nis.ops535.com/ypservers...
        Running /var/yp/Makefile...
        gmake[1]: Entering directory `/var/yp/nis.ops535.com'
        Updating passwd.byname...
        Updating passwd.byuid...
        Updating group.byname...
        Updating group.bygid...
        Updating hosts.byname...
        Updating hosts.byaddr...
        Updating services.byname...
        Updating services.byservicename...
        gmake[1]: Leaving directory `/var/yp/nis.ops535.com'

        localhost.localdomain has been set up as a NIS master server.

        Now you can run ypinit -s localhost.localdomain on all slave server.
    • If your "ypinit" command encounters any problems, you should check your Makefile and make sure that the NIS server program is running on your system. Please note that the "\" at the end of a line in the Makefile is used to indicate line continuation.
    • Study the output of a successfully "ypinit -m" command. It contains important information about what maps were generated, and the location of those maps.
  6. Configure the NIS clients (first on the NIS server, and then on another VM) and troubleshooting NIS problems
    • Verify that you have the correct NIS domain name with the "domainname" command
    • backup the file "/etc/yp.conf" to "/etc/yp.conf.org"
    • Add the following line to the bottom of the file "/etc/yp.conf"
      • domain nis.pc[x].com server localhost
    • Verify that "portmapper" and "ypserv" are running on your system (how?)
    • Start the NIS client with the command "service ypbind start"
    • Enter the command "rpcinfo -p" to view the RPC program registry to verify that the NIS client program "ypbind" has registered with the portmapper.
    • Make notes of the program ID, version number(s), and port(s) used by the "ypbind" program.
    • Now you have NIS server and NIS client running on the same machine - your machine
    • Enter the command "ypcat -x" to query the NIS server what NIS maps are available.
    • Enter the command "ypcat passwd" to query the NIS server for user login information. Are the three new users your created at the beginning of lab there?
    • Compare the output from the command "ypcat passwd" and your host's user login information file "/etc/passwd"
    • Use the command "ypcat" to query the NIS server for groups, hosts, and services. Compare the outputs with the contents of  files "/etc/groups", "/etc/hosts" and "/etc/services" on your system.
    • Login to another VM and configure the NIS client:
      • modify the line you added to the file "/etc/yp.conf" and replace the last word "localhost" with the IP address of your NIS server
      • start the NIS client
      • the NIS client "ypbind" should now bind to your NIS server
      • enter the command "ypcat passwd" to query the NIS server. Are the three new users you created at the beginning of the lab there?
  7. Add new NIS users and Update NIS maps
    • On your NIS server, add two new user accounts: nis101 and nis102. Don't forget to assign login passwords for these two new account. 
    • Enter the command "ypcat passwd" on your NIS server and also on your other VM which is running NIS client. Are the two new users there? 
    • On your NIS server, change the working directory to "/var/yp" and enter the command "make". Make note of the output. Could you guess what does this command do? 
    • Repeat the command "ypcat passwd" on your NIS server and the other VM. Are the two new users account appear on the output?
    • Add all the IP address / Host name pair of your VMs into the /etc/hosts file on your NIS server, run the command to update the map file(s). Make note of the output of the "make" command.
    • Use the "ypcat" command to verify that the map file for the hostname resolution has been updated correctly
  8. Research
top

Questions

  1. What is your name?
  2. What is your Seneca Student ID?
  3. What is your network number?
  4. How long did it take to complete this lab?
  5. What is the host name of your machine (vm)?
  6. What is the IP address(es) of your machine (vm)?
  7. What version of NIS software are installed on your machine?
  8. What is the program ID of the RPC NIS server program?
  9. What is the program ID of the RPC NIS client program?
  10. What is your NIS domain name?
  11. Whate is the NIS database files (NIS maps) located? Give its full pathname.
  12. What was nis101's login directory on your NIS server?
  13. What was nis101's login directory on your NIS client system?
  14. What is the function of the ypcat command?
  15. What is the function of the ypinit command?
  16. What is the function of the ypwhich command?
  17. What is the function of the ypmatch command?
  18. What is the function of the yppasswd command?
  19. How often should you update the NIS maps?
  20. What are the steps to bring all the NIS maps up to date?

Completing the Lab

Answer the questions above and save the questions and aswers to a plain text file and name the file as "lab4.[student_id].txt" extension. Upload your answer file to MySeneca before the lab's due date.