Online Book Reader

Home Category

Managing NFS and NIS, 2nd Edition - Mike Eisler [195]

By Root 511 0
continue to add the names for YP servers in order of

preference, one per line. When you are done with the list, type a

or a return on a line by itself.

next host to add: onaga

next host to add: mahimahi

next host to add: 131.40.52.126

next host to add: ^D

The current list of yp servers looks like this:

onaga

mahimahi

131.40.52.126

Is this correct? [y/n: y] y

Make sure to include the necessary hostname to IP address mappings in /etc/inet/ipnodes or /etc/inet/hosts before running the ypinit command, otherwise ypinit will fail. The resulting ypservers file:

% cat ypservers

onaga

mahimahi

131.40.52.126

Note that it is not necessary to preconfigure an initial list of NIS servers, since ypbind will broadcast a request on the network to find the available servers if the initial list does not exist. ypbind is started by /usr/lib/netsvc/yp/ypstart which in turn is invoked by the /etc/init.d/rpc startup script:

Excerpt from /usr/lib/netsvc/yp/ypstart:

if [ -d /var/yp/binding/$domain -a -f /var/yp/binding/$domain/ypservers ]; then

/usr/lib/netsvc/yp/ypbind > /dev/null 2>&1

echo " ypbind\c"

elif [ -d /var/yp/binding/$domain ]; then

/usr/lib/netsvc/yp/ypbind -broadcast > /dev/null 2>&1

echo " ypbind\c"

fi

The next section will explain in more detail when and why you may want to bind to specific NIS servers, and how you can modify the binding once ypbind has been started.

Modifying client bindings

The ypset utility forcefully changes the server binding. It is mostly used to dissect tangles of intertwined NIS servers and to point a client at a server that is not hearing its broadcasts. The normal NIS server search is conducted by ypbind through a broadcast request. The first server answering the request is bound to the domain, and is probably the most lightly loaded or closest server to the requesting host. As shown in the previous rpcinfo examples, a server's response time, relative to other NIS servers, varies over time as its load fluctuates.

If the server's load increases so that NIS requests are not serviced before the RPC call times out on the client machine, then the client's ypbind daemon dissolves the current binding and rebroadcasts a request for NIS service. With varying server loads and local network traffic conditions, the timeout/rebroadcast system effects a dynamic load balancing scheme between NIS clients and servers.

Neither ypset nor ypinit should be used to implement a static load balancing scheme for two reasons:

The initial ypinit or ypset may implement your chosen server allocation, but poor response time from this server causes the client to break the binding and perform a broadcast-based search. This dynamic rebinding will undo the attempts to effect a preferred binding.

Extreme disparity in NIS server usage is indicative of other network problems or of excessive server loading imposed by NFS service, interactive use, or print spooling.

There are four valid uses of ypinit and ypset:

Point a client at an NIS server that is isolated from it by a router or gateway that does not forward broadcast packets.

Test the services provided by a particular server, if you have recently installed or rebuilt the maps on that server.

Force servers to rebind to themselves instead of cross-binding.

Point a client to use a known and trusted server for security reasons, instead of using any NIS server on the network.

Again, ypinit is used to set the initial static binding at boot time, ypset is used to change this binding after boot time. It is recommended to use an IP address as the argument to ypset to avoid using the very same NIS service that ypbind is having trouble starting.

# ypset 131.40.52.28

# ypwhich

mahimahi

Alternatively, you can verify that the /etc/inet/ipnodes or /etc/inet/hosts file lists the IP address for the new NIS server, and that /etc/nsswitch.conf is configured to use files before it uses NIS.

In some NIS implementations (Solaris and others), ypbind no longer allows ypset to change its binding unless this functionality is explicitly enabled.

Return Main Page Previous Page Next Page

®Online Book Reader