The Server Map

Team-Fly    

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


When we initialized a master server or client, we were prompted to enter our list of servers. This information is used to generate another NIS map, named ypservers, which we can view using ypcat or makedbm, just as we would with any other map.

It's actually quite common updating this map. For example, many sites prefer to order the list of servers by their location and so they need to edit the map on a regular basis as servers are relocated.

Unfortunately, there are only two ways to do this. The first is using ypinit when a machine is initialized as we saw earlier. The second is to perform the updates manually.

Here, we'll look at the steps that need to be followed should you decide to do the latter. First we'll take a look at the entries that may be already in there:

 tin# ypcat -k ypservers tin fluorine iodine tin# 

To edit the map we first need to convert it to a temporary ASCII file:

 tin# cd /var/yp/nis.solarisbootcamp.com tin# makedbm -u ./ypservers > /tmp/newServers tin# 

Now we can edit the file to add or remove any servers as required:

 tin# cat /tmp/newServers YP_LAST_MODIFIED 0996667575 YP_MASTER_NAME tin tin fluorine iodine new_server_to_add tin# 

We've added a new server (called "new_server_to_add") to the end of the file. When everything is correct we can rebuild the map:

 tin# makedbm /tmp/newServers ypservers tin# 

Lastly, we can check the file to make sure everything is OK:

 tin# ypcat -k ypservers tin fluorine iodine new_server_to_add tin# 

    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