Difference between revisions of "Configuring the Quartz Scheduler"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
 
(30 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==== Configuring the Quartz Scheduler ====
<includeonly>==== Configuring the Quartz Scheduler ====</includeonly>
 
<noinclude>__TOC__</noinclude>
{{Important|
{{Important|
* Quartz must be enabled on one LongJump instance, or LongJump won't run.
* Quartz must be enabled on at least one platform instance, or the platform 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.
* It is recommended that you run Quartz on the back-end servers to avoid any performance issues in the front-end servers.
* If you have multiple 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 Single LongJump Instance=====
=====Enabling Quartz on a Platform Instance=====


1. Edit <tt>longjump_installation/tomcat/webapps/networking/WEB-INF/web.xml</tt>
:1. Enable qrtz_manager_instance = 1. This is available at <tt>{install-dir}/profiles/IS_default/configuration/tomcat/conf/RN/networking.properties</tt>
:2. Edit <tt>{install-dir}/profiles/IS_default/configuration/tomcat/conf/RN/AALSchedulers.xml</tt>


2. Modify the quartz servlet mapping so that:
:4. Add the following information:
:a. The <tt>config-file</tt> parameter points to the Quartz properties file:<br/> <tt>longjump_installation/tomcat/conf/RN/quartz.properties</tt>
::a. Database user name (an admin user)
 
::b. Password for that user
:b. The <tt>start-scheduler-on-load</tt> property is set to <tt>true</tt>, to make sure that quartz is started whenever LongJump starts.
::Example:
 
::{|
:Example:
:{| width="60%"
<pre>
<pre>
<servlet>
<attribute name="org.quartz.dataSource.myDS.URL" value="jdbc:mysql:"/>  
    <servlet-name>
<attribute name="org.quartz.dataSource.myDS.user" value=""/> -- root user
        QuartzInitializer
<attribute name="org.quartz.dataSource.myDS.password" value=""/> -- password
    </servlet-name>
</pre>
|}
{{Note| Do not change the value of <tt>org.quartz.scheduler.instanceName property</tt>.}}


    <display-name>
=====Moving Quartz to Another Platform Instance=====
      Quartz Initializer Servlet
    </display-name>


    <servlet-class>
Suppose you have one application server instance, 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 server. To that, you disable Quartz on the first instance, and start it on the second.
        org.quartz.ee.servlet.QuartzInitializerServlet
    </servlet-class>


    <init-param>
:1. Disable qrtz_manager_instance = 0. This is available {install-dir}/profiles/IS_default/configuration/tomcat/conf/RN/networking.properties
        <param-name>config-file</param-name>
:2. For the second instance, follow the steps above, in [[#Setting up Quartz on a Platform Instance|Setting up Quartz on a Platform Instance]]
        <param-value>C:/apache-tomcat-6.0.20/conf/RN/quartz.properties</param-value>
                        [ ^-- Path to the properties file ]
    </init-param>


    <init-param>
=====Setting up a Quartz Cluster=====
        <param-name>shutdown-on-unload</param-name>
By default, Quartz is pre-configured to run as a cluster of instances running on different servers. To run successfully, however, each server must have the settings shown here. Otherwise, a Quartz instance will not know that the others exist, and will not lock job records that are in progress. Perform this configuration on any server you later add to the cluster.
        <param-value>true</param-value>
    </init-param>


    <init-param>
:1. Open <tt>{install-dir}/profiles/IS_default/configuration/tomcat/conf/RN/AALSchedulers.xml</tt>
        <param-name>start-scheduler-on-load</param-name>
:2. Check this line:
        <param-value>true</param-value>                 
::{|
                    [ ^--Enables Quartz ]
<pre>
    </init-param>
<attribute name="org.quartz.scheduler.instanceId" value="AUTO"          [VERIFY THIS LINE]
 
    <load-on-startup>
        1
    </load-on-startup>
</servlet>
</pre>
</pre>
|}
|}


3. Edit <tt>longjump_installation/tomcat/conf/RN/quartz.properties</tt>
:3. Under <tt># Configure JobStore</tt>, check these lines:
 
::{|
4. Add the following information:
:a. Database user name (an admin user)
:b. Password for that user
:Example:
:{|
<pre>
<pre>
org.quartz.dataSource.myDS.URL = jdbc:mysql://...
...
 
# Configure JobStore
org.quartz.dataSource.myDS.user = rootuser                [database user]
<attribute name="org.quartz.jobStore.misfireThreshold" value="60000"/>          [VERIFY THESE LINES]
 
<attribute name="org.quartz.jobStore.isClustered" value="true"/>
org.quartz.dataSource.myDS.password = password        [database user password]
<attribute name="org.quartz.jobStore.clusterCheckinInterval" value="20000"/>
</pre>
</pre>
|}
|}


=====Moving Quartz to run on Another LongJump Instance=====
In addition, MySQL must be configured to set the appropriate transaction-isolation level and to specify row-based replication:
 
# Edit <tt>{MYSQL_INSTALLATION}/my.cnf</tt>
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.
# Use the following settings:
 
::{|
Here is the procedure:
 
1. Open <tt>longjump_installation/tomcat/webapps/networking/WEB-INF/web.xml</tt>  
 
2. Find the quartz servlet mapping for the first instance:
:{|
<pre>
<pre>
<servlet>
transaction-isolation = READ-COMMITTED
    <servlet-name>
binlog-format = ROW
        QuartzInitializer
    </servlet-name>
 
      ...
 
    <init-param>
        <param-name>start-scheduler-on-load</param-name>
        <param-value>false</param-value>
                      [ ^-Disables Quartz ]
    </init-param>
 
      ...
 
</servlet>
</pre>
</pre>
|}
|}
 
<noinclude>
3. For the second longjump instance, follow the steps in [[#Setting up Quartz on a LongJump Instance|Setting up Quartz on a LongJump Instance]]
 


[[Category:Installation]]
[[Category:Installation]]
</noinclude>

Latest revision as of 11:26, 16 October 2019

Warn.png

Important:

  • Quartz must be enabled on at least one platform instance, or the platform won't run.
  • It is recommended that you run Quartz on the back-end servers to avoid any performance issues in the front-end servers.
  • If you have multiple 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.
Enabling Quartz on a Platform Instance
1. Enable qrtz_manager_instance = 1. This is available at {install-dir}/profiles/IS_default/configuration/tomcat/conf/RN/networking.properties
2. Edit {install-dir}/profiles/IS_default/configuration/tomcat/conf/RN/AALSchedulers.xml
4. Add the following information:
a. Database user name (an admin user)
b. Password for that user
Example:
<attribute name="org.quartz.dataSource.myDS.URL" value="jdbc:mysql:"/> 
<attribute name="org.quartz.dataSource.myDS.user" value=""/> -- root user
<attribute name="org.quartz.dataSource.myDS.password" value=""/> -- password

Notepad.png

Note: Do not change the value of org.quartz.scheduler.instanceName property.

Moving Quartz to Another Platform Instance

Suppose you have one application server instance, 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 server. To that, you disable Quartz on the first instance, and start it on the second.

1. Disable qrtz_manager_instance = 0. This is available {install-dir}/profiles/IS_default/configuration/tomcat/conf/RN/networking.properties
2. For the second instance, follow the steps above, in Setting up Quartz on a Platform Instance
Setting up a Quartz Cluster

By default, Quartz is pre-configured to run as a cluster of instances running on different servers. To run successfully, however, each server must have the settings shown here. Otherwise, a Quartz instance will not know that the others exist, and will not lock job records that are in progress. Perform this configuration on any server you later add to the cluster.

1. Open {install-dir}/profiles/IS_default/configuration/tomcat/conf/RN/AALSchedulers.xml
2. Check this line:
<attribute name="org.quartz.scheduler.instanceId" value="AUTO"          [VERIFY THIS LINE]
3. Under # Configure JobStore, check these lines:
...
# Configure JobStore
<attribute name="org.quartz.jobStore.misfireThreshold" value="60000"/>          [VERIFY THESE LINES]
<attribute name="org.quartz.jobStore.isClustered" value="true"/>
<attribute name="org.quartz.jobStore.clusterCheckinInterval" value="20000"/>

In addition, MySQL must be configured to set the appropriate transaction-isolation level and to specify row-based replication:

  1. Edit {MYSQL_INSTALLATION}/my.cnf
  2. Use the following settings:
transaction-isolation = READ-COMMITTED
binlog-format = ROW