The Agent Batch/Update solution comes with a job chain in JobScheduler. It is available starting with release 1.10.2.
The Job AgentBatchInstaller reads a xml configuration file and creates orders for the job chain to setup/update agents. For each agent there is an entry in the configuration file.
The job chain for update/installation of one agent has the four nodes:
CheckPreRequisite
- Checking for the correct java version >= 1.8
- Checking whether JobScheduler Universal Agent already has been installed.
- If so
- Shutting Down a probably running instance
- remove the installation
- If so
TransferInstallaionSetup
: To transfer the setup jar file to the hostThe files, that will be transerfered are specified in globals/transfer/file_spec=.*\.(sh|gz)$
- With this regular expression, these files will be transfered
- The JobScheduler Universal Agent: jobscheduler_unix_universal_agent.1.11.0-SNAPSHOT.tar.gz
- The instancescript: jobscheduler_agent_<port>.sh
- The installation scipt: jobscheduler_universal_agent_install.sh
PerformInstall
: To start the installation using ssh.- Before the installation starts, the preprocessor will create the instancescript.sh from the template jobscheduler_agent_instance_script.txt
- Then the just transfered installation script will be executed
- The installation script will install and start the JobScheduler Universal Agent
- At last the postprocessing commands will be executed
- The postprocessing commands are stored in installation/postprocessing/command
- Three commands will be executed
- The default commands will setup the autostart for JobScheduler Universal Agent on an Ubuntu server
- echo ${ssh.sudo_password} | sudo cp ${install_path}/bin/jobscheduler_agent.sh /etc/init.d/jobscheduler
- echo ${ssh.sudo_password} | sudo update-rc.d jobscheduler defaults
You will find the xsd-schema for the configuration in config/scheduler_universal_agent_installations.xsd
The files have the following structure
- installations
- global
- installation
- installation
In the global entry, you specify the values which are used for all installation items. The installation items can overwrite these values. There is one installation item for each agent. You can make use of substitution in the values of the entries.
Example:
<command>echo ${ssh.sudo_password} | sudo cp ${install_path}/bin/jobscheduler_agent.sh /etc/init.d/jobscheduler</command>
The global sections have the following entries:
Entry | Description |
---|---|
serviceId | The JobScheduler ID of the agent. This ID must be unique. You get a unique value by adding host and port to the value of the ID. |
licence | The license key for the agent. Use the same key as you have used for your main JobScheduler. If you are using the GPL license, copy your default license key from the main JobScheduler sos.ini file into the sos.ini file for the agent. |
servicePort | The port, the agent is listening. For example 4445 . You can use the same port for each agent on different hosts. |
serviceAllowedHost | The IP address or the host name of the Master JobScheduler. |
installPath | The path to install the agent. Recommended value: /opt/sos-berlin.com/jobscheduler . |
UserPathPanelElement | The path with the configuration files of the agent. Recommended value: /home/<user>/sos-berlin.com/jobscheduler |
ftp | Specifies the ftp file transfer protocol. |
ftp.user | The user for the ftp login. |
ftp.password | The password for the ftp login. |
ftp.localDir | The location of the setup files.This is scheduler_agent.jar and the generated xml installation files. |
ftp.remoteDir | The location on the server where the setup files should be transferred. |
ftp.port | The port for the ftp connection. Default value: 21 . |
ssh | Specifies the ssh connection. |
ssh.user | The user for the ssh login. |
ssh.password | The password if using password authentication. |
ssh.sudoPassword | The password for the sudo user. This can be used in the command to enable the sudo login. |
ssh.authMethod | The authentication method can be password or publickey . |
ssh.authFile | The authorization file with the key if authMethod is publickey . |
ssh.port | The port for the ssh connection. Default value: 22 . |
ssh.command | The command to perform the installation. The recommended command is: |
Example for xml configuration file: