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

Compare with Current View Page History

« Previous Version 3 Next »

The Agent Batch/Update solution comes with a job chain in Job Scheduler. It is available with 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 have 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 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:

  • serviceId: The scheduler id of the agent. This 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 model, copy your default license key from the main JobScheduler sos.ini file and use it here.
  • 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 or the host name of the master scheduler.
  • installPath: The path to install the agent. Recommended value is /opt/sos-berlin.com/jobscheduler.
  • UserPathPanelElement: The path with the configuration files of the agent. Recommended value is /home/test/sos-berlin.com/jobscheduler
  • ftp: Specifies the ftp filetransfer
  • 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 is 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. The default is 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}

Sample 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 $\{passwd\} | sudo 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>
            <authMethod>password</authMethod>
            <port>22</port>
            <command>echo $\{passwd\} | sudo 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>
            <authMethod>password</authMethod>
            <port>22</port>
            <command>echo $\{passwd\} | sudo java -jar  $\{ftp_remote_dir\}/scheduler_linux32_agent.jar   $\{ftp_remote_dir\}/$\{installation_file\}</command>
        </ssh>
    </installation>
 </installations>
  • No labels