The Agent Batch/Update solution comes with a job chain in JobScheduler and the job AgentBatchInstaller.
The Job AgentBatchInstaller reads a xml configuration file and creates orders for the installation job chain to setup/update agents. For each agent there is an entry in the configuration file.
The Parameters for the job chain steps will be set by the job AgentBatchInstaller while reading the xml input file.
FEATURE AVAILABILITY STARTING FROM RELEASE 1.10
The JobScheduler Universal Agent Batch Installer is available starting starting from release 1.10.2.
Universal Agent Batch Installer Job Chain
universal_agent_installer.job_chain.xml
The job chain definitin
The job chain for update/installation of one Agent has the 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 host- Before the transfer starts, the preprocessor will create the instancescript.sh from the template jobscheduler_agent_instance_script.txt
The 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.- The in the step before transfered installation script will be executed
- The installation script will install and start the JobScheduler Universal Agent
- Finally the postprocessing commands will be executed
- The postprocessing commands are stored in installation/postprocessing/command
- Three commands will be executed
- if you have more than three commands, please add the call in the job PerformInstall
- The default commands will setup the autostart for JobScheduler Universal Agent on an Ubuntu server
- echo ${ssh.sudo_password} | sudo -S cp ${install_path}/bin/jobscheduler_agent.sh /etc/init.d/jobscheduler
- echo ${ssh.sudo_password} | sudo -S update-rc.d jobscheduler defaults
Parameters
All jobs have access to the following parameters. These parameters also will be used for the JobScheduler Universal Agent instance script to the options for the start.
Parameter | Description | XML |
---|---|---|
agent_options.scheduler_ip_address | The ip address of the JobScheduler Universal Agents host | installation/agent_options/scheduler_ip_address |
agent_options.scheduler_http_port | The port of the JobScheduler Universal Agent | installation/agent_options/scheduler_http_port |
agent_options.java_home | installation/agent_options/java_home | |
agent_options.java_options | installation/agent_options/java_options | |
agent_options.scheduler_home | If SCHEDULER_HOME is not set, the default will be set. Default: install_path + "/jobscheduler_agent" | installation/agent_options/scheduler_home |
agent_options.scheduler_user | installation/agent_options/scheduler_user | |
agent_options.scheduler_log_dir | installation/agent_options/scheduler_log_dir | |
agent_options.scheduler_kill_script | installation/agent_options/scheduler_kill_script | |
agent_options.scheduler_pid_file_dir | installation/agent_options/scheduler_pid_file_dir | |
host | The ssh ip address of the JobScheduler Universal Agents host | installation/ssh/host |
port | The ssh port of the JobScheduler Universal Agent | installation/ssh/port |
user | The ssh user of the JobScheduler Universal Agent | installation/ssh/user |
auth_method | The ssh auth method of the JobScheduler Universal Agent | installation/ssh/auth_method |
auth_file | The ssh auth file of the JobScheduler Universal Agent | installation/ssh/auth_file |
password | The ssh password of the JobScheduler Universal Agent | installation/ssh/password |
sudo_password | The sudo password for ssh user | installation/ssh/sudo_password |
install_path | The folder, where JobScheduler Universal Agent will be installed | installation/install_path |
TransferInstallationSetup
For more detailed explanation of the parameters have a look at the yade documentaiton.
Please note that it is recommended only to specify the settings file in the globals entry and use the default profile name <host>:<port>. Then the entry installation/transfer is not neccessary in the installation input file
settings | The file with the profiles, one for each JobSchedule Universal Agent | installation/transfert/settings |
profile | The name of the profile for the actual installation. Default=<host>:<port> | installation/transfer/profile |
file_spec | a regular expression that defines the set of files that should be transfered | installation/transfer/file_spec |
target_host | the host to which the files should be transfered | installation/transfer/target/host |
target_port | the port according to the given protocol (e.g. 21 when protocol is ftp) | installation/transfer/target/port |
target_protocol | the protocol with wich the target will be transered (ftp, sftp, file, local) | installation/transfer/target/protocol |
target_user | the user (if the protocol needs one) with wich the target will be transered | installation/transfer/target/user |
target_password | the password (if the protocol needs one) with wich the target will be transered | installation/transfer/target/password |
target_dir | the location where the files will be copied to | installation/transfer/target/dir |
target_ssh_auth_method | the authentication method if the protocol is ssh. | installation/transfer/target/auth_method |
target_ssh_auth_file | the authentication file if the protocol is ssh and auth_method is publickey | installation/transfer/target/auth_file |
source_host | the host from where the files should be transfered | installation/transfer/source/host |
source_port | the port according to the given protocol (e.g. 21 when protocol is ftp) | installation/transfer/source/port |
source | the protocol with wich the source will be transered (ftp, sftp, file, local) | installation/transfer/source/protocol |
source_user | the user (if the protocol needs one) with wich the source will be transered | installation/transfer/source/user |
source_password | the password (if the protocol needs one) with wich the source will be transered | installation/transfer/source/password |
source_dir | the location from where the files will be copied | installation/transfer/source/dir |
source_ssh_auth_method | the authentication method if the protocol is ssh. | installation/transfer/source/auth_method |
source_ssh_auth_file | the authentication file if the protocol is ssh and auth_method is publickey | installation/transfer/source/auth_file |
PerformInstall
For more detailed explanation of the parameters have a look at the jitl ssh job documentaiton
Parameter | Description | XML |
---|---|---|
command_n | n = 0... The commands for the postprocessing. E.g. enabling the autostart of the Universal Agent | installation/postprocessing/command |
command_counter | The number of given command |
Starting the update/installation
The update/installation procedure will be started by running the job AgentBatchInstaller.
The job AgentBatchInstaller
The job AgentBatchInstaller reads the input file and creates orders for each element <installation>
The element <installation> defines the source and the target of the installation files, the port for the JobScheduler Universal Agent and the ssh connection parameters. Please note
- For all elements you can define defaults in the globals section
- You can use variables for the values e.g. ${ssh.host}
- It is recommended to specify the filename of the YADE settings in the globals element and use the default profile name. When doing this, no installation/transfer elements are needed
Parameters
Parameter | Description | Example |
---|---|---|
installation_definition_file | The xml file that contains all parameters for the batch installation | c:\batch\batchinstall.xml |
filter_install_host | A host name if only one order should be created that matches the given host | myAgent |
filter_install_port | A port if only one order should be created that matches the given host | 4445 |
installation_job_chain | The name of the job chain for which the orders should be created | /batch_install_universal_agent/universal_agent_installer |
update | If true an order for all <instances> will be created. If false an order for <instances> that do not have the last_run attribute will be created | true |
Customizing the installation process
You can customize the installation process.
- Changing the script part in the ssh jobs CheckPreRequisite and PerformInstall e.g. if you want to check other prerequisites or execute some commands before or after the installation.
- Changing the installation script jobscheduler_universal_agent_install.sh
- Changing the template for instance start script jobscheduler_agent_instance_script.txt
Checking Prerequisites
The job CheckPreRequisite checks the java version, shutdown a probably running JobScheduler Universal Agent and removes the lib folder from the old installation.
PerformInstall
The job PerformInstall calls the installation script and executes the commands given in the <postprocessing> element.
The installation script
The installation script unzip the installation file and starts the JobScheduler Universal Agent
The installation input File
The installation input file contains a <installation> element for each JobScheduler Universal Agent instance.
The minimum Example for the xml configuration file:
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.
<command>echo ${ssh.sudo_password} | sudo cp ${install_path}/bin/jobscheduler_agent.sh /etc/init.d/jobscheduler</command>
Using the XML Editor
Then XML Editor can be used to manage the installation input file. It is also used th manage the YADE profiles for the transfer of the installation file
The XML Editor is available here: http://www.sos-berlin.com/xml-editor-downloads
After downloading the file, extrac the zip file. Then start "sos.xml.editor.exe"
Open your installtion input file an assign the schema scheduler_universal_agent_installations.xsd
Managing the YADE profiles for the file transfer
Each installation has a profile in the YADE settings file. The default profile name is <host>:<port> where <host> will be substituted with the value in installation/agent_option/scheduler_ip_address and <port> will be substituted with the value in installation/agent_option/scheduler_http_port.
- Please specify the name of the YADE settings file in globals/settings.
- Open the YADE settings file (or create a new one).
- Assign the schema http://www.sos-berlin.com/schema/yade/YADE_configuration_v1.0.xsd
- Add <ProtocolFragments> for each host you want install JobScheduler Universal Agent
- Add <Profile> for each host you want install JobScheduler Universal Agent.
- The default for the profile_id is <host>:<port> If you do not use the default, you have to specify the profile name in the installations input file.
Installation of the Batch Installer for the JobScheduler Universal Agent
Unzip the JobScheduler Universal Agent Batch Installer zip file.
- copy the content of the live folder to the live folder of a JobScheduler instance
- copy the content of the folder batch_install to any folder
- create an installation input file
- adjust the parameter values for the job AgentBatchInstaller
- set the name for settings file in the installation input file (globals/transfer/settings)
- create the YADE settings file
- Add <ProtocolFragments> for each host you want install JobScheduler Universal Agent
- Add a <Profile> for each host you want install JobScheduler Universal Agent.