Business web site - Inside Linux Creating a Slave Server In this

Inside Linux Creating a Slave Server In this section, you will see what it takes to set up an NIS slave server. The one prerequisite is that you have the master server running before creating any slave servers. Initializing a slave server is as easy as setting up a master server. The ypinit command is executed to perform the setup. The difference between setting up a master and a slave is determined by the ypinit option used. To create a slave, the -s option is used and the master server is specified. To begin, you should be at the machine that will act as the slave server. If you have not named the server using the domainname command, you should do so now. Remember, to execute the command you simply provide the name as an argument to the command, as shown in the following sample dialog. You should be logged in as the root user to execute these commands. stimpy $ domainname slaveName stimpy $ Now that the name is set, it is time to execute the ypinit command. Remember, the master server must be running to execute the ypinit command for the slave. The following dialog demonstrates an attempt to create a slave server on the master, even after changing the name with the domainname command. stimpy $ /usr/lib/yp/ypinit -s admin The host specified should be a running master NIS server, not this machine. stimpy $ The following dialog demonstrates the use of ypinit for the slave server. stimpy $ /usr/lib/yp/ypinit -s ren stimpy $ One other thing - the master server named as the argument must be accessible from the slave server. The directory structure is created and the map files are built from the master server’s map files. Setting Up an NIS Client Using ypbind To enable an NIS client, you will have to have one or more servers running the NIS ypserv daemon. Be sure that an NIS server is running; otherwise, you run the risk of the client machine hanging. Setting up an NIS client is straightforward. The concept is that the client binds itself to a server using you guessed it - the ypbind command. ypbind [-broadcast | -ypset | -ypsetme] [-p port] [-f configfile] [-no-ping] [-broken-server] [-debug] ypbind -c [-f configfile] ypbind –version When ypbind starts up or receives the SIGHUP signal, it parses the /etc/yp.conf file. The ypbind command then attempts to use the entries found in the file for its binding. The ypbind command removes itself from the controlling terminal, as all good daemons do, and uses syslog() for logging errors and warnings. The ypbind process consists of a master process and a slave process. The master services RPC requests, asking for binding information. The slave process is used to initialize the bind, and it validates it periodically. If a failure occurs, the bind is invalidated and the process is retried. The ypbind command searches for a server on the NIS domain, and then stores that information in a binding file. The binding file usually resides in the /var/yp/binding directory. The name for the binding file is customarily [domainname[.[version]. It is possible to have several files because an NIS client can be bound to more than one domain. Table 11.5 describes the options for the ypbind command. Please note that the ypbind command in some Linux distributions does not support all options listed. For some versions of ypbind, after a bind has been established, ypbind will transmit YPPROC_DOMAIN requests to the NIS server at 20-second intervals. If ypbind does not get a response (or the server responds that it does not have this domain any longer), ypbind will seek out a new NIS server. If ypbind finds a server that responds faster, ypbind switches to the faster server. You can tell ypbind to use network broadcasts to find a new server. This is an insecure method. Rather, you should give ypbind a list of known, secure servers. In this case, ypbind sends a ping to all servers and binds to the first one that answers. page 205
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.

Leave a Reply