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

Compare with Current View Page History

« Previous Version 71 Next »

Environment

This article describes the use of the JobScheduler Universal Agent Batch Installer in a homogeneous environment. We define a homogeneous environment as one in which a number of JobScheduler Agents will be installed based on the same prerequisites:

  • A JobScheduler Master is up and running.
  • The Agent installations are to be performed on any number of servers that have the same operating system. One Agent is to be installed per server.
  • The Agents will be operated with the same user, listening port and installation path.

The Batch Installer supports:

  • First Installation: an Agent has not yet been installed on the server.
  • Update Installation: an Agent has already been installed and optionally up and running.

Batch Installer Application

The JobScheduler Agents will be installed by a JobScheduler Master that:

  • connects to the Servers that the Agents are to be installed on and
  • executes the corresponding Agent installations.

The Batch Installer application has two main components - a JobScheduler AgentBatchInstaller job  and a JobScheduler universal_agent_installer job chain. Moreover, two XML files batch_installer_config_file.xml and yade_agent_batch_installer_settings.xml are needed for the application. 

The AgentBatchInstaller job is responsible for creating the JobScheduler orders for the job chain. Each of these orders is named according to the pattern <host>:<port> to convey the host and port of the server where the respective Agent is to be installed. 

The universal_agent_installer job chain has four job nodes configured in series as follows:


The individual nodes in the universal_agent_installer job chain have the following functions:

  • CheckPreRequisite

    • Check for the correct Java version.
    • Check whether a JobScheduler Universal Agent has already been installed. If so:
        • shut down the instance if it is running,
        • remove the installation.
  • Sync: To wait until all prerequisites have been checked and any already installed Agent instances that are running have been shut down.
  • TransferInstallationSetup: To transfer the installer files to the host
    • Before the transfer starts, the preprocessor will use the use the jobscheduler_agent_instance_script.txt template to create a start script for the Agent instance
    • The XML file yade_agent_batch_installer_settings.xml has to be configured and converted to .ini file before the transfer starts. See the YADE configuration file for the file transfer chapter below for instructions on how to configure the YADE configuration file and YADE Settings File for the File Transfer for instructions on how the .ini file should look like.
    • The files that will be transfered are specified with the element <globals><transfer><file_spec=".*\.(sh|gz)$">  

    • This regular expression is used to the following files to be transfered:
      • the JobScheduler Universal Agent installation files: jobscheduler_unix_universal_agent.tar.gz
        the jobscheduler_agent_<port>.sh start script for the instance
      • the installation script: jobscheduler_universal_agent_install.sh
  • PerformInstall: The installation is started by SSH.
    • The installation script will install and start the JobScheduler Universal Agent
    • Finally the PerformInstall job post-processing commands will be executed:
      • These commands are specified using the <installation><postprocessing><command> element.
      • The default configuration for a Linux server will place the Agent start script under /etc/init.d and set up the autostart for JobScheduler Universal Agent(example for a Ubuntu distribution):
        • echo ${ssh.sudo_password} | sudo -S cp ${install_path}/jobscheduler_agent/bin/jobscheduler_agent_${agent_options.scheduler_http_port}.sh /etc/init.d/jobscheduler_agent_${agent_options.scheduler_http_port}
        • echo ${ssh.sudo_password} | sudo -S update-rc.d jobscheduler_agent_${agent_options.scheduler_http_port} defaults

Download

The following steps have to be carried out. Files can be downloaded from http://www.sos-berlin.com/jobscheduler-downloads

  1. Unix
    • Download the "JobScheduler Universal Agent" tarball for Unix.
    • Download the "JobScheduler Universal Agent Batch Installer" for Unix. The archive contains the following: 
      • a config/live/batch_installer_agent folder, with the jobs and job chains that are to be extracted to the live folder of the JobScheduler Master: SCHEDULER_DATA/config/live.
      • a config/batch_installer folder containing configuration files for the Batch Installer. These files should be extracted to the config directory of the JobScheduler Master: SCHEDULER_DATA/config.
      • Copy the JobScheduler Universal Agent installation file to the SCHEDULER_DATA/config/batch_installer folder.
  2. Windows
    • Download the "JobScheduler Universal Agent" for Windows.
    • Download the "JobScheduler Universal Agent Batch Installer" for Windows. The archive provides the following content:
      • the config/live/batch_installer_agent folder contains jobs and job chains that should be extracted to the live folder of the JobScheduler Master SCHEDULER_DATA/config/live.
      • the config/batch_installer folder contains configuration files for the Batch Installer that should be extracted to the JobScheduler configuration directory SCHEDULER_DATA/config.
      • Copy the JobScheduler Universal Agent installation file to the folder SCHEDULER_DATA/config/batch_installer.

Configuration

XML files

Configuring XML files with a text editor is error-prone. Therefore we recommend that you download the XML Editor that can be used to manage the configuration files required for the Batch Installer. For details about the XML Editor see the Using the XML Editor chapter below.

  • After downloading the XML Editor, extract the contents of the zip file to a convenient folder (an installation routine is not required) and start the sos.xml.editor.exe program.
  • Open your yade_agent_batch_installer_settings.xml YADE configuration file, which is located in the config/batch_installer folder and assign the XSD schema http://www.sos-berlin.com/schema/yade/YADE_configuration_v1.0.xsd. See the YADE profiles for the file transfer chapter below for instructions on how to configure the YADE configuration file.
  • Open your batch_installer_config_file.xml configuration file in the XML Editor and assign the scheduler_universal_agent_installations.xsd schema: both files are located in the config/batch_installer folder. See the Batch Installer Configuration File chapter below for instructions on how to configure the Batch Installer configuration file.

Hints

  • The  XML Editor is available for Windows.
  • YADE is an Open Source file transfer solution for FTP, SFTP, FTPS, WebDAV and other protocols. Concretely, it will be used here for transferring the following files from the JobScheduler Master to the Agent servers:
    • JobScheduler Universal Agent installation files: jobscheduler_unix_universal_agent.1.11.0-SNAPSHOT.tar.gz
    • Start script for an Agent instance: jobscheduler_agent_<port>.sh
    • Installation script: jobscheduler_universal_agent_install.sh
  • For more information about YADE, see the YADE product site.

JobScheduler Jobs

Once the job and job chain were extracted to the live folder of your JobScheduler Master, please do the following: 

  • AgentBatchInstaller job: adjust the parameter values for the AgentBatchInstaller job in your JobScheduler Master.
    • Adjust the installation_definition_file job parameter with the path that points to the Batch Installer configuration file.

Installation of the Agents

The Agents can be installed after the XML configuration files and JobScheduler jobs have been configured. Start a task for the AgentBatchInstaller job as follows:

  1. Open a JobScheduler Operating Center (JOC) browser window for the JobScheduler master.
  2. Right click on the job to open the context menu.
  3. Select the Start task immediately operation.
  4. This job will create the appropriate JobScheduler orders as explained in the chapter Batch Installer Application.

Example: Installation of two Agents

The following example describes the installation of two Agents on separate servers. First of all, the YADE configuration files (XML file) for the file transfer will be specified, then it will be converted to the YADE settings file (.ini) and finally the Batch Installer configuration file will be specified.

YADE Configuration File for File Transfer

We assume that you  have opened the yade_agent_batch_installer_settings.xml YADE configuration file and have assigned the http://www.sos-berlin.com/schema/yade/YADE_configuration_v1.0.xsd XSD schema. The XML file contains a basic example with recommended values for an Agent installation (of only one Agent).

A separate profile in the YADE configuration file is required for each Agent installation. The default profile name is <host>:<port> where:

  • <host> will be substituted with the value from the <installation><agent_option><scheduler_ip_address> element and
  • <port> will be substituted with the value from the <installation><agent_option><scheduler_http_port> element.

Please take the following steps:

  1. Add a <ProtocolFragments> element and nodes for each host that you want to install the Agent for. The best way to add another <ProtocolFragments> element using the XML Editor is copying the element and pasting it to the parent element - in this case <Fragments>.
  2. Add a <Profile> element and nodes for each host that you want to install the Agent for. The best way to add another <Profile> element using the XML Editor is copying the element and pasting it to the parent element - here <Profiles>.
  3. The default profile_id is <host>:<port>. If you do not use the default then you have to specify the profile name in the Batch Installer configuration file.

An example for the Batch Installer configuration file for the installation of two Agents is attached on this wiki page (download: yade_agent_batch_installer_settings.xml) and might look like this:

YADE Profiles
 <?xml version="1.0" encoding="utf-8"?>
<Configurations xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/schema/yade/YADE_configuration_v1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Fragments>
    <ProtocolFragments>
      <SFTPFragment name="SFTP_192.11.0.111:4445">
        <BasicConnection>
          <Hostname><![CDATA[192.11.0.111]]></Hostname>
        </BasicConnection>
        <SSHAuthentication>
          <Account><![CDATA[test]]></Account>
          <AuthenticationMethodPassword>
            <Password><![CDATA[xxxx]]></Password>
          </AuthenticationMethodPassword>
        </SSHAuthentication>
      </SFTPFragment>
      <SFTPFragment name="SFTP_192.11.0.95:4445">
        <BasicConnection>
          <Hostname><![CDATA[192.11.0.95]]></Hostname>
        </BasicConnection>
        <SSHAuthentication>
          <Account><![CDATA[test]]></Account>
          <AuthenticationMethodPassword>
            <Password><![CDATA[xxxx]]></Password>
          </AuthenticationMethodPassword>
        </SSHAuthentication>
      </SFTPFragment>
    </ProtocolFragments>
  </Fragments>
  <Profiles>
    <Profile profile_id="192.11.0.111:4445">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <LocalSource />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[.*\.(sh|gz)$]]></FileSpec>
                  <Directory><![CDATA[C:\Program Files (x86)\sos-berlin.com\jobscheduler\vg_4444\scheduler_data\config\batch_installer]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <SFTPFragmentRef ref="SFTP_192.11.0.111:4445" />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[/home/test/tmp/]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="192.11.0.95:4445">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <LocalSource />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[.*\.(sh|gz)$]]></FileSpec>
                  <Directory><![CDATA[C:\Program Files (x86)\sos-berlin.com\jobscheduler\vg_4444\scheduler_data\config\batch_installer]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <SFTPFragmentRef ref="SFTP_192.11.0.95:4445" />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[/home/test/tmp/]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
  </Profiles>
</Configurations>

YADE Settings File for File Transfer

Note that the file shown above is an XML file and YADE versions less that 1.11 require a .ini file to perform the transfer that is specified in the <globals><install_path><transfer><settings> element in the Batch Installer configuration file.

.ini file
[protocol_fragment_sftp@SFTP_192.11.0.111:4445]
protocol                            = sftp
host                                = 192.11.0.111
user                                = test
ssh_auth_method                     = password
password                            = xxxx

[protocol_fragment_sftp@SFTP_192.11.0.95:4445]
protocol                            = sftp
host                                = 192.11.0.95
user                                = test
ssh_auth_method                     = password
password                            = xxxx

[192.11.0.111:4445]
operation                           = copy
source_protocol                     = local
file_spec                           = .*\.(sh|gz)$
source_dir                          = C:\Program Files (x86)\sos-berlin.com\jobscheduler\vg_4444\scheduler_data\config\batch_installer
target_include                      = protocol_fragment_sftp@SFTP_192.11.0.111:4445
target_dir                          = /home/test/tmp/

[192.11.0.95:4445]
operation                           = copy
source_protocol                     = local
file_spec                           = .*\.(sh|gz)$
source_dir                          = C:\Program Files (x86)\sos-berlin.com\jobscheduler\vg_4444\scheduler_data\config\batch_installer
target_include                      = protocol_fragment_sftp@SFTP_192.11.0.95:4445
target_dir                          = /home/test/tmp/

Batch Installer Configuration File

We assume that you  have opened the Batch Installer configuration file batch_installer_config_file.xml and assigned the scheduler_universal_agent_installations.xsd XSD schema. The XML file contains a basic example with recommended values for an Agent installation.

The Batch Installer configuration file contains an <installation> element for each Agent instance. In addition, the <global> element can be used in a homogeneous environment to specify parameters that will be applied to all Agent installations. If a parameter is specified in the <global> element and in an individual <installation> element then the setting for the individual element will overwrite the global setting.

The following configuration steps should be carried out:

  1. Specify the Global parameters:
    • Specify the <install_path> to point to a location where the Agent should be installed.
    • Specify the path to the YADE settings file (.ini file) in the Batch Installer configuration file with the element <globals><transfer><settings>. 

    • Specify the credentials for the SSH connection:

      • <user>: SSH login user 
      • <password>: Password for the login user
      • <sudo_password>: Password for sudo actions
      • <auth_method>: SSH authentication method
      • <port>: SSH port 
    • Specify the filename (not the path) for the Agent that has to be installed with the element <installation_file>. This filename contains the version of the Agent which you are installing and it is helpful for recognising this version of the installed versions.

    • Use the <postprocessing> element to specify the post-processing commands that for the Agent server's operating system. The default commands for an Ubuntu distribution will place the Agent start script under /etc/init.d and will setup the autostart for the Universal Agent:
      • echo ${ssh.sudo_password} | sudo -S cp ${install_path}/jobscheduler_agent/bin/jobscheduler_agent_${agent_options.scheduler_http_port}.sh /etc/init.d/jobscheduler_agent_${agent_options.scheduler_http_port}
      • echo ${ssh.sudo_password} | sudo -S update-rc.d jobscheduler_agent_${agent_options.scheduler_http_port} defaults
  2. Specify the installation parameters for each Agent installation:
    • Agent options:
      • <scheduler_user>: Agent user
      • <scheduler_log_dir>: Logs folder for the Agent
    • <host>: SSH Host 

Post-processing commands

  • The SSH login user has to become root in order to execute these commands. Therefore the SSH login user should be included to sudoers.
  • These two commands will be executed by the PerformInstall job node, which is the last job node in the job chain. If you want to add more commands, please add the call to the job node.
  • Note that the values for the elements defined in the Batch Installer configuration file can be used for the postprocessing commands, for instance:

    • ${install_path}: the value for the element <install_path>

    • ${agent_options.scheduler_http_port}: the value for the element <scheduler_http_port>. If not defined, the default value (4445 in this case) is taken, as in the example below.

An example Batch Installer configuration file for the installation of two Agents is attached on this wiki page (download: batch_installer_config_file.xml) and might look like this:

Batch Installer Configuration File
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<installations lastRun="2015-11-20 14:11">
    <globals>
        <install_path>/opt</install_path>
        <transfer>
            <settings>C:\Program Files (x86)\sos-berlin.com\jobscheduler\vg_4444\scheduler_data\config\batch_installer\yade_agent_batch_installer_settings.ini</settings>
        </transfer>
        <ssh>
			<user>test</user>
            <password>xxxx</password>
            <sudo_password>xxxx</sudo_password>
            <auth_method>password</auth_method>
            <port>22</port>
        </ssh>
  	    <installation_file><![CDATA[jobscheduler_unix_universal_agent.1.10.2-SNAPSHOT.tar.gz]]></installation_file>
        <postprocessing>
            <command>echo ${ssh.sudo_password} | sudo -S cp ${install_path}/jobscheduler_agent/bin/jobscheduler_agent_${agent_options.scheduler_http_port}.sh /etc/init.d/jobscheduler_agent_${agent_options.scheduler_http_port}</command>
            <command>echo ${ssh.sudo_password} | sudo -S update-rc.d jobscheduler_agent_${agent_options.scheduler_http_port} defaults</command>
        </postprocessing>
    </globals>
    <installation lastRun="2015-11-20 14:11">
        <agent_options>
            <scheduler_user>test</scheduler_user>
            <scheduler_log_dir>/var/log/sos-berlin.com/jobscheduler/agent</scheduler_log_dir>
        </agent_options>
        <ssh>
            <host>xxxx</host>
        </ssh>
    </installation>
    <installation lastRun="2015-11-20 14:11">
        <agent_options>
            <scheduler_user>test</scheduler_user>
            <scheduler_log_dir>/var/log/sos-berlin.com/jobscheduler/agent</scheduler_log_dir>
        </agent_options>
        <ssh>
            <host>xxxx</host>
        </ssh>
    </installation>
</installations>

 

Hints

  • Note that the port is not specified with the <installations><installation><agent_options><scheduler_http_port> element and causes the global value 4445 to be applied to all Agent installations.

  • For a homogeneous environment parameters can be specified with the <global> element and applied to all Agent installations.

 

Using the XML Editor

The XML Editor can be used to manage the Batch Installer configuration file and the YADE configuration file.

XML Editor for Batch Installer configuration file

An example Batch Installer configuration file for the installation of a single Agent is shown in the following screenshot:

XML Editor for YADE configuration file

An example YADE configuration file for the installation of a single Agent is shown in the next screenshot:

XML Editor for converting YADE configuration files (XML) into YADE setting files (.ini)

The "YADE Xml2Ini Converter" function in the XML Editor is available for converting YADE files from XML to the .ini format required by versions of YADE before 1.11. Clicking on the button of the same name will open the following form:

Note that it is not necessary to create a Profile for the Batch Installer, as conversion will take place automatically once the "Autotransform" option has been chosen. Every time a change in the XML file is saved the XML file will be automatically converted and saved in .ini format. 

A pop-up window will show every time a change is saved if the option "Show notification on autotransform" is chosen. 

  • No labels