Friday, April 16, 2010

Installing Open Source Job Scheduler 1.3.6

Open Source Job Scheduler is an open source application for scheduling and monitoring tasks.

Prerequisites
JRE
RDBMS + JDBC driver
Web server with PHP configured
PHP

Versions used
Apache 2.2.8
MySQL 5.0.45
MySQL Connector/J 5.1.10
PHP 5.2.8
JRE 1.6.0_18

Steps
  • Download the zip package from the job scheduler website, http://jobscheduler.sourceforge.net/
  • Create a temporary directory e.g c:\temp\scheduler
  • Unzip the file to the temporary directory e.g. C:\temp\scheduler
  • Open a command prompt
  • Type mysql -h localhost -u root -p
  • Enter the root password
mysql> create database scheduler;
mysql> grant all on scheduler.* to scheduler@localhost identified by "scheduler";
mysql> quit
cd c:\temp\scheduler
java -jar scheduler_win32.jar
  • The setup program will start
  • Change the installation path from program files e.g. to c:\scheduler
  • Be sure to include the managed jobs, database and web interface components when installing
  • Enter other required details and create a copy of the install script at the end.
  • Edit the file apache\conf\httpd.conf and add the following
Alias /scheduler/logs "c:/scheduler/logs"
Alias /scheduler "c:/scheduler/web"

<Directory "c:/scheduler/web">
    AllowOverride None    
    Options Indexes FollowSymLinks ExecCGI
    Order allow,deny
    Allow from all
</Directory>

<Directory "c:/scheduler/logs">
    AllowOverride None    
    Options Indexes FollowSymLinks
    Order allow,deny
    Allow from all
</Directory>
  • Restart apache
  • Using a browser, navigate to localhost/scheduler/index.htm
  • In the login screen enter sos for the unit, admin for username and leave the password blank
  • Review the documents in the c:\scheduler\doc\en folder for information on how to create and manage jobs. The quickstart is a good place to start.

If you get an error after logging in e.g. Error while connecting to the scheduler... or a message like "It could not commit any Job Scheduler to this site for monitoring", try the following.
  • Edit the file c:\scheduler\web\packages\scheduler\sos_scheduler_network.inc.php. Modify the normalize_host function to look as follows.
  function normalize_host( $host ) {
    return gethostbyname($host);
    /*
    $ip = gethostbyname($host);
    if( ereg( '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$', $ip ) ) {
      return gethostbyname(gethostbyaddr($ip));
    } else {
      return '';
    }
    */
  }
  • In the same file also edit the line that sets the ip host to
$this->network_schedulers[$ip_port]['host']= $this->normalize_host(APP_SCHEDULER_HOST);
  • Edit the file c:\scheduler\web\scheduler_monitor.php. Edit the line that sets the ip to
$ip=gethostbyname($spooler_host);


Scheduling Pentaho Data Integration (Kettle) jobs
If scheduling kettle transformations or jobs, the scheduler will think the job has encountered an error because some text is written to stderr and a warning email is sent as a result. To avoid this, when configuring the job, after settting the command parameter, set the ignore stderr parameter to Yes.

Another way to avoid the warning email would be to modify the batch file that runs the job or transformation to redirect stderr to the same file as stdout [using 2>&1]. e.g.
cd C:\Kettle
kitchen.bat /file:"C:\path\job.kjb" > "C:\path\job.log" 2>&1

1 comment:

  1. Quickly becoming a global leader in Java application developments, SpringSource has introduced a comprehensive range of technologies to build, run and manage Java based websites and web applications including Apache and Tomcat Spring Servers and Hyperic Data Manager Centres.

    apache jobs

    ReplyDelete