In this section, we will walk through a configuration session with NIS+, focusing on using a script-based installation, which makes using NIS+ much easier. The main tasks involved in setting up NIS+ involve domain, master server, slave server, and user configuration. These tasks can only be performed once a network has been designed along the lines discussed in previous sections.
Whether or not you are setting up a root or a nonroot domain, the basic process is the same: after initializing a master server and creating the appropriate administrative groups, the NIS+ tables are populated, and clients and servers can then be installed. In the case of a root domain, these servers can then act as master servers for lower-level domains. In this section, we review the process of setting up a master server, populating the NIS+ tables, configuring clients and servers, and setting up other domains.
The first step in creating an NIS+ namespace is to create the root master server for the new domain. Continuing with the example for the Panther.Edu. domain, we create the root master server for Panther.Edu by using the nisserver command. The server will be known in DNS as ns.panther.edu. This command is used for most server configuration operations. In this case, we use the following command:
ns.panther.edu# nisserver –r –d Panther.Edu.
This creates a root domain master server without backward compatibility with NIS. In order to enable NIS support, you need to use this command:
ns.panther.edu# nisserver –Y –r –d Panther.Edu.
After creating the master root server for the Panther.Edu. domain on ns.panther.edu, the next step is to populate the NIS+ tables. To achieve this, we need to use the nispopulate command:
ns.panther.edu# nispopulate –F –p /nis+files –d Panther.Edu.
This populates all the tables for the Panther.Edu. domain and stores the information on the master server. Again, if you need to support NIS, you need to include the -Y option:
ns.panther.edu# nispopulate –Y –F –p /nis+files –d Panther.Edu.
In order to administer the NIS+ namespace, we need to add administrators to the admin group. We can achieve this by using the nisgrpadmin command. In the Panther.Edu. example, imagine we have two administrators, michael and adonis. In order to add these administrators, use the following command:
ns.panther.edu# nisgrpadm –a admin.Panther.Edu. michael.Panther.Edu. adonis.Panther.Edu.
If you are satisfied with the configuration, it is best to checkpoint the configuration and transfer the domain configuration information to disk copies of the tables. This can be achieved by using the nisping command:
ns.panther.edu# nisping –C Panther.Edu.
Now that we have successfully created the root domain, we can create clients that will act as master and slave servers for the two subdomains in the Panther.Edu. root domain: Graduate.Panther.Edu. and Undergrad.Panther.Edu.
To create master servers for the nonroot domain Undergrad.Panther.Edu., we first need to set up the client within a domain by using the nisclient command. For the host client1.panther.edu, which will become the master server for the nonroot domain, the command is
client1.panther.edu# nisclient –i –d Panther.Edu. –h Ns.Panther.Edu
In order to actually set up clients within the domain, we can use also use the command nisclient, when executed from a nonprivileged user’s shell:
client1.panther.edu% nisclient –u
If this was for the user maya, maya would now be able to access the namespace. Next, we need to turn the client host we have initialized into a nonroot domain master server.
After the root server is created, most organizations will want to create new master servers for each of the subdomains that form the domain. For example, in the Panther.Edu. domain, there are two subdomains (Undergrad.Panther.Edu. and Graduate.Panther.Edu.). In this case, two clients must be created from the root master server and then converted to be servers. Initially, these are root server replicas, but their designation then changes to a nonroot master server for each of the subdomains. Replica servers for the subdomain master servers can also be enabled.
In the following example, we designate two client machines whose DNS names are client1.panther.edu and client2.panther.edu (recall that the master server for the root domain is ns.panther.edu). These two clients will actually become the master and slave servers for the subdomain Undergrad.Panther.Edu. To begin the server creation process, a similar approach is followed for the root domain as for the creation of the master server. First, we need to start the rpc daemon on the client machine that will become the master server for the nonroot domain:
Next, we need to convert the client1 server to a root replica server in the first instance. This ensures that the subdomain inherits the appropriate settings from the top-level domain:
ns.panther.edu# nisserver –R –d Panther.Edu. –h client1.panther.edu
After replicating the settings from the root master server, the new nonroot master server is ready to begin serving the new subdomain. In this case, the root master server (ns.panther.edu) must delegate this authority explicitly to the master of Undergrad.Panther.Edu., which is client1.panther.edu:
ns.panther.edu# nisserver –M –d Undergrad.Panther.Edu. –h client1.panther.edu
Following the same routine we outlined for the root master server, we must now populate the tables of the new subdomain server client1.panther.edu:
client1.panther.edu# nispopulate –F –p /nis+files –d Undergrad.Panther.Edu.
Finally, having created a new master server for the new subdomain, we have to create a replica server to ensure service reliability in the event of failure:
client1.panther.edu# nisclient –R –d Undergrad.Panther.Edu. –h client2.panther.edu
The process of installing a server for the Undergrad.Panther.Edu. subdomain would need to be adapted to create the other subdomain (Graduate.Panther.Edu.), but the general process of setting up a client, converting it to a replicate server, and populating the tables would be very similar to this domain. Now that we have investigated how to create subdomains, the next section covers the day-to-day usage of NIS+, and the most commonly used commands that access tables, groups, and objects in the namespace.