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

Compare with Current View Page History

« Previous Version 7 Next »

Running multiple instances of JobScheduler Universal Agent

  • Multiple instances of the JobScheduler Agent on the same computer can be operated, e.g. for different user accounts that jobs should be executed for.
  • Any number of Agent instances can be started from the same installation, however, different ports have to be used that the Agent is listening to for requests of a JobScheduler Master.
  • Create an instance startscript for each JobScheduler Agent instance.
    • You find a template jobscheduler_agent_instance.(sh|cmd)-example for an instance script in the ./bin directory of the JobScheduler Agent installation since release 1.10.2.
    • Here you can download the templates for Unix and for Windows for releases before 1.10.2.
    • Copy this template to jobscheduler_agent_<port>.(sh|cmd) where <port> is the port that the Agent is listening to.
    • The instance script has first the setting of the environment variables and then it calls the Agent startscript (./bin/jobscheduler_agent.(sh|cmd)).
    • Configure the instance script with a text editor and set the environment variables which are already described in  JobScheduler Universal Agent - Installation & Operation.
  • Now you can start and stop etc. the JobScheduler Agent with the instance script where you no longer need to use command line options like -http-port-ip-address, -kill-script and -java-options because they are specified by the environment variables.
  • On Unix you can use the instance script as a service init script in /etc/init.d or corresponding locations for an automated start-up and shutdown.
  • On Windows the instance script is used to create a service for an automated start-up and shutdown.

Create and configure a JobScheduler Universal Agent instance on Unix

  • We assume that the JobScheduler Agent instance listen to port 4445 for example.

    create instance script for an Agent with port 4445
    > cp ./bin/jobscheduler_agent_instance.sh-example ./bin/jobscheduler_agent_4445.sh
  • Edit the ./bin/jobscheduler_agent_4445.sh.
  • You find the  environment variables  of the JobScheduler Universal Agent.

    • All variables are still undefined in the instance script so that defaults are used.
    • If you want to set a variable then the line with the variable has to be uncommented.

      SCHEDULER_HOME

      This variable has to point to the installation path of the JobScheduler Universal Agent (e.g. /opt/sos-berlin.com/jobscheduler_agent).
      If the instance script is only used in the current ./bin directory then this variable can remain undefined.

      This setting is required if the instance script is used as a service init script in /ect/init.d to find the Agent installation!

      SCHEDULER_USER

      Sets the user account that the JobScheduler Agent is operated for. This includes running jobs with the permissions of the specified user.
      Without setting this environment variable the user account that runs the start script is used.

      This setting is required if the instance script is used as a service init script in /ect/init.d to avoid that the Agent runs with the root user!

      SCHEDULER_HTTP_PORT

      The port of the Agent. It has to be the same value like the suffix in the instance script basename. In this example

      SCHEDULER_HTTP_PORT=4445
      SCHEDULER_LOG_DIR

      Set the directory where the JobScheduler Agent log file is created. The default is SCHEDULER_HOME/logs.
      It is recommended to use the same log directory for all instances. According the Linux Filesystem Hierarchy Standard (FHS) you can set for example

      SCHEDULER_LOG_DIR=/var/log/jobscheduler/agent

      Make sure that the SCHEDULER_USER has read and write permissions in SCHEDULER_LOG_DIR.
      If you use the same SCHEDULER_LOG_DIR for all instances then make sure that the SCHEDULER_USER of all instances has read and write permissions.

      SCHEDULER_PID_FILE_DIR

      Set the directory where the JobScheduler Agent pid file is created. The default is SCHEDULER_LOG_DIR.

      Make sure that the SCHEDULER_USER has read and write permissions in SCHEDULER_PID_FILE_DIR.
      If you use the same SCHEDULER_PID_FILE_DIR for all instances then make sure that the SCHEDULER_USER of all instances has read and write permissions.

      SCHEDULER_WORK_DIR

      The default working directory of the JobScheduler Agent is SCHEDULER_HOME. Here you can set a different working (e.g. $HOME).

    • According the shell you can set the environment variables except SCHEDULER_HOMESCHEDULER_HTTP_PORT and SCHEDULER_USER in a ~/.profile or ~/.bashrc file too.
  • If you want to install a JobScheduler Agent service for an automated start-up and shutdown then copy this instance script to /ect/init.d or corresponding locations.

    create a service init script set automated start-up and shutdown
    > cp ./bin/jobscheduler_agent_4445.sh /etc/init.d/jobscheduler_agent_4445 
    > # on SuSe or CentOS
    > chkconfig jobscheduler_agent_4445
    > # on Ubuntu or Debian
    > update-rc.d jobscheduler_agent_4445 default

Create and configure a JobScheduler Universal Agent instance on Windows

For Windows exists an installer which you can download here. The following describes how you create an instance manually.

  • We assume that the JobScheduler Agent instance listen to port 4445 for example.

    create instance script for an Agent with port 4445
    > copy .\bin\jobscheduler_agent_instance.cmd-example .\bin\jobscheduler_agent_4445.cmd
  • Edit the .\bin\jobscheduler_agent_4445.cmd.
  • You find the  environment variables of the JobScheduler Universal Agent.

    • All variables are still undefined in the instance script so that defaults are used.
    • If you want to set a variable then the line with the variable has to be uncommented.

      SCHEDULER_HOME

      This variable has to point to the installation path of the JobScheduler Universal Agent (e.g. C:\Program Files\sos-berlin.com\jobscheduler_agent).
      This variable is only required if this instance script is moved outside the folder where the startscript .\bin\jobscheduler_agent.cmd is located.
      There is no reason on Windows to move this script to a different folder so this variable can normally remain undefined.

      SCHEDULER_HTTP_PORT

      The port of the Agent. It has to be the same value like the suffix in the instance script basename. In this example

      set /a SCHEDULER_HTTP_PORT=4445
      SCHEDULER_LOG_DIR

      Set the directory where the JobScheduler Agent log file is created. The default is SCHEDULER_HOME/logs.
      It is recommended to use the same log directory for all instances.
      If the installation path of the JobScheduler Agent in C:\Program Files then it is recommended caused by the permissions to set this variable to a different folder, e.g.

      set SCHEDULER_LOG_DIR=C:\ProgramData\sos-berlin.com\jobscheduler\agent\logs

      The JobScheduler Agent is installed as a service. Make sure that the service account has read and write permissions in SCHEDULER_LOG_DIR.
      If you use the same SCHEDULER_LOG_DIR for all instances then make sure that all service accounts have read and write permissions.

      SCHEDULER_PID_FILE_DIR

      Set the directory where the JobScheduler Agent pid file is created. The default is SCHEDULER_LOG_DIR.

      The JobScheduler Agent is installed as a service. Make sure that the service account has read and write permissions in SCHEDULER_PID_FILE_DIR.
      If you use the same SCHEDULER_PID_FILE_DIR for all instances then make sure that all service accounts have read and write permissions.

      SCHEDULER_WORK_DIR

      The default working directory of the JobScheduler Agent is SCHEDULER_HOME. Here you can set a different working (e.g. %USERPROFILE%).

    • create the service with the instance script

      > .\bin\jobscheduler_agent_4445.cmd install-service
    • The service runs now with the local system account. Set a different user account of the service if necessary.
      • For this open the .\service\sos_jobscheduler_agent_4445w.exe, go to the  tab "Log On", choose "This account" and type the account in the form DOMAIN\USER and the corresponding password.

 

  • No labels