Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
4.  Configuring NIS+ With Scripts Setting Up NIS+ Servers Prerequisites to Running rpc.nisd  Previous   Contents   Next 
   
 

Information You Need

You need the superuser password of the client that you will convert into a server.

Configuring a Client as an NIS+ Server

Perform any of the following to alternate procedures to configure a client as a server. These procedures create a directory with the same name as the server and create the server's initialization files which are placed in /var/nis.


Note - All servers in the same domain must have the same NIS-compatibility setting. For example, if the master server is NIS compatible, then its replicas should also be NIS compatible.


How to Configure a Server Without NIS Compatibility

  1. To configure a server without NIS compatibility, enter the following command:

    client1# rpc.nisd

How to Configure a Server With NIS Compatibility

  1. Edit the /etc/init.d/rpc file on the server to uncomment the whole line containing the string -EMULYP="-Y".

    To do this, remove the # character from the beginning of the line.

  2. Type the following as superuser.

    client1# rpc.nisd -Y

How to Configure a Server With DNS and NIS Compatibility

This procedure configures an NIS+ server with both DNS forwarding and NIS+ compatibility. Both of these features are needed to support SunOS 4.x clients.

  1. Edit the /etc/init.d/rpc file on the server to uncomment the whole line containing the string EMULYP="-Y".

    To do this, remove the # character from the beginning of the line.

  2. Add -B to the above line inside the quotes.

    The line should read:

    -EMULYP="-Y -B"

  3. Type the following command as superuser.

    client1# rpc.nisd -Y -B

    Now this server is ready to be designated a master or replica of a domain.

Creating Additional Servers

Repeat the preceding client-to-server conversion procedure on as many client machines as you like.

The sample NIS+ domain described in this chapter assumes that you will convert three clients to servers. You will then configure one of the servers as a root replica, another as a master of a new subdomain, and the third as a replica of the master of the new subdomain.

Creating a Root Replica Server

To have regularly available NIS+ service, you should always create one or more root replica servers. Having replicas can also speed network-request resolution because multiple servers are available to handle requests.

For performance reasons, you should have no more than a few replicas per domain. If your network includes multiple subnets or different sites connected by a Wide Area Network (WAN), you may need additional replicas:

  • Subnets. If you have a domain that spans multiple subnets, it is a good idea to have at least one replica server within each subnet so that if the connection between nets is temporarily out of service, each subnet can continue to function until the connection is restored.

  • Remote sites. If you have a domain spanning multiple sites linked over a WAN, it is a good idea to have at least one replica server on each side of the WAN link. For example, it may make sense from an organizational point of view to have two physically distant sites in the same NIS+ domain. If the domain's master server and all of its replicas are at the first site, there will be much NIS+ network traffic between the first and second sites. Creating an additional replica at the second site should reduce network traffic.

See "Creating a Root Replica Server" for additional information on how to determine the optimum number of replicas.

"How to Create a Root Replica" shows the machine client1 being configured as a root replica for the doc.com. domain. This procedure uses the NIS+ nisserver script. (You can also use the NIS+ command set to configure a replica server as described in "Using NIS+ Commands to Configure a Replica Server".)

Prerequisites to Running nisserver

Before you can run nisserver to create a replica:

  • The domain must already have been configured and its master server must be running.

  • The tables of the master server must be populated. (At a minimum, the hosts table must have an entry for the new client machine.)

  • You must have initialized the new server as a client machine in the domain, as described in "Setting Up NIS+ Client Machines".

  • You must have started rpc.nisd on the new replica server, as described in "Setting Up NIS+ Servers".

  • You must be logged in as root on the root master server. In this example, the root master machine is named master1.

Information You Need

You need:

  • The domain name

  • The client machine name; (client1, in this example)

  • The superuser password for the root master server

How to Create a Root Replica

  1. To create a root replica, type the following command as superuser (root) on the NIS+ domain's root master server.

    master1# nisserver -R -d doc.com. -h client1
    This script sets up a NIS+ replica server for domain doc.com.
    Domain name: :doc.com.
    NIS+ server	: :client1
    Is this information correct? (type 'y' to accept, 'n' to change)

    The -R option indicates that a replica should be configured. The -d option specifies the NIS+ domain name (doc.com., in this example). The -h option specifies the client machine (client1, in this example) that will become the root replica.

  2. Type y to continue.

    Typing n causes the script to prompt you for the correct information. (See "How to Change Incorrect Information" for what you need to do if you type n.)

    Is this information correct? (type 'y' to accept, 'n' to change) 
    y
    This script will set up machine "client1" as an NIS+ replica server for domain 
    doc.com. without NIS compatibility. The NIS+ server daemon, rpc.nisd, must 
    be running on client1 with the proper options to serve this domain. 
    Do you want to continue? (type 'y' to continue, 'n' to exit this script)
  3. Type y to continue.

    Typing n safely stops the script. The script will exit on its own if rpc.nisd is not running on the client machine.

    Is this information correct? (type 'y' to continue, 'n' to exit this script)
    y
    The system client1 is now configured as a replica server for domain doc.com..
    The NIS+ server daemon, rpc.nisd, must be running on client1 with the proper 
    options to serve this domain. If you want to run this replica in NIS (YP) 
    compatibility mode, edit the /etc/init.d/rpc file on the replica server '
    to uncomment the line which sets EMULYP to "-Y". This will ensure that 
    rpc.nisd will boot in NIS-compatibility mode. Then, restart rpc.nisd with 
    the "-Y" option. These actions should be taken after this script completes.

    Note - The above notice refers to an optional step. You need to modify only the /etc/init.d/rpc file if you want the root replica to be NIS compatible and it is not now NIS compatible. That is, the file needs modification only if you want the root replica to fulfill NIS client requests and it was not already configured as an NIS-compatible server. See "Configuring a Client as an NIS+ Server" for more information on creating NIS-compatible servers.


  4. [Optional] Configure the replica to run in NIS (YP) compatibility mode.

    If you want this replica to run in NIS compatibility mode, follow these steps:

    1. Kill rpc.nisd

    2. Edit the server's /etc/init.d/rpc file to uncomment the line that sets EMULYP to -Y.

      In other words, delete the # character from the start of the EMULYP line.

    3. Restart rpc.nisd.

  5. Load your namespace data on to the new replica server.

    You can do this in two ways:

    • The preferred method of loading data on to a new replica server is to use the NIS+ backup and restore capabilities to back up the master server, then "restore" that data on to the new replica server. This step is described in detail in "How to Load Namespace Data--nisrestore Method".

    • Run nisping. Running nisping initiates a full resynch of all NIS+ data from the master server to this new replica. If your namespace is large, this can take a long time, during which your master server is very busy and slow to respond and your new replica is unable to answer NIS+ requests. This step is described in detail in "How to Load Namespace Data--nisping Method".

    When you have finished loading your namespace data, the machine client1 is now an NIS+ root replica. The new root replica can handle requests from the clients of the root domain. Because there are now two servers available to the domain, information requests can be fulfilled faster.

    Using these procedures, you can create as many root replicas as you need. You can also use these procedures to create replica servers for subdomains.

 
 
 
  Previous   Contents   Next