AgileApps Support Wiki Pre Release

Difference between revisions of "Configuring the Quartz Scheduler"

From AgileApps Support Wiki
imported>Aeric
m (Text replace - 'Category:System Administration' to 'Category:Installation')
 
imported>Aeric
Line 3: Line 3:
{{Important|
{{Important|
* Quartz must be enabled on one LongJump instance, or LongJump won't run.
* Quartz must be enabled on one LongJump instance, or LongJump won't run.
* If you have multiple LongJump instances, Quartz should run on only one of them.  
* If you have multiple LongJump instances, Quartz should run on only one of them, ''unless'' you follow the Quartz clustering instructions below.
* Changing the quartz configuration requires a restart of all Application Servers.}}
* Changing the quartz configuration requires a restart of all Application Servers.}}


=====Setting up Quartz on a LongJump Instance=====
=====Setting up Quartz on a Single LongJump Instance=====


1. Edit <tt>longjump_installation/tomcat/webapps/networking/WEB-INF/web.xml</tt>
1. Edit <tt>longjump_installation/tomcat/webapps/networking/WEB-INF/web.xml</tt>
Line 61: Line 61:
:b. Password for that user
:b. Password for that user
:Example:
:Example:
<!--This was the database URL in the orginal text
jdbc:mysql://{domain}/relationals?zeroDateTimeBehavior=convertToNull
&amp;autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf8
&amp;jdbcCompliantTruncation=false
  &lt;==== if database is on localhost.
-->
:{|
:{|
<pre>
<pre>

Revision as of 17:54, 17 June 2011

Configuring the Quartz Scheduler

Warn.png

Important:

  • Quartz must be enabled on one LongJump instance, or LongJump won't run.
  • If you have multiple LongJump instances, Quartz should run on only one of them, unless you follow the Quartz clustering instructions below.
  • Changing the quartz configuration requires a restart of all Application Servers.
Setting up Quartz on a Single LongJump Instance

1. Edit longjump_installation/tomcat/webapps/networking/WEB-INF/web.xml

2. Modify the quartz servlet mapping so that:

a. The config-file parameter points to the Quartz properties file:
longjump_installation/tomcat/conf/RN/quartz.properties
b. The start-scheduler-on-load property is set to true, to make sure that quartz is started whenever LongJump starts.
Example:
<servlet>
    <servlet-name>
        QuartzInitializer
    </servlet-name>

    <display-name>
       Quartz Initializer Servlet
    </display-name>

    <servlet-class>
        org.quartz.ee.servlet.QuartzInitializerServlet
    </servlet-class>

    <init-param>
        <param-name>config-file</param-name>
        <param-value>C:/apache-tomcat-6.0.20/conf/RN/quartz.properties</param-value>
                         [ ^-- Path to the properties file ]
    </init-param>

    <init-param>
        <param-name>shutdown-on-unload</param-name>
        <param-value>true</param-value>
    </init-param>

    <init-param>
        <param-name>start-scheduler-on-load</param-name>
        <param-value>true</param-value>                  
                     [ ^--Enables Quartz ]
    </init-param>

    <load-on-startup>
         1
    </load-on-startup>
</servlet>

3. Edit longjump_installation/tomcat/conf/RN/quartz.properties

4. Add the following information:

a. Database user name (an admin user)
b. Password for that user
Example:
org.quartz.dataSource.myDS.URL = jdbc:mysql://...

org.quartz.dataSource.myDS.user = rootuser                 [database user]

org.quartz.dataSource.myDS.password = password        [database user password]
Moving Quartz to run on Another LongJump Instance

Let’s say, you have had just one instance of LongJump, and you have decided to add another to handle the traffic volume. And let's say you also decide to move quartz to the new instance, to further reduce the load on the original instance. To that, you disable Quartz on the first instance, and start it on the second.

Here is the procedure:

1. Open longjump_installation/tomcat/webapps/networking/WEB-INF/web.xml

2. Find the quartz servlet mapping for the first instance:

<servlet>
     <servlet-name>
         QuartzInitializer
     </servlet-name>

      ...

     <init-param>
         <param-name>start-scheduler-on-load</param-name>
         <param-value>false</param-value>
                      [ ^-Disables Quartz ]
     </init-param>

      ...

</servlet>

3. For the second longjump instance, follow the steps in Setting up Quartz on a LongJump Instance