Solaris Naming Setup and Configuration Guide

Part IV FNS Setup and Configuration

This part describes how to initially set up and configure the Federated Naming Service (FNS) in an NIS+, NIS, or /etc namespace environment.

Chapter 11 FNS Setup and Configuration

This chapter describes how to initially set up and configure the Federated Naming Service (FNS) in an NIS+, NIS, or files-based naming environment. (Files-based naming refers to name services that obtain their data from /etc files rather than NIS+ or NIS.)

See Solaris Naming Administration Guide for a general description and overview of FNS.


Note -

The Solaris Naming Administration Guide contains an "FNS Quickstart" chapter that provides a summary overview of FNS, a brief description of setup and configuration steps, and a programming example. Experienced administrators may find that this quick start chapter is all they need.


Setting Up FNS--Overview

After your Solaris 7 release software is installed, you must perform the following tasks to set up FNS:

  1. Make sure that your servers can handle FNS. See "Determining Resource Requirements".

  2. Prepare your namespace for FNS. See "Preparing the Namespace for FNS".

  3. Set up the FNS namespace contexts. There are two ways to do this:

    1. Globally create all contexts in one process. See "Creating Global FNS Namespace Contexts".

    2. Individually create your FNS contexts. See Solaris Naming Administration Guide.

  4. Set up FNS replica servers. See "Replicating FNS Service".

Depending on the size of the organization, you should allow several hours for the FNS setup to be completed, plus additional time for namespace preparation.

Determining Resource Requirements

Before proceeding with any installation procedure, you must first ensure that the servers supporting FNS have sufficient memory and disk storage. Space for FNS is in addition to the space needed for your enterprise-level name service (NIS+, NIS, or files).

As a general rule-of-thumb, you will need approximately 17 Kbytes of disk storage for each user and host, plus adequate swap space. Where this disk storage space is located and how it is calculated varies according to your underlying enterprise-level naming service:

For example, to support an FNS environment in an NIS+ domain with 1200 users and hosts, you will need:

Preparing the Namespace for FNS

This section describes the preparations you need to make before running fncreate to set up your FNS contexts. The preparations vary according to your enterprise-level naming service.

Preparing the Namespace for FNS -- Task Map

Table 11-1 Preparing the Namespace for FNS
 

Task 

 

Description 

 

For Instructions, Go To 

 

Preparing the Namespace for FNS 

 

Prepare the namespace for FNS 

 

"How To Prepare Source Files for Conversion to NIS Maps"

 
 

 

 

 

 

"How to Prepare NIS Service for FNS"

 

 

 

 

 

"Preparing Files-Based Naming for FNS"

      

How to Prepare NIS+ Service for FNS

Before setting up the FNS namespace, do the following:

  1. Make sure that the NIS+ domain is properly set up.

    The NIS+ domain and associated subdomains must already be set up before configuring FNS. In other words, NIS+ standard tables, such as hosts and passwd, must already exist and be populated.

  2. Make sure that the domain's hosts.org_dir and passwd.org_dir tables are fully populated with the names of every host and user.

    You can use the niscat or nismatch commands to check the contents of these tables.

  3. Set the NIS_GROUP environment variable to the name of the group that will be administering the FNS objects.

    The fncreate command will not let you complete the FNS setup without setting this variable first. When fncreate creates user and host contexts, they are owned by those hosts and users, and not by the administrator who executed the command. Setting NIS_GROUP allows the administrators who are members of the group to subsequently modify these contexts, even though they do not own the objects.

    Assuming a C-Shell, the example below sets NIS_GROUP to fns_admins.doc.com.


    rootmaster# setenv NIS_GROUP fns_admins.doc.com

  4. [Optional] Specify that FNS run on a machine other than the NIS+ master server.

    All NIS+ objects used by FNS are kept under the ctx_dir directory of an NIS+ domain, at the same level as the domain's org_dir directory. For large domains, such as those with more than 5000 users and hosts, it is recommended (though not required) that the ctx_dir used by FNS be supported by a server different from the one supporting the standard NIS+ directories, such as groups_dir. Using separate servers avoids placing too much load on one server. It also allows you to keep separate the administration of FNS's use of NIS+ and the administration of NIS+ itself.

    To specify that FNS be hosted by a machine that is not the NIS+ master server for the domain, you must manually create a ctx_dir directory object on the machine that will serve as the FNS host for the domain. (If you omit this step, FNS will be installed on the domain's NIS+ root master server.)

    To specify the machine that will become the FNS master server:

    1. Create the ctx_dir directory for the NIS+ domain.

      For example, to create a ctx_dir directory on a machine named fns_server in the doc.com domain, run the following command on the domain's master server (note the trailing dot at the end of the domain name, as shown):


      nismaster# nismkdir -m fns_server ctx_dir.doc.com.

      (See Solaris Naming Administration Guide for more information on creating NIS+ directory objects with the nismkdir command.)


      Note -

      If you are creating an FNS ctx_dir directory for a subdomain, the machine you specify as the FNS server hosting ctx_dir must reside in the subdomain, it cannot be a machine in the parent domain. (By contrast, a subdomain's NIS+ master server always resides in the domain above the one it serves.) In other words, when configuring FNS for an NIS+ subdomain, if you use the same server for both NIS+ and FNS, that server resides in the domain above the subdomain; but if you use different servers for NIS+ and FNS, the NIS+ master server resides in the domain above and the FNS server resides in the subdomain that it serves.


    2. Use the nisls command to verify that the ctx_dir directory has been created.


      rootmaster # nisls doc.com.ctx_dir

    3. Run nisping to checkpoint the directory


      # /usr/lib/nis/nisping -C ctx_dir.doc.com.

How to Prepare NIS Service for FNS

Before setting up the FNS namespace, do the following:

    Make sure that the hosts.byname, user.byname, and printer.conf.byname maps are complete, correct, and up to date.


Note -

You can assign a different master server for FNS maps, using the same procedure that you would to assign a different master for any other NIS map. See Solaris Naming Administration Guide for details.


Preparing Files-Based Naming for FNS

Files-based naming refers to name services that obtain their data from /etc files rather than NIS+ or NIS.

If you are going to install a /var/fn directory on each machine, as is normally the case, the steps below must be performed on each machine. If you decide to mount and export the /var/fn directory from one machine, the steps below need to be performed on the machine that exports /var/fn.

    Make sure that the /etc/hosts and /etc/passwd files are complete and contain the names of all users and hosts.

Creating Global FNS Namespace Contexts

This section describes how to create your namespace globally for a given enterprise or NIS+ domain.

The FNS namespace is created by the fncreate command.


# fncreate -t org org//

Or, alternatively:


# fncreate -t org org/domain/

Where domain is the name of an NIS+ domain or subdomain.

The fncreate command creates the default contexts for the specified organization and all its subcontexts, including contexts and subcontexts for users and hosts in the organization.

For information on how to manually create individual FNS contexts, see Solaris Naming Administration Guide.

Creating Global FNS Namespace Contexts -- Task Map

Table 11-2 Globally Creating FNS Namespace Contexts
 

Task 

 

Description 

 

For Instructions, Go To 

 

Globally Creating FNS Namespace Contexts 

 

Create FNS namespace contexts 

 

"How to Create Namespace Contexts Under NIS+"

 
 

 

 

 

 

"How to Create Namespace Contexts Under NIS"

 

 

 

 

 

"How to Create Namespace Contexts Under Local Files"

      

How to Create Namespace Contexts Under NIS+

When your primary enterprise-level name service is NIS+, namespace contexts must be created separately for each NIS+ domain or subdomain in your enterprise.

For example, to create the contexts for the manf.doc.com subdomain on the submaster machine that is the NIS+ master server for that domain:

  1. On the subdomain master, run fncreate as shown below:


submaster# fncreate -t org org/manf.doc.com./

This creates the organization context for the NIS+ manf.doc.com. subdomain, and contexts and associated subcontexts for all users found in that subdomain's passwd.org_dir table and all hosts found in the subdomain's hosts.org_dir table.

(If you want to use different machines for NIS+ and FNS servers, run the above command on the machine you want to use as the FNS server. See Step 4 for information on how to prepare a non-NIS+ server to be an FNS server.)

  1. Use nisping to checkpoint the ctx_dir directory:


    # /usr/lib/nis/nisping -C ctx_dir.manf.doc.com.


    Note -

    For a large organization with several thousand users and hosts, the initial fncreate operation can take several hours; the subsequent checkpoint can also take several hours.


How to Create Namespace Contexts Under NIS

When your primary enterprise-level name service is NIS, there is only one domain for the enterprise. Namespace contexts are created for that enterprise-wide domain.

For example, create the contexts for the doc.com domain, on the machine named fns_master, which is also the NIS master server:

    On the domain master, run fncreate as shown below:


    fns_master# fncreate -t org org//

    This creates the organization context for the NIS domain doc.com, and contexts and associated subcontexts for all users found in NIS servers's passwd map and all hosts found in the server's hosts map.


    Note -

    After you have created your context maps, you can assign the same machine to be the master server, using the same procedure that you would to assign a different master for any other NIS map. The FNS maps all have names starting with fns_ and ending with either .ctx or .attr. See Solaris Naming Administration Guide for details.


How to Create Namespace Contexts Under Local Files

When your primary enterprise-level name service is files-based, namespace contexts are created for the system.

For example, to create the contexts for the system:

    On the machine hosting the /var/fn directory, run fncreate, as shown below:


    server1# fncreate -t org org//

This creates the organization context for the system and contexts and associated subcontexts for all users found in machine's /etc/passwd file, and all hosts found in the machine's /etc/hosts file.

Replicating FNS Service

On large or mission-critical networks where performance and reliability of FNS naming is of vital importance, FNS service should be replicated.

Replicating FNS Service -- Task Map

Table 11-3 Replicating FNS Service
 

Task 

 

Description 

 

For Instructions, Go To 

 

Replicating FNS Service 

 

Replicate FNS service 

 

"How to Replicate FNS Under NIS+"

 
 

 

 

 

 

"How to Replicate FNS Under NIS"

 

 

 

 

 

"How to Replicate FNS Under Files-Based Naming"

      

How to Replicate FNS Under NIS+

After the FNS namespace has been set up on the master server, additional replicas can be added in each domain to serve the domain's ctx_dir directory. Replicas enhance availability and performance of the servers.

  1. Run the nismkdir command on the FNS master server to add a replica for the ctx_dir directory.

    For example, establish the machine fnsrserver as an FNS replica for the doc.com. domain:


    # nismkdir -s fnsrserver ctx_dir.doc.com.

  2. Checkpoint the ctx_dir directory with the nisping command.


    # /usr/lib/nis/nisping -C ctx_dir.doc.com.

    FNS replicas should be checkpointed at regular intervals. The recommended period is every few days. The period you choose depends on how frequently changes are made to the FNS namespace.

How to Replicate FNS Under NIS

After the FNS namespace has been set up on the domain master server, additional slave servers can be added to enhance availability and performance of the servers.

  1. As root, edit the /etc/hosts file on the slave server to add the name and IP addresses of all the other NIS servers.

  2. Change directory to /var/yp on the slave server.

  3. To initialize the slave server as a client, type the following:


    # /usr/sbin/ypinit -c

    The ypinit command prompts you for a list of NIS servers. Enter the name of the local slave you are working on first, then the master server, followed by the other NIS slave servers in your domain in order, from the physically closest to the furthest (in network terms).


    Note -

    You must first configure the new slave server as an NIS client so that it can get the NIS maps from the master for the first time. (See "Setting Up NIS Clients" for details.)


  4. To determine if ypbind is running, type:


    # ps -ef | grep ypbind

    If a listing is displayed, ypbind is running.

  5. If ypbind is running, stop it by typing:


    # /usr/lib/netsvc/yp/ypstop

  6. Type the following to restart ypbind:


    # /usr/lib/netsvc/yp/ypstart

  7. To initialize this machine as a slave, type the following:


    # /usr/sbin/ypinit -s master
    

    Where master is the machine name of the existing NIS master server.

  8. Stop yp processes on the Slave Server:


    # /usr/lib/netsvc/yp/ypstop

  9. Restart yp service:


    # /usr/lib/netsvc/yp/ypstart

    Alternatively, you can reboot the slave server and allow daemons to start automatically.

How to Replicate FNS Under Files-Based Naming

There is no server replication when your primary naming service is files-based.

FNS Administration, Problem Solving, and Error Messages

See Solaris Naming Administration Guide for information on FNS administration, problem solving, and error messages.