Map Propagation

Team-Fly    

Solaris™ Operating Environment Boot Camp
By David Rhodes, Dominic Butler
Table of Contents
Chapter 12.  Naming Services and NIS


When any changes occur to the maps, the master needs to distribute the new copies to the slaves. It actually transfers the files using the NIS transport itself, as we saw earlier when we built the slaves (these were the "Transferring <map name>" messages).

There are two commands used to propagate the maps around the servers: ypxfr and yppush.

Ypxfr

This runs on the slave and communicates with the ypxfrd running on the master to request the download of an individual map. For example, to update the hosts file from the master we could run the following command:

 fluorine# /usr/lib/netsvc/yp/ypxfr hosts.byname flourine# 

It's possible that sometimes the slave maps may not get updated for some reason; maybe the slave server was down at the time, or the transfer simply failed to complete. To ensure they remain up-to-date, ypxfr can be called on a regular basis using cron. In fact, a few scripts are provided with NIS for just this reason. They are located in /usr/lib/netsvc/yp and are listed below:

 fluorine# cd /usr/lib/netsvc/yp fluorine# ls ypxfr_* ypxfr_1perday    ypxfr_1perhour    ypxfr_2perday flourine# 

These can be edited to suit each site, but they should give you a start for the type of things you can place in each file. The scripts are named according to their recommended update times (i.e. "once per day," "once per hour," and "twice per day"), but obviously these can also be altered to suit depending on the update frequencies found at your site. For now, we'll stick to using these and add the following entries to roots crontab across all the slaves:

 fluorine# crontab -l <lines removed for clarity> # # entries to populate the NIS maps # 00 23 * * * /usr/lib/netsvc/yp/ypxfr_1perday 00 12,23 * * * /usr/lib/netsvc/yp/ypxfr_2perday 15 * * * * /usr/lib/netsvc/yp/ypxfr_1perhour flourine# 

Yppush

This is called from the makefile and so is run every time we rebuild the maps using make. It is the program that issues the transfer request command to the slaves, which then run ypxfr to download the updated maps.


    Team-Fly    
    Top
     



    Solaris Operating Environment Boot Camp
    Solaris Operating Environment Boot Camp
    ISBN: 0130342874
    EAN: 2147483647
    Year: 2002
    Pages: 301

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net