Queue manager

From VSI OpenVMS Wiki
Jump to: navigation, search

A queue manager is a section of an OpenVMS system that controls queue activity. One or more queue manager processes control queueing for all processes on a node or in an OpenVMS cluster environment.

Functions

When a user submits a batch or print job to a queue, the queue manager performs the following tasks:

  1. Receives the user's queue request, including information about the type of job, the file name or names, the name of the queue, and any special options.
  2. Stores and retrieves appropriate information from the queue database to print or execute the job.
  3. Places the job in the appropriate queue to await its turn for processing:
    1. Print jobs are sent to an independent process, called a symbiont, for formatting and are then sent to the printer for printing.
    2. For batch jobs, the job controller creates a batch job process.

User processes, symbionts, and job controllers on each node communicate directly with queue managers. In addition, the job controller JOB CONTROL works with the queue manager to perform the following queue management tasks:

  • Create and monitor batch, symbiont, and queue manager processes
  • Restart the queue manager process on reboot
  • Handle failover of the queue manager in an OpenVMS Cluster environment

Queue Manager Failover

By default, in an OpenVMS Cluster environment, the queue manager tries to fail over to another node if the node on which the queue manager is running leaves the cluster. You can specify the order in which OpenVMS Cluster nodes claim the queue manager process. The /ON qualifier of the START/QUEUE/MANAGER command lets you specify a list of OpenVMS Cluster member nodes in the order that they should claim the queue manager process. It is recommended that you specify an asterisk (*) at the end of the node list to make sure that at least one node is always available to run the queue manager.

Obtaining Information about Queue Managers

To obtain information about one or more queue managers, enter the SHOW QUEUE/MANAGERS command (the /FULL qualifier is available).

Starting the Queue Manager

Before you can create queues, you must create a queue database by entering a command in the following format: START/QUEUE/MANAGER/NEW_VERSION[/ON=(node,...)] [dirspec]

/NEW_VERSION specifies that new queue database files are to be created. /ON allows you to customize failover of the queue manager. [dirspec] specifies the location of the queue database files if you wish to create them in a location other than the defaut.

You normally perform this task only once because when you enter the command, the system stores it, along with any qualifier or parameter you enter, in the queue database. The job controller automatically starts the queue manager during reboot unless you enter a STOP/QUEUE/MANAGER/CLUSTER command. For this reason, including START/QUEUE/MANAGER in your startup command procedure is unnecessary.

Stopping and Restarting the Queue Manager

Once created, a queue manager is stopped at shutdown and started at startup, so you never need to stop or restart it except when you need to modify the list of preferred nodes on which the queue manager can run on.

Stopping the Queue Manager

To shut down the queue manager on a standalone node or an OpenVMS Cluster node, enter the following command: $ STOP/QUEUE/MANAGER/CLUSTER

The queue manager performs the following tasks:

  • Aborts all current jobs that cannot be restarted and requeues all current restartable jobs
  • Stops all execution queues
  • Disables autostart on all nodes
  • Closes all queue database files associated with that queue manager

Once you enter STOP/QUEUE/MANAGER/CLUSTER, the queue manager process remains stopped; requests to that queue manager are denied until you restart the queue manager by entering START/QUEUE/MANAGER. (Note that the queue system remains running as long as one or more queue managers are running.) OpenVMS Cluster transitions do not change the state of the queue manager. Newly available nodes do not attempt to start the queue manager (unless you enter START/QUEUE/MANAGER). Use the /CLUSTER qualifier to stop a clusterwide queue manager. If you enter the obsolete command STOP/QUEUE/MANAGER (without the /CLUSTER qualifier), the command performs the same function as STOP/QUEUES/ON_NODE. (Use STOP/QUEUES/ON_NODE to stop all queues on a single node without stopping the queue manager.)

Restarting the Queue Manager

The queue manager restarts automatically whenever you reboot the system. However, you might need to enter START/QUEUE/MANAGER for one of the following reasons:

  • If STOP/QUEUE/MANAGER/CLUSTER has been executed, enter START/QUEUE/MANAGER to restart the queue manager.
  • In an OpenVMS Cluster environment, enter START/QUEUE/MANAGER with the /ON qualifier to modify the list of preferred nodes on which the queue manager can run.
  • In an OpenVMS Cluster environment, enter START/QUEUE/MANAGER to ensure that the queue manager process executes on the most preferred, available node. If it does not, the queue manager will be moved to the most preferred, available node without interruption of service. If you are using the default node list (*), the queue manager will not be moved.

Note System Parameter JOBCTLD

  • If the system parameter JOBCTLD low bit is set, the job controller will not start the queue manager. JOBCTLD is a dynamic system parameter.

Using Multiple Queue Managers

To work around CPU, disk space, or memory limitations, you can use multiple queue managers to distribute the batch and print work load among nodes as well as to distribute the database files among disks. For example, you might create separate queue managers for batch queues and print queues. Run the batch queue manager on one node and the print queue manager on a different node. You can also maintain queue and journal files on separate disks.


Restrictions on Using Multiple Queue Managers

Multiple queue managers have the following restrictions:

  • Queues running on one queue manager cannot reference queues running on a different queue manager. For example, a generic queue running on queue manager A cannot direct jobs to an execution queue running on queue manager B.
  • You cannot move a job from a queue on one queue manager to a queue on a different queue manager.
  • The operating system allows a maximum of five queue managers in an OpenVMS Cluster environment.

Names of Multiple Queue Managers

The process name for a queue manager is the first twelve characters of the queue manager name. The default queue manager name is SYS$QUEUE_MANAGER; the default queue manager process name is QUEUE_MANAGE. If you create an additional queue manager named PRINT_MANAGER, the process name is PRINT_MANAGE.

Queue Database Files

QMAN$MASTER.DAT

Multiple queue managers share a single master file. However, a queue database with multiple queue managers contains a queue file and a journal file for each queue manager

queue_manager_name.QMAN$QUEUES

queue_manager.QMAN$JOURNAL

Managing Multiple Queue Managers

By default, the following commands affect the default queue manager SYS$QUEUE_MANAGER or the queues running on the default queue manager:

  • START/QUEUE/MANAGER
  • ENABLE AUTOSTART/QUEUES and DISABLE AUTOSTART/QUEUES
  • STOP/QUEUES/ON_NODE
  • STOP/QUEUE/MANAGER/CLUSTER
  • DELETE/QUEUE/MANAGER

When you create a queue with the INITIALIZE/QUEUE command, specify the name of the queue manager on which it is to run by including the /NAME_OF_MANAGER qualifier. If you do not specify the /NAME_OF_MANAGER qualifier, the queue is created to run on the default queue manager, SYS$QUEUE_MANAGER. To move an existing queue from its original queue manager to a different queue manager, delete the queue with the DELETE/QUEUE command and re-create the queue with the INITIALIZE/QUEUE command.

When entering DCL commands to maintain the queue manager, be sure to specify the /NAME_OF_MANAGER qualifier to specify the queue manager to which the command is to apply. If you do not specify the /NAME_OF_MANAGER qualifier, the command is executed on the default queue manager, SYS$QUEUE_MANAGER.