Understand Scheduled Jobs in Cluster Environment
  • 18 Dec 2024
  • 3 Minutes to read
  • Dark
    Light

Understand Scheduled Jobs in Cluster Environment

  • Dark
    Light

Article summary

Overview

Within a clustered environment, scheduled jobs are set to run only on one node. This node is referred to as the Job server. The other nodes in the cluster act as Failover job servers, serving as backups to run the scheduled jobs in case the Job Server fails to run the job. By default, all the servers are enabled to run the scheduled jobs. However, administrators must manually designate the server in order to specify the Job Server and the Failover job servers in the Server settings.

The following document demonstrates how to configure scheduled jobs in a clustered environment.


Enable or Disable a Server's ability to run Job

As mentioned, by default, all the servers are enabled to run the scheduled jobs. However, admin users can disable a server from running any jobs. The setting: Can Be Job Server dictates whether the server can perform job work. If disabled, the server will not run a job. This setting applies whether the server is standalone or part of a cluster. In a cluster, if any servers do not have this property enabled, then those servers will not run a job and become dedicated purely to serving front-end user requests.

Note:

Disabling the "Can be a Job Server" setting will effectively block all Scheduled Jobs, Startup Jobs, and Thread Jobs. 

  1. Navigate to the System > Administration > Servers. This folder displays a Report listing all the servers within the cluster.

  2. Right-click on the server > Edit server. This opens an "Edit Platform Server" dialog.

  3. Scroll down to Server Info and enable/disable Can be Job Server.

  4. Save and close the dialog.


Configure Job Server and Failover Job Servers

A Job server is the server within the cluster designated to run all the jobs. Follow the steps to set up a Job Server and Failover Job Servers.

  1. Navigate to the System > Administration > Servers. This folder displays a Report listing all the servers within the cluster.

  2. Right-click on the server > Edit server. This opens an "Edit Platform Server" dialog.

  3. Scroll down to Server Info and ensure the Can be Job Server is enabled.

  4. Job Server Order: This setting is cluster-specific. If this property is set to 1, that server becomes the Job Server. Similarly, for other servers within the cluster, this property should be set to the next sequential number, such as 2, and subsequent numbers accordingly. Thus, servers with values 2 and above become the Failover Job Servers.

    Sequencing of the Job Servers

    It is highly recommended not to duplicate the "Job Server Order" sequence. The number specified under the "Job Server Order" field must be unique.

  5. Job Delay In Min: The time delay before the job is pushed to the next server in sequence.

Following these steps and configurations establishes a structured approach to job execution and failover within the cluster.


Verifying the Job Server

Admin users can verify the Job server by accessing the Report of available platform servers.

  1. Navigate to System > Administration > Servers. This Page will show a comprehensive report detailing all the servers within the platform.

  2. From the report, the "IsJobServer" column determines the Job server. Among the listed servers, only one will have a "True" value in this column, indicating its role as the Job server.


Redirecting a Job to other Servers in Cluster

Jobs are scheduled to run in a queue, and multiple queues can run simultaneously. Each queue contains a set of jobs that run one after the other. When a job is delayed, all other scheduled jobs in the same queue will be put on hold until the initial job finishes.

To avoid this, you can configure the job to run in different queues or redirect the job to another server by disabling the Run Only on Job Server option while configuring the scheduled jobs. Enabled by default, the Run Only on Job Server setting ensures that the job runs only on the Job Server in a cluster setup.

Follow these steps to disable the Run Only on Job Server:

  1. Navigate to System > Jobs and Events > Scheduled Jobs.

  2. Click on New Scheduled Flow. A dialog to configure a scheduled job opens.

  3. Scroll down to Job Settings and disable Run Only on Job Server.

Now, if any of the jobs in a queue gets delayed, the next job in the same queue will be redirected to any of the servers configured to run a job.


Was this article helpful?