You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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
  • TransferInstallaionSetup: To transfer the setup jar file to the host
    • 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.
    • 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>

 

Installation of the Batch installer for the JobScheduler Universal Agent

Files

Job chain

Job Batch Installer

Installation script

Template for the instance script

The JobScheduler Universal Agent

XSD for installation input file

Example for the installation input file

Starting the update/installation

The job BatchInstaller

Parameters

 

Customizing the installation process

Checking Prerequisites

PerformInstall

The installation script

The installation input File

Using the XML Editor

 

The global sections have the following entries:

EntryDescription
serviceIdThe 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.
licenceThe 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.
servicePortThe port, the agent is listening. For example 4445. You can use the same port for each agent on different hosts.
serviceAllowedHostThe IP address or the host name of the Master JobScheduler.
installPathThe path to install the agent. Recommended value: /opt/sos-berlin.com/jobscheduler.
UserPathPanelElementThe path with the configuration files of the agent. Recommended value: /home/<user>/sos-berlin.com/jobscheduler
ftpSpecifies the ftp file transfer protocol.
ftp.userThe user for the ftp login.
ftp.passwordThe password for the ftp login.
ftp.localDirThe location of the setup files.This is scheduler_agent.jar and the generated xml installation files.
ftp.remoteDirThe location on the server where the setup files should be transferred.
ftp.portThe port for the ftp connection. Default value: 21.
sshSpecifies the ssh connection.
ssh.userThe user for the ssh login.
ssh.passwordThe password if using password authentication.
ssh.sudoPasswordThe password for the sudo user. This can be used in the command to enable the sudo login.
ssh.authMethodThe authentication method can be password or publickey.
ssh.authFileThe authorization file with the key if authMethod is publickey.
ssh.portThe port for the ssh connection. Default value: 22.
ssh.command

The command to perform the installation. The recommended command is:

 echo ${sudo_password} | sudo -S java -jar ${ftp_remote_dir}/scheduler_linux32_agent.jar ${ftp_remote_dir}/${installation_file}

 

Example for xml configuration file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<installations lastRun="2015-11-09 16:11">
 <globals>
 <install_path>/home/test/temp/xxx</install_path>
 <transfer>
 <operation>copy</operation>
 <file_spec>.*\.(sh|gz)$</file_spec>
 <source>
 <host>localhost</host>
 <port></port>
 <protocol>local</protocol>
 <user></user>
 <password></password>
 <dir>C:\Temp\batch_install</dir>
 <ssh_auth_method>ssh_auth_method</ssh_auth_method>
 <ssh_auth_file></ssh_auth_file>
 </source>
 <target>
 <host>192.11.0.116</host>
 <port>22</port>
 <protocol>sftp</protocol>
 <user>test</user>
 <password>12345</password>
 <dir>/home/test/temp/</dir>
 <ssh_auth_method>password</ssh_auth_method>
 <ssh_auth_file></ssh_auth_file>
 </target>
 </transfer>
 <ssh>
 <host>192.11.0.116</host>
 <port>22</port>
 </ssh>
 </globals>
 <installation lastRun="2015-11-09 16:11">
 <install_path></install_path>
 <agent_options>
 <java_home>java home</java_home>
 <java_options>java options</java_options>
 <scheduler_home>scheduler home</scheduler_home>
 <scheduler_http_port>4445</scheduler_http_port>
 <scheduler_ip_address>192.11.0.116</scheduler_ip_address>
 <scheduler_user>scheduler user</scheduler_user>
 <scheduler_log_dir>scheduler log dir</scheduler_log_dir>
 <scheduler_kill_script>scheduler kill script</scheduler_kill_script>
 <scheduler_pid_file_dir>scheduler pid file dir</scheduler_pid_file_dir>
 </agent_options>
 <transfer>
 <operation>copy</operation>
 <file_spec>.*\.(sh|gz)$</file_spec>
 <source>
 <host></host>
 <port></port>
 <protocol></protocol>
 <user></user>
 <password></password>
 <ssh_auth_method>ssh_auth_method</ssh_auth_method>
 <ssh_auth_file></ssh_auth_file>
 </source>
 <target>
 <host></host>
 <port></port>
 <protocol></protocol>
 <user></user>
 <password></password>
 <ssh_auth_method></ssh_auth_method>
 <ssh_auth_file></ssh_auth_file>
 </target>
 </transfer>
 <ssh>
 <user>test</user>
 <password>12345</password>
 <sudo_password>12345</sudo_password>
 <auth_method>password</auth_method>
 <auth_file></auth_file>
 <port>22</port>
 </ssh>
 <postprocessing>
 <command>echo ${ssh.sudo_password} | sudo cp ${install_path}/bin/jobscheduler_agent.sh /etc/init.d/jobscheduler</command>
 <command>echo ${ssh.sudo_password} | sudo update-rc.d jobscheduler defaults</command>
 </postprocessing>
 </installation>
</installations>
  • No labels