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

Compare with Current View Page History

Version 1 Next »

The Agent Batch/Update solution comes with a job chain in JobScheduler. It is available starting with release 1.3.10.

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:

  • TransferInstallaionSetup: To transfer the setup jar file to the host
  • TransferInstallationFile: To transfer the generated xml setup file to the host
  • ShutdownScheduler: To shutdown Job Scheduler if running using ssh.
  • PerformInstall: To start the installation using ssh.

You will find the xsd-schema for the configuration in config/scheduler_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:

 <serviceId>scheduler_agent_${host}_${service_port}</serviceId> 

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="2011-03-04 15:03">
    <globals>
        <licence>aLicenceKey</licence>
        <servicePort>4945</servicePort>
        <serviceAllowedHost>myHost</serviceAllowedHost>
        <installPath>/opt/sos-berlin.com/jobscheduler</installPath>
        <userPathPanelElement>/home/test/sos-berlin.com/jobscheduler</UserPathPanelElement>
        <ftp>
            <localDir>myLocalDir</localDir>
            <remoteDir>/home/test/sample</remoteDir>
        </ftp>
        <ssh>
            <authMethod>password</authMethod>
            <port>22</port>
            <command>echo ${sudo_password} | sudo -S java -jar  ${ftp_remote_dir}/scheduler_linux32_agent.jar  ${ftp_remote_dir}/${installation_file}</command>
        </ssh>
    </globals>
    <installation>
        <licence>aLicenceKey</licence>
        <serviceId>scheduler_agent_${host}_${servicePort}</serviceId>
        <host>sampleHost</host>
        <servicePort>4945</servicePort>
        <installPath>/opt/sos-berlin.com/jobscheduler</installPath>
        <UserPathPanelElement>/home/test/sos-berlin.com/jobscheduler</UserPathPanelElement>
        <serviceAllowedHost>theLocalHost</serviceAllowedHost>
        <ftp>
            <user>test</user>
            <localDir>aLocalDir</localDir>
            <remoteDir>/home/test/sample</remoteDir>
            <password>myPwd</password>
            <port>21</port>
        </ftp>
        <ssh>
            <user>test</user>
            <password>myPwd</password>
            <sudo_password>mySudoPwd</sudo_password>
            <authMethod>password</authMethod>
            <port>22</port>
            <command>echo ${sudo_password} | sudo -S java -jar  ${ftp_remote_dir}/scheduler_linux32_agent.jar  ${ftp_remote_dir}/${installation_file}</command>
        </ssh>
    </installation>
    <installation>
        <licence>aLicenceKey</licence>
        <serviceId>scheduler_agent_${host}_${servicePort}</serviceId>
        <host>wilma</host>
        <servicePort>4946</servicePort>
        <installPath>/opt/sos-berlin.com/jobscheduler</installPath>
        <UserPathPanelElement>/home/test/sos-berlin.com/jobscheduler</UserPathPanelElement>
        <serviceAllowedHost>0.0.0.0</serviceAllowedHost>
        <ftp>
            <user>test</user>
            <localDir>aLocalDir</localDir>
            <remoteDir>/home/test/ur2</remoteDir>
            <password>myPwd</password>
            <port>21</port>
        </ftp>
        <ssh>
            <user>test</user>
            <password>myPwd</password>
            <sudo_password>mySudoPwd</sudo_password>
            <authMethod>password</authMethod>
            <port>22</port>
            <command>echo ${sudo_password} | sudo -S java -jar  ${ftp_remote_dir}/scheduler_linux32_agent.jar   ${ftp_remote_dir}/${installation_file}</command>
        </ssh>
    </installation>
 </installations>
  • No labels