Configuring an NIS Worker Server
After configuring the master server (see Configuring the NIS Master Server), you must decide which hosts are to act as worker servers. Worker servers keep exact replicas of the master server's maps and share the processing burden by answering queries when the master server is busy or unavailable. The following procedure must be done for each worker server.
Prerequisites
The NIS master server is configured.
Procedure
To configure an NIS worker server, do the following tasks on the worker server host:
- If you are configuring a worker server that is not on the same IP network, you must configure
the new server as an NIS client first
(see Configuring an NIS Client). Create the file
/var/yp/binding/<domain_name>/ypservers to contain the NIS master to bind to. This file should just
contain the IP address of the NIS master. You can also use the ypset command to explicitly
point the new server to the NIS master. For example, you could use
ypset 129.23.22.1
, where129.23.22.1
is the IP address of the master server. - When using subnets, a worker server must be configured on each subnet that has NIS clients for the given NIS domain. This allows clients to bind at startup and provides a fall back if the master goes down for any reason.
- Follow the instructions in Preparing a Host for NIS Configuration.
- Set the domain name by following the instructions in Setting the NIS Domain Name.
You will now create the directory for this domain, start the NIS daemons, and obtain copies of the NIS maps from the master server. Use the Web-based System Manager or use one of the following procedures.
- Using SMIT:
- Enter the fast path: smit mkslave.
- Specify the hostname of the master server for this domain in the HOSTNAME of the master server field.
- Specify yes in the fields Can existing MAPS for the domain be overwritten? and Quit if errors are encountered? because you will want to know if an error occurs.
- Specify both in the START the slave server... field.
- Accept your changes and exit SMIT.
The system takes a few minutes to perform several tasks. First, it runs the ypinit command. If the ypinit command exits successfully, the system uncomments the entries in the /etc/rc.nfs file for the ypserv and ypbind daemons. Finally, the system starts these daemons.
The ypinit command is a shell script that performs two tasks. First, it creates the directory /var/yp/domainname, where domainname is the domain name you defined above. Second, it runs the ypxfr command to obtain the NIS maps from the master server.
Note: If this NIS worker server is not on same IP network as the NIS master server (that is, a gateway router is positioned between the worker server and the master server), you must explicitly identify the NIS master server by using the ypset command. For example, enter the command:
where 129.23.22.1 is the IP address of the NIS master server.ypset 129.23.22.1
- Using the command line:
- Start the ypbind daemon by following the instructions in Starting and Stopping NIS Daemons to bind to the master server.
- Enter the ypinit -s mastername command, where mastername is the host name of the master server. This command prompts you for various information and takes a few minutes to complete.
- Start the ypserv and ypbind daemons by following the instructions in Starting and Stopping NIS Daemons. Note: If this NIS worker server is not on same IP network as the NIS master server (that is, a gateway router is positioned between the worker server and the master server), you must explicitly identify the NIS master server by using the ypset command. For example, enter the command:
where 129.23.22.1 is the IP address of the NIS master server.ypset 129.23.22.1
- Edit the /etc/rc.nfs file and uncomment the lines that use the startsrc commands
to start these daemons. Delete the pound signs in the following example:
#if [ -x /usr/etc/ypserv -a -d /etc/yp/`domainname` ]; then # startsrc -s ypserv #fi
so it looks like:if [ -x /usr/etc/ypserv -a -d /etc/yp/`domainname` ]; then startsrc -s ypserv fi
+::::::