Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Scope
- This article explains configuration for the Classic JobScheduler Agent
FEATURE AVAILABILITY ENDING WITH RELEASE 1.10 - For general configuration of the JobScheduler Universal Agent see JobScheduler Universal Agent - Installation & Operation
FEATURE AVAILABILITY STARTING FROM RELEASE 1.10 - For dynamic assignment of JobScheduler Universal Agents to Jobs see:
Jira server SOS JIRA columns key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution serverId 6dc67751-9d67-34cd-985b-194a8cdc9602 key JS-1189
- Consider the How to split and sync a dynamic number of job instances for execution with Agents article.
Process Classes for use with JobScheduler Agents
- We assume that we have a job in a job chain
...
- to be executed on a JobScheduler Agent.
- This requires a process_class that is assigned to the job.
- Please read
...
- How to configure a JobScheduler Master and Agent to work together to know how you create the process class for a JobScheduler Agent and how you assign it to a job.
Process Class configuration
Now we assume that we have use multiple JobScheduler Agents and we want that a job executes the job to be executed on different JobScheduler Agents depending on parameters.
...
Create
...
a
...
process
...
class
...
(e.g.
...
with
...
the
...
name
...
_agents_)
...
in
...
JOE
...
with
...
empty
...
values
...
for
...
host
...
and
...
port
...
.
...
The
...
values
...
for
...
host
...
and
...
port
...
are
...
set
...
dynamically.
...
This should result in the following configuration file ./config/live/agents.process_class.xml
...
:
...
Code Block language html/xml
...
<?xml version="1.0" encoding="ISO-8859-1"?>
...
<process_class max_processes="30"/>
Assign the process class to the
orderjob in JOE. In this example the job
is namedhas the name shellOnDynamicAgent and calls hostname as a shell command.
No Format So
you
getshould see the
following
content in the configuration
file
_./config/live/shellOnDynamicAgent.job.xml
_:
Code Block language html/xml <?xml version="1.0" encoding="ISO-8859-1"?> <job process_class="agents" order="yes" stop_on_error="no"> <script language="shell"> <![CDATA[ #! /bin/sh # returns the hostname of the agent hostname ]]> </script> <run_time/> </job>
Job configuration
Create the following job
(, e.g. setAgent
), and
putadd it
intoto the job chain as the forerunner of the
agentJobScheduler Agent job.
No Format This
job
changemodifies the
process_class
setting
of
the
successor
job
in
the
job
chain
according
to the
order
parameter _parameters agent_host_
and
_agent_port
_.:
Code Block language html/xml <?xml version="1.0" encoding="ISO-8859-1"?> <job order="yes" stop_on_error="no"> <params /> <script language="java:javascript"> <><![CDATA[ function spooler_process()\ { var curOrder = spooler_task.order; var agentHost = curOrder.params.value('agent_host'); var agentPort = curOrder.params.value('agent_port'); var nextJob = curOrder.job_chain_node.next_node.job; spooler_log.info("Params agentHost:agentPort = "+agentHost+":"+agentPort); spooler_log.info("before: "+nextJob.process_class.remote_scheduler); nextJob.process_class.remote_scheduler = agentHost+":"+agentPort; spooler_log.info("after: "+nextJob.process_class.remote_scheduler); return true; \ } ]]> <></script> <run_time /> </job>
Job chain configuration
Add
Putthese jobs
intoto a job chain
(, e.g. jobChainWithAgentJob
).:
So you have the configuration file _No Format This will result in the job chain configuration file ./config/live/jobChainWithAgentJob.job_chain.xml
_:
Code Block language html/xml <?xml version="1.0" encoding="ISO-8859-1"?> <job_chain orders_recoverable="yes" visible="yes"> <job_chain_node state="setAgent" job="setAgent" next_state="callAgent" error_state="error"/> <job_chain_node state="callAgent" job="shellOnDynamicAgent" next_state="success" error_state="error"/> <job_chain_node state="success"/> <job_chain_node state="error"/> </job_chain>
Order configuration
Add an order to the job chain jobChainWithAgentJob for each JobScheduler Agent
you want.
No Format For
example
one agent is on HostA with port 4444 and another agent is on HostB with port 4444. The orders must have the parameter _, one JobScheduler Agent runs on HostA with port 4444 and another JobScheduler Agent runs on HostB with port 4444. The order has to be assigned the parameters agent_host_
and
_agent_port
_.
So you have the configuration files _No Format
_
This should result in the order configuration files ./config/live/jobChainWithAgentJob,hostA-4444.order.xmland
_./config/live/jobChainWithAgentJob,hostB-4444.order.xml
_:
Code Block language html/xml <?xml version="1.0" encoding="ISO-8859-1"?> <order> <params > <!-- for use with JobScheduler releases before 1.10 <param name="agent_host" value="HostA"/> --> <!-- for use with JobScheduler releases starting with 1.10 --> <param name="agent_host" value="http://HostA"/> <param name="agent_port" value="4444"/> </params> <run_time/> </order>
Code Block language html/xml <?xml version="1.0" encoding="ISO-8859-1"?> <order> <params > <!-- for use with JobScheduler releases before 1.10 <param name="agent_host" value="HostB"/> --> <!-- for use with JobScheduler releases starting with 1.10 --> <param name="agent_host" value="http://HostB"/> <param name="agent_port" value="4444"/> </params> <run_time/> </order>