Maintaining Consistent System Information with NIS
NIS maintains consistent system information throughout the domain by designating one system, the master server, as the sole source of information. All the other hosts, whether they are worker servers or clients, obtain their system information from the master server.
Clients obtain their information on an as-needed basis. When a client needs a piece of system information, such as an entry from the /etc/passwd file, it sends a request to a server. If the information exists, the server responds with the information. Since the client obtains the information only as needed, the system information at the client remains consistent with the server.
Worker servers, on the other hand, obtain a complete copy of the maps periodically from the master server. To ensure that the system information is consistent at the worker servers, and therefore throughout the whole domain, make all updates to the maps at the master server. Then, propagate the new maps to the worker servers. To propagate a map means to copy it from the master server to all the worker servers. Propagation eliminates the need to update each map individually. In addition, propagation ensures that all copies of the database are exactly the same; therefore, any server can respond to a client's request.
After you update a map on the master server, there are three ways to propagate the new map:
- Maps propagate automatically every few minutes if the master server is running the ypupdated daemon.
- If you stop and restart NIS on the master server, all the maps propagate to the worker servers.
- If you enter the yppush command at the master server, the changes propagate. The yppush command notifies all worker servers that a map must be transferred. The ypserv daemon on each worker server runs the ypxfr command to get the updated map. A worker server that is out of service when you enter the yppush command retains the earlier version of the map when it returns to the network. To prevent such situations, use the cron daemon to set each worker server to request updated maps from the master server at regular intervals.