Skip to content

cla disp-start - Start the Dispatcher server

cla disp-start starts the Clarive Dispatcher server process.

The Dispatcher is responsible for job execution, rule processing, and background task management in Clarive. It processes jobs from the queue, executes rules, and manages worker connections.

Usage

cla disp-start -c MYCONFIG [options]

Options

  • -c, --config MYCONFIG - Specify the configuration file to use (required).
  • -d, --daemon - Run the dispatcher as a background daemon.
  • --debug <level> - Set debug level (1-5, higher numbers show more detail).
  • --workers <number> - Number of worker processes to spawn (default: 4).
  • --port <port> - Override the dispatcher port from config.
  • --start-timeout <seconds> - With --daemon, how long to wait for the dispatcher to finish starting (default: 120).

Environment Variables

  • CLARIVE_DEBUG=<level> - Set debug output level (1-5).
  • CLARIVE_TRACE=db - Print every MongoDB call with parameters and elapsed time.

Examples

Start the dispatcher in foreground mode:

cla disp-start -c myconfig

Start as a daemon with debug output:

CLARIVE_DEBUG=3 cla disp-start -c myconfig --daemon

Daemon startup check

With --daemon the command does not return as soon as the background process is created: it waits until the dispatcher has finished starting up and then prints dispatcher started with pid <pid>.

If the dispatcher dies while starting (for example, because of a database error), the command removes the pid file, prints the last lines of the dispatcher log and ends with an error exit code. Scripts and cla start can then detect that the dispatcher is not running.

If the dispatcher is still starting after --start-timeout seconds, the command prints a warning and returns without an error: the dispatcher keeps starting in the background, so check its log file.

Notes

  • The dispatcher must be running for job execution and background tasks.
  • Only one dispatcher instance per configuration should run at a time.
  • Check logs in the configured log directory for troubleshooting.
  • To see dispatcher status, use cla ps -c myconfig.