Chapter 4


Batch Operations

This chapter explains the batch transaction methods.

4.1 OVERVIEW

Batch transactions are carried out by NQS. This chapter explains the use of NQS. Figure 4-1 illustrates these operations. The steps are explained after the figure.

Figure 4-1 NQS Operation

Home


The following explains the sequence of NQS operations.

Steps 2 through 5 are repeated for each subsequent NQS activation.

4.2 CONSTRUCTING THE NQS ENVIRONMENT

This section describes the minimum essential items for activating NQS. The methods of adjusting the NQS system environment in accordance with the operation mode are explained in Chapter 5, Configuration Management.

4.2.1 NQS Construction Method

NQS is constructed using the install tool. (See the printed SUPER-UX Installation Guide.) This section explains how to construct an NQS. Only the superuser can construct an NQS.

  1. Constructing an NQS database using /usr/lib/nqs/nqsmkdbs.

    Example:

  2. Setting the host ID of the relating hosts including the local host.

    Example:

  3. Activating NQS

    Example:

    If the activating NQS failed, see "logfile."

Home


4.2.2 NQS Configuration

Once NQS is installed and the nqsdaemon is successfully invoked, the NQS environment must then be defined. The creation of this NQS environment involves the configuration of NQS queues and devices according to the application of various sites and their definition with the qmgr(1M) function. The definition of these queues and devices is performed by the superuser or NQS manager.

This section first explains the methods of designing the configuration of the various NQS queue devices. The methods and purpose of application of each site determine the actual configuration. This section explains general points to be noted when designing an NQS configuration and includes some examples. The actual configuration depends on the individual needs of each site.

4.2.2.1 CONFIGURATION OF NQS QUEUES

This section describes the configuration of the following four types of NQS queues.

The queue configuration method varies with the queue type. The following sections describe each of the four queue types.

Home


Home


Home


Home


If network queues are not prepared for each target host, network requests are submitted to the default network queue (DefaultNetQueue). DefaultNetQueue stages out stdout, stderr, and jor files to the host machine to which the parent batch requests were submitted. However, DefaultNetQueue was designed for temporary use when network queues are not yet created or when the network queues are disabled. Therefore, be sure to prepare network queues for all target hosts (including local hosts).

If you do not prepare a network queue for the host to which the stdout/stderr/JOR file is sent, the following warning message appears on the NQS log file.

NQS(WARN):Network queue toward host (mid = xxx) isn't prepared.

xxx is the machine ID of the host in which a network queue is needed.

4.2.2.2 CONFIGURATION OF NQS DEVICES

An NQS device must be configured in accordance with the physical devices (lp, for example) prepared in your host machine. The relations with device queues and forms are also important. Use the example in Figure 4-2 as a reference.

Figure 4-2 NQS Queuing

Figure 4-2 NQS Queuing

In this example, device requests submitted to device queue 1 are output to NQS device 1 or NQS device 3, whichever is free. If form 1 is specified when submitting a device request, it is only output to NQS device 1. The same applies to device queue 2, form 2, etc.

Home


4.2.3 Creating an NQS Device

The NQS device processes requests (device requests), directing their output to devices such as a printer. This device is not created at all when NQS is first invoked and must be created separately. A device is configured with the following four components.

The name refers to the device name. The special file is the UNIX (/dev/lp etc) device file. Server programs process the request data (lpserver is the standard). forms are described in the next section. A device is created with the create device subcommand of qmgr(1M). However, it is essential to set the forms to be defined in the device as valid, before creating the device. Read the following explanation, set the forms, and create the device.

Example:

# qmgr
Mgr: create device dev1 forms=form1 fullname=/dev/lp \
     server=(/usr/lib/nqs/lpserver)

The preceding example creates the following device.

4.2.4 Grouping NQS Devices

Device grouping is done with the forms defined creating the devices. Devices with the same defined forms are in the same group (see Figure 4-3).

Figure 4-3 Grouping NQS Devices

Figure 4-3 Grouping NQS Devices

First you must set the forms in an effective form list. Since nothing is set in the list when NQS is first activated, forms must be set in the effective form list. Forms must be defined in the devices and no device can be created without first setting the forms. Forms can be set with the set form subcommand of qmgr(1M).

Example:

# qmgr
Mgr: set forms form1 form2

In the preceding example, form1 and form2 are valid forms, so form1 and form2 can be defined in the device.

Home


4.2.5 Creating an NQS Queue

The NQS queue is the most important element in the NQS system. Since this NQS queue does not exist at all when NQS is first activated, it must be created separately. The following queue types perform the various NQS queue functions.

A NQS queue can be created with the create subcommand of the qmgr(1M) command. The following are the create subcommands.

The following examples show how to create the various types of queues. You must provide a queue in accordance with the NQS queue configuration designed in advance.

Home


Home


4.2.6 Defining NQS Queue Attributes

Specific attributes for each queue type can be specified in NQS queues. The following is an explanation of the unique attributes of each queue.

4.2.6.1 BATCH QUEUES

A batch queue has the following attributes.

Home


4.2.6.2 DEVICE QUEUES

A device queue has the following attributes.

4.2.6.3 PIPE QUEUES

A pipe queue has the following attributes.

Home


4.2.6.4 NETWORK QUEUES

A network queue has the following attributes:

Home


4.2.7 Creating an NQS Queue Complex

A NQS queue complex is used to manage multiple NQS batch queues as a group. This complex is created when trying to restrict the maximum number of requests for simultaneous execution in several batch queues (see Figure 4-4).

Fig. 4-4 Creating an NQS Queue Complex

Figure 4-4 Creating an NQS Queue Complex

A queue complex can be created with the create complex subcommand of the qmgr(1M) command. In the following example, the queue complex called complex1, comprising the three queues, batch1, batch2 and batch3, is created.

Example:

# qmgr
Mgr:  create complex=(batch1, batch2, batch3) complex1

The following example defines the maximum number of requests for simultaneous execution in a queue complex. The maximum number of requests for simultaneous execution is three and this value is defined in the queue complex called complex1.

Example:

# qmgr
Mgr: set complex run_limit=(3) complex1

Home


4.2.8 Overview of the Transparent Pipe Queue and Its Setting

A transparent pipe queue can transfer requests to a local batch queue at higher speed with lower load than the conventional pipe queue. For example, the transparent pipe queue is very useful in a load balancing environment (see Section 5.11).

4.2.8.1 PRINCIPLE OF OPERATION

The following figure shows an example of how the batch queue operates.

Figure 4-5 Batch Operation

Figure 4-5 Batch Operation

When receiving a request, the transparent pipe queue checks its own acceptance limit. If there is no problem, the transparent pipe queue tests whether any of the destination queues can accept this request. If no destination queues can accept the request, the transparent pipe queue does not accept the request, either. When the request can be accepted, the destination batch queue directly accepts it.

Home


4.2.8.2 SETTING

This section describes the procedure for setting the transparent pipe queue (with qmgr subcommands).

First, create a pipe queue in a normal method.

Mgr: create pipe TransPipe priority=10 server=(/usr/lib/nqs/pipeclient) \
     destination=(BatchSmall, BatchMiddle, BatchLarge)

A pipe queue TransPipe has been created. The destinations are batch queues on local machines. The batch queues have a resource limit. The transparent pipe queue quickly and automatically distributes requests to two or more batch queues with different limits.

Next, assign this queue as a transparent pipe queue.

Mgr: set transparent pipe_queue TransPipe

The setting of a transparent pipe queue has been completed. This setting can be checked by qstat -x or qstatq -f.

4.2.8.3 DIFFERENCES FROM THE CONVENTIONAL PIPE QUEUE

The transparent pipe queue differs from the conventional pipe queue in these respects:

When it cannot accept a request, the transparent pipe queue returns an (internal) error code, which is different from the error code returned by the conventional pipe queue, as described below:

Home


4.2.9 Constructing the NQS Network Environment

The NQS network environment must first be constructed in order to use network functions in NQS. The network environment is constructed with the nmapmgr(1M) command. First, the host ID of each machine on the network must be defined. Then register the machine names and host IDs in the network data base.

In the following example, the machine whose name is HOST2 and host ID is 101 is recognized as a machine on the network.

Example:

# nmapmgr
NMAPMGR>:  add mid 101 HOST2

4.2.10 Registering an NQS Manager

The management of NQS operations is performed by the user called NQS manager. A superuser has the privileges of an NQS manager, but ordinary users can also be given this right. The NQS operator (the user who is permitted to perform the NQS operations) can also be set. The NQS manager can use all the subcommands of the qmgr(1M) command while the NQS operator can only use certain subcommands. Generally speaking, the NQS operator cannot tamper with the NQS configuration. All these settings can be done with the set manager subcommand of the qmgr(1M).

In the following example, user1 is designated as the NQS manager while user2 is the NQS operator. An NQS manager may be distinguished from an NQS operator by the letter appended to the end of the specified user name, ":m" is assigned to an NQS manager while ":o" is assigned to an NQS operator.

The preparation for NQS application is almost complete at this point. Even if NQS were to stop, the settings thus far would be registered.

Example:

Setting the NQS manager:
# qmgr
Mgr: set manager user1:m

Setting the NQS operator:
# qmgr
Mgr: set manager user2:o

Home

Contents Previous Chapter Next Chapter Index