Page History
Table of Contents |
---|
Agent Startup
Start Script: agent.sh, agent.cmd
Usage
Running the Agent start script without parameters shows displays the usage clause:
Code Block | ||||
---|---|---|---|---|
| ||||
Usage: agent.sh command [options] [web services] command: start [options] start_docker [options] stop [options] abort [options] restart [options] status [options] [web services] kill [options] options: --http-port=<[hostname or ip address:]number> | todefault: listen4445 to a specific host name --https-port=<[hostname or ip address:]number> if it is specified;| default port: 4445, -https-port=<[hostname or ip address:]number> | -data-directory=<location of data directory> | default: /var/sos-berlin.com/js7/agent/var_4445 --config-directory=<location of config directory> | default: /var/sos-berlin.com/js7/agent/var_4445/config -kill-script=<location of kill script>-sigkill | default: "./bin/agent_kill_task.sh"; only for start -java-options=<java options> | only for stop and restart; running tasks will be |killed default: -Xms100m; see https://kb.sos-berlin.com/x/aIC9 -job-java-options=<java options> -kill-script=<location of kill script> | only for | start web services: overview--java-options=<java options> | default: | default task -Xms100m -Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector -Dlog4j2.asyncLoggerWaitStrategy=Block; see https://kb.sos-berlin.com/x/aIC9 see https://kb.sos-berlin.com/x/fAmGAw for more information. |
Code Block | ||||
---|---|---|---|---|
| ||||
Usage: agent.cmd command [options] command: start [options] start_docker [options] stop [options] abort | running Agent tasks [options] tunnel restart [options] status [options] kill [options] options: | tunnels summary --http-port=<[hostname or ip address:]number> tunnel/ | default: 4445 --https-port=<[hostname or ip address:]number> | default: --data-directory=<location of data directory> | default: /var/sos-berlin.com/js7/agent/var_4445 --config-directory=<location of config directory> | list of tunnelsdefault: /var/sos-berlin.com/js7/agent/var_4445/config command --sigkill | only for stop and restart; running tasks will commandbe summarykilled command/ --kill-script=<location of kill script> | only for start --java-options=<java options> | list of| runningdefault: commands (watching file_order_source) |
Code Block | ||||
---|---|---|---|---|
| ||||
Usage: agent.cmd command [options] [web services]
command:
start [options]
stop [options]
abort [options]
restart [options]
status [options] [web services]
kill [options]
install-service [options]
remove-service [options]
start-service [options]
options:
-http-port=<[hostname or ip address:]number> | to listen to a specific host name or ip address if it is specified; default port: 4445,
-https-port=<[hostname or ip address:]number> |
-data-directory=<location of data directory> | default: .\var_4445
-config-directory=<location of config directory> | default: .\var_4445\config
-kill-script=<location of kill script> | default: ".\bin\agent_kill_task.cmd"; only for start, debug
-java-options=<java options> | default: -Xms100m; see https://kb.sos-berlin.com/x/aIC9
-job-java-options=<java options> |
web services:
overview | default
task | running Agent tasks
tunnel | tunnels summary
tunnel/ | list of tunnels
command | running command summary
command/ | list of running commands (watching file_order_source) |
Command Line Options
-Xms100m -Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector -Dlog4j2.asyncLoggerWaitStrategy=Block; see https://kb.sos-berlin.com/x/aIC9
see https://kb.sos-berlin.com/x/fAmGAw for more information. |
Command Line Options
--http-port=<[hostname or ip address:]number>
- is the HTTP port that the Agent is listening to in order to receive requests from a JS7 Controller:
agent.cmd|sh --http-port=####
- where
####
is the numeric port. - This option can be used to indicate which network interfaces the JS7 Agent should listen to if in addition you specify a hostname or IP address for example with
--http-port=myhost:4445
.
- Without this option being used the port defaults to 4445 and the Agent listens to all available network interfaces.
- Should you want to specify a port then the following precedence applies:
- First precedence: command line option
- Second precedence: environment variable
JS7_AGENT_HTTP_PORT
(see below) - Third precedence: use of default value
- is the HTTP port that the Agent is listening to in order to receive requests from a JS7 Controller:
--https-http-port=<[hostname or ip address:]number>
- is the HTTP HTTPS port that the Agent is listening to in order to receive requests from a JobScheduler MasterController:
- jobscheduler_
agent.cmd|sh
command
http--
https-port=####
- where
####
is the numeric port. - This option can be also used to indicate which network interfaces the JobScheduler Agent should listen to if in addition you specify a hostname or IP address in additionaddress for example with
--https-port=myhost:4445
.
- jobscheduler_
- Without this option being used the port defaults to 4445 and the Agent listens to all available network interfaces.
- Should you want to specify a port then the following precedence applies:
- First precedence: command line option
- Second precedence: environment variable
JS7SJS7_AGENT_HTTPHTTPS_PORT
(see below) - Third precedence: use of default value
-https-port=<[hostname or ip address:]number>
- precedence: use of default value
- is the HTTP HTTPS port that the Agent is listening to in order to receive requests from a JobScheduler MasterController:
--data-directory=<location of data directory>
- Location of the data directory that usually includes the
config
,logs, tmp
andstate
directories. - It has to be unique for any Agent instances
- is the HTTPS port that the Agent is listening to in order to receive requests from a Controller:
agent.cmd|sh command -https-port=####
- where
####
is the numeric port. - This option can be also used to indicate which network interfaces the Agent should listen to if you specify a hostname or IP address in addition
- Without this option being used the port defaults to 4445 and the Agent listens to all available network interfaces.
- Should you want to specify a port data directory then the following precedence applies:
- First precedence: command line option
- Second precedence: environment variable
SJS7JS7_AGENT_HTTPS_PORT
(see below) - Third precedence: use of default value
DATA
(see below)- Third precedence: use of default value (=
JS7_AGENT_HOME/var_<JS7_AGENT_PORT>
)
- Location of the data directory that usually includes the
--config-directory=<location of config directory>
-data-directory=<number>
- Location of the data config directory.
- It has to be unique for all any Agent instances
- Should you want to specify a data config directory then the following precedence applies:
- First precedence: command line option
- Second precedence: environment variable
JS7_AGENT_CONFIG_DATADIR
(see below) - Third precedence: use of default value (=
JS7_AGENT_HOME/var_<JS7_AGENT_PORT>
)
--sigkill
With the
stop
andrestart
commands this option kills any running processes of a job by use of a SIGKILL signal.
--kill-script=<location of kill script>
The kill script provides the functionality to kill a task and any child processes.
- Two kill script is Kill scripts are by default provided from
the following locations:JS7_AGENT_DATA/tmp/./bin/jobscheduler_agent_kill_task.sh
for Unix..\bin\jobscheduler_agent_JS7_AGENT_DATA\tmp\kill_task.cmd
for Windows.
This option can be used to specify the location of a different an individual "kill script" if required.
Should you want to specify a different specify an individual "kill script" then the following precedence applies:
- First precedence: command line option
- Second precedence: environment variable
JS7_AGENT_KILL_SCRIPT
(see below) - Third precedence: use of default value
--java-options=<java options>
With Java 1.8 the initial memory allocation has changed, for details see How to manage the Java heap space.
This option can be used to apply Java options for the Agent, e.g. the memory settings.
Without this option being used the Java options default to '-Xms100m'.
Should you want to specify the Java options then the following precedence applies:
- First precedence: command line option
- Second precedence: environment variable
JAVA_OPTIONS
(see below) - Third precedence: use of default value
--job-java-options=<java options>
Without this option being used the Java options for each job which is started by the Agent.
Should you want to specify the Java options for execution of JITL jobs and JVM jobs then the following precedence applies:
- First precedence: command line option
- Second precedence: environment variable
JS7_AGENT_JOB_JAVA_OPTIONS
(see below)
Environment Startup Script
Usage
...
Instance Start Script: agent_<port>.sh, agent_<port>.cmd
Usage
The JS7 Agent startup script includes the environment variables. The environment variables when set in the startup script are used at the agent startup. Instance Start Script includes a number of environment variables that can be used to specify startup parameters. The Agent Instance Start Script finally calls the Agent Start Script.
- The default location of the
agent
_<port>.cmd|sh
file is:/opt/sos-berlin.com/js7/agent/bin
on Linux systems andC:\Program Files\sos-berlin.com\js7\agent\bin
on Windows.
...
JAVA_HOME
- points to the location of the Java Runtime Environment (JRE).
- Without setting this environment variable Java will be used from the location specified by the system path.
- Please consider that
JAVA_HOME
does not point to the location of a JDK but to a JRE directory where thebin/java
executable resides.
JAVA_OPTIONS
- sets Java options, e.g. the Java memory settings for the Agent.
- Without setting this environment variable the Java options default to
'-Xms100m'
.
JS7_AGENT_JOB_JAVA_OPTIONS
- sets Java options for each job that is started by the Agent.
JS7_AGENT_HOME
- points to the directory where the JobScheduler JS7 Agent has been installed.
- Without setting this environment variable the default value is the parent directory of the start scriptAgent Start Script.
- Should you want to start the Agent from a directory different to the Agent installation directory, e.g. by copying the start script to some other location, then this environment variable has to be set in order to locate the JobScheduler Agent installation directory.
JS7_AGENT_DATA
- points to the directory location where the Agent finds its data directory.
- Without setting this environment variable the default value is
JS7_AGENT_HOME/var_<JS7_AGENT_HTTP_PORT>
.
JS7_AGENT_CONFIG_DIR
- points to the directory where the Agent finds its configuration.
- Without setting this environment variable the default value is
JS7_AGENT_DATA/config
.
JS7_AGENT_HTTP_PORT
- sets the HTTP port that the Agent is listening to.
- indicates which network interfaces the Agent should listen to if a hostname or IP address is specified.
- if only a port number is specified then the Agent listens to all available network interfaces via HTTP.
- Without setting this environment variable the port defaults to 4445.
JS7_AGENT_HTTPS_PORT
- sets the HTTPS port that the Agent is listening to.
- indicates which network interfaces the Agent should listen to if a hostname or IP address is specified.
- if only a port number is specified then the Agent listens to all available network interfaces via HTTPS.
- Without setting this environment variable the HTTPS protocol is not used.
JS7_AGENT_USER
- sets the user account that the Agent is operated for. This includes running jobs with the permissions of the specified user account.
- This setting is available for Unix systems only. For Windows systems, systems only. For Windows systems, the user account that runs the Windows Service is used.
- Without setting this environment variable the user account that runs the start script Start Script is used.
- Without setting this environment variable the user account that runs the start script is used.
- This setting can be used when running the Agent Start Script on system startup and shutdown configurations that are executed by
root
, e.g. in/etc/init.d
and corresponding locations or withsystemd
.
JS7_AGENT_LOG_DIR
- sets the directory where the Agent log file is created.
- This setting defaults to the sub-directory
logs
in theJS7_AGENT_DATA
directory.
JS7_AGENT_WORK_DIR
- sets the working directory for the jobs started by the Agent, e.g.
${HOME}
or%USERPROFILE%
. - This setting defaults to
JS7_AGENT_HOME
This setting can be used when running the Agent start script in system start-up and shutdown configurations that are executed byroot
, e.g. in/etc/init.d
or corresponding locations.
- sets the working directory for the jobs started by the Agent, e.g.
JS7_AGENT_LOGKILL_DIRSCRIPT
- sets the directory where the Agent log file is created.location of a "kill script" if an individual script is required.
The kill script provides the functionality to kill a task and any child processes of a job.
- Kill scripts are by default provided from the following locations:
This setting defaults to the directorylogs
in theJS7_AGENT_DATA
JS7_AGENT_WORK_DIR
/tmp/kill_task.sh
for Unix.JS7_AGENT_DATA\tmp\kill_task.cmd
for Windows
- sets the working directory for the jobs started by the Agent, e.g. ${HOME} or %USERPROFILE%.
- This setting defaults to
JS7_AGENT_HOME
.
JS7_AGENT_PID_KILLFILE_SCRIPTDIR
- sets the location of a "kill script" if required.
The kill script provides the functionality to kill a task and any child processes.
- Kill scripts are provided by
./bin/jobscheduler_agent_kill_task.sh
for Unix..\bin\jobscheduler_agent_kill_task.cmd
for Windows.
JS7_AGENT_PID_FILE_DIR
- sets the directory where the Agent PID file is created.
- This setting defaults to the directory that is specified with the
JS7_AGENT_LOG_DIR
environment variable or the log directory default value.
Running the Agent
- the directory where the Agent PID file is created.
- This setting defaults to the directory that is specified with the
JS7_AGENT_LOG_DIR
environment variable or the log directory default value.
Running the Agent
- SOS does not recommend to run the JS7 Agent as
root
(for Unix) or asAdministrator
(for Windows).- In fact the Agent can be operated with administrative privileges which leverages to switch to any user account without specifying a password if jobs should be executed for a different user account.
- However, in compliance-aware environments this is considered an unwanted risk and in any other environments this simply is a bad idea.
- For Windows the JS7 Agent can switch to a different user account in a compliant way, see JobScheduler Universal Agent - Running jobs as a different user.
- For Unix use of
sudo
is recommendedSOS does not recommend running the JS7 Agent asroot
(for Unix) or asAdministrator
(for Windows).
Starting the Agent
Code Block | ||
---|---|---|
| ||
agent.cmd|sh start [options] |
...
This command will safely terminate the Agent (recommended).
- The Agent waits for running processes to be completedAgent waits for running processes of any jobs to be completed.
- Using the
--sigkill
command line option will terminate the Agent normally and will kill any running processes.
Code Block | ||
---|---|---|
| ||
agent.cmd|sh abort [options] |
The Agent process is terminated immediately aborted.
- Any running tasks and child processes of jobs are killed immediately with a SIGKILL signal.
- Should tasks use resources such as database connections then they will not be properly closed.
...
Code Block | ||
---|---|---|
| ||
agent.cmd|sh restart [options]|sh restart [options] |
This command will safely restart the Agent (recommended).
- The Agent waits for running processes of any jobs to be completed.
- Using the
--sigkill
command line option will terminate the Agent normally, kill any running processes and restart the Agent.
Checking the Agent Status
...
Should the Agent be up and running then this command will result in some output such as:
Code Block | ||
---|---|---|
| ||
version: 2.0.0-alpha.20210722.2 (2021-07-22) buildId: QQqWYNiJRbqcYqx4iiFWww startedAt: 1626981330629 isTerminating: false system: hostname: agent-2-0-primary distribution: Alpine Linux v3.13 cpuModel: Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHzisTerminating: false system: hostname: agenthost mxBeans: operatingSystem: processCpuLoadavailableProcessors: 2.5630713121704744E-58 availableProcessorssystemLoadAverage: 4 0.0107421875 java: freePhysicalMemorySizeversion: 3116687361.8.0_292 memory: systemCpuLoadmaximum: 0.046373903924522855954728448 committedVirtualMemorySizetotal: 4475301888289931264 totalPhysicalMemorySizefree: 3155517440 java:87118936 systemProperties: java.vendor: Oracle CorporationIcedTea os.arch: amd64 java.runtime.name: OpenJDK Runtime Environment os.version: 23.610.320-220.17957.1.3.el6el7.x86_64 os.name: Linux java.version: 1.8.0_31 version: 1.10.0-SNAPSHOT (6956c56a535d15fcf659f293c42d22dcf92e9e12 2015-07-15 21:23:24+02:00) startedAt: '2015-07-17T08:38:30.516Z' totalTaskCount: 21 currentTaskCount: 0vm.name: OpenJDK 64-Bit Server VM java.version: 1.8.0_292 |
Windows Service Interface
The following information applies to batch headless installation on for Windows systems. For installation with a GUI and user dialog see JobScheduler Universal JS7 - Agent - Installation with Use of Windows Graphical Installer.
The Agent is operable as a Windows Service. The start script of the Agent allows installingto install/removing remove the Windows Service.
Installing the Windows Service
Code Block | ||
---|---|---|
| ||
agent.cmd install-service [--http-port=<number>] [-ip-address=<hostname or ip address>] |
This command installs the Agent's Windows Service. After the installation, you find the Windows Service with the name SOS JS7 Agent -port=<number>
in the Services Manager Console. The Windows service uses the "local system" account.
Warning |
---|
During the service installation, it the installer tries to copy the executable file for the Windows Service to the |
Starting the Windows Service
Code Block | ||
---|---|---|
| ||
agent.cmd start-service [--http-port=<number>] |
This command starts the Windows Service with the name SOS JS7 Agent -port=<number>.
...
Code Block | ||
---|---|---|
| ||
agent.cmd remove-service [--http-port=<number>] |
This command removes the Windows Service. After executing this command you will not find the Windows Service with the name SOS JS7 Agent -port=<number>
in the Services Manager Console any longer.
...
After the installation of the Windows Service you will find the .\service\sos_js7_agent_<http-port>w.exe
file. Start this program to configure the Windows Service.
For example go to the "Startup" tab |