[ Pobierz całość w formacie PDF ]
.conf22 2496 Ch19 8/30/00 1:23 PM Page 489PLANNING YOUR NIS DOMAIN 4892.Edit the /etc/hosts file to add the name and IP address of each of the NIS servers.3.To build new maps on the master server, type/usr/sbin/ypinit -mypinit prompts you for a list of other systems to become NIS slave servers.Type thename of the server you are working on, along with the names of your NIS slaveservers.Enter the server name, and then press Enter.Do this for each server.Entereach server on a separate line.Press Ctrl+D when you re finished.4.ypinit asks whether you want the procedure to terminate at the first nonfatal error orto continue despite nonfatal errors.Type y.If you choose y, ypinit exits upon encountering the first problem; you can then fix itand restart ypinit.This procedure is recommended if you are running ypinit for thefirst time.If you prefer to continue, you can manually try to fix all the problems thatmight occur and then restart ypinit.NOTE.A nonfatal error might be displayed if some of the map files are not present.These errors do not affect the functionality of NIS.5.ypinit asks whether the existing files in the /var/yp/ directory can bedestroyed.This message is displayed only if NIS was previously installed.You must answer Yesto install the new version of NIS.6.After ypinit has constructed the list of servers, it invokes make.The make command uses the instructions contained in the makefile located in /var/yp.It cleans any remaining comment lines from the files you designated and then runsmakedbm on them, creating the appropriate maps and establishing the name of themaster server for each map.7.To enable NIS as the naming service, typecp /etc/nsswitch.nis /etc/nsswitch.confThis command replaces the current switch file with the default NIS-oriented one.Youcan edit this file as necessary.See the section Name Service Switch for informationon the contents of this file.Now that the master maps are created, you can start the NIS daemons on the master server.22 2496 Ch19 8/30/00 1:23 PM Page 490490 CHAPTER 19 NAME SERVICESStarting and Stopping NIS on the Master ServerTo start up the NIS service on the master server, you need to start ypserv on the server andrun ypbind.The daemon ypserv answers information requests from clients after lookingthem up in the NIS maps.You can start up the NIS service on the server by running the/usr/lib/netsvc/yp/ypstart script from the command line.After you configure the NIS masterserver by running ypinit, ypstart is automatically invoked to start up ypserv whenever thesystem is started up.To stop the NIS service, run the ypstop command on the server as follows:usr/lib/netsvc/yp/ypstopName Service SwitchThe next step in setting up the NIS service is to set up the name service switch, whichinvolves editing the /etc/nsswitch.conf file.The name service switch controls how a clientworkstation or application obtains network information.The name service switch is oftensimply referred to as the switch.The switch determines which naming services an applica-tion uses to obtain naming information, and in what order.It is a file called nsswitch.conf,which is stored in each system s /etc directory.Each workstation has a nsswitch.conf file in its /etc directory.In every system s /etc direc-tory, you find a template file called /etc/nsswitch.nis that was installed when you loadedSolaris 7.This template file contains the default switch configurations used by the NIS serv-ice and local files.When the Solaris 7 release software is first installed, if you designateNIS as the default name service, the template file is copied to /etc/nsswitch.conf.If duringsoftware installation you select files as the default name service, /etc/nsswitch.conf iscreated from nsswitch.files, which looks like this:## /etc/nsswitch.files:## An example file that could be copied over to /etc/nsswitch.conf; it# does not use any naming service.## hosts: and services: in this file are used only if the# /etc/netconfig file has a - for nametoaddr_libs of inet transports.passwd: filesgroup: fileshosts: filesnetworks: filesprotocols: filesrpc: filesethers: filesnetmasks: filesbootparams: filespublickey: files22 2496 Ch19 8/30/00 1:23 PM Page 491PLANNING YOUR NIS DOMAIN 491# At present there isn t a files backend for netgroup; the system will# figure it out pretty quickly, and won t use netgroups at all.netgroup: filesautomount: filesaliases: filesservices: filessendmailvars: filesIf you did not select NIS as your name service during software installation, you can movethis file into place manually as follows:cp /etc/nsswitch.nis /etc/nsswitch.confThe default /etc/nsswitch.nis file looks like this:## /etc/nsswitch.nis:## An example file that could be copied over to /etc/nsswitch.conf; it# uses NIS (YP) in conjunction with files
[ Pobierz całość w formacie PDF ]