Terracotta Logo (http://www.terracotta.org)

Terracotta 3.2.1 Documentation

Table of Contents •  Back  •  Forward

Terracotta 3.2.1

Support

Services

Training


The content you have selected is available exclusively to Terracotta, Ehcache, and Quartz community members. If you are already a member, please login. If not, please take a moment to become one. Please sign up to join the Terracotta, Ehcache, and Quartz communities. Membership is free and only requires you to complete the form below. In addition to full documentation access, you will also be eligible to attend product briefings, download select early access product releases before the general public, post forum questions, file bug reports, submit patches and receive other member benefits still to come.

Login

 
Login

Register

All fields in bold are required.
(eight characters max)
Title:
City:
State/Province:
Country:
Phone:
Which technologies are you interested in or are already using?
 
Using
 
Hibernate
Ehcache
Distributed Caching
Quartz
Web Sessions Clustering
DSO (Distributed Shared Objects)
Please contact me
about Terracotta products, services, or training:
Please keep me updated on important Terracotta news:
 
Register
registering Register

Account Activated

Congratulations, your account has been activated. Thanks for joining the Terracotta, Ehcache, and Quartz community. You may now login to all of the the community resources, including:

  • forums
  • project issue trackers
  • community content

Account Registration Successful

(But you're not quite done—you still need to validate your account. Please check your email!)

Thanks for joining the Terracotta and Ehcache community. You will recieve an e-mail shortly containing instructions for validating your account and downloading Ehcache EX.

After you validate your account, you will have full access to all Terracotta and Ehcache community resources, such as:

3.1 Terracotta Job Store for Quartz Express Installation

This document shows you how to add Terracotta clustering to an application that is using Quartz. Use this express installation if you have been running your application:

To set up the cluster with Terracotta, you will add a Terracotta JAR to each application and run a Terracotta server array. Except as noted below, you can continue to use Quartz in your application as specified in the Quartz documentation .

To add Terracotta clustering to an application that is using Quartz, follow these steps:

3.1.1 Step 1: Requirements

3.1.2 Step 2: Install Terracotta Job Store for Quartz

To install the Terracotta Job Store for Quartz in your application, add the following JAR files to your application's classpath:

where <version> is the current version of the Quartz-Terracotta JAR and <quartz-version> is the current version of Quartz (1.7.0 or higher). The Enterprise trial kit contains quartz-terracotta-ee-<version>.jar in place of quartz-terracotta-<version>.jar .

If you are using a WAR file, add these JAR files to its WEB-INF/lib directory.

NOTE: Application Servers

Most application servers (or web containers) should work with this installation of the Terracotta Job Store for Quartz. However, note the following:
- GlassFish application server – You must add the following to domains.xml :
<jvm-options>-Dcom.sun.enterprise.server.ss.ASQuickStartup=false</jvm-options>
- WebLogic application server – You must use the supported version of WebLogic.

3.1.3 Step 3: Configure Terracotta Job Store for Quartz

The Quartz configuration file, quartz.properties by default, should be on your application's classpath. If you are using a WAR file, add the Quartz configuration file to WEB-INF/classes or to a JAR file that is included in WEB-INF/lib .

3.1.3a Add Terracotta Configuration

To be clustered by Terracotta, the following properties in quartz.properties must be set as follows:

org.quartz.jobStore.class = org.terracotta.quartz.TerracottaJobStore
org.quartz.jobStore.tcConfigUrl = <path/to/Terracotta/configuration>

The property org.quartz.jobStore.tcConfigUrl must point the client (or application server) at the location of the Terracotta configuration.

TIP: Terracotta Clients and Servers

In a Terracotta cluster, the application server is also known as the client.

The client must load the configuration from a file or a Terracotta server. If loading from a server, give the server’s hostname and its Terracotta DSO port (9510 by default). The following example shows a configuration that is loaded from the Terracotta server on the local host:

org.quartz.jobStore.class = org.terracotta.quartz.TerracottaJobStore
org.quartz.jobStore.tcConfigUrl = localhost:9510

To load Terracotta configuration from a Terracotta configuration file ( tc-config.xml by default), use a path. For example, if the Terracotta configuration file is located on myHost.myNet.net at /usr/local/TerracottaHome , use the full URL along with the configuration file’s name:

org.quartz.jobStore.class = org.terracotta.quartz.TerracottaJobStore
org.quartz.jobStore.tcConfigUrl = file://myHost.myNet.net/usr/local/TerracottaHome/tc-config.xml

3.1.3b Scheduler Instance Name

A Quartz scheduler has a default name configured by the following quartz.properties property:

org.quartz.scheduler.instanceName = QuartzScheduler

Setting this property is not required. However, you can use this property to instantiate and differentiate between two or more instances of the scheduler, each of which then receives a separate store in the Terracotta cluster.

Using different scheduler names allows you to isolate different job stores within the Terracotta cluster (logically unique scheduler instances). Using the same scheduler name allows different scheduler intances to share the same job store in the cluster.

3.1.4 Step 4: Start the Cluster

UNIX/Linux
[PROMPT] ${TERRACOTTA_HOME}/bin/start-tc-server.sh &
Microsoft Windows
[PROMPT] ${TERRACOTTA_HOME}\bin\start-tc-server.bat
  • 2. Start the application servers.
  • 3. Start the Terracotta Developer Console:
UNIX/Linux
[PROMPT] ${TERRACOTTA_HOME}/bin/dev-console.sh &
Microsoft Windows
[PROMPT] ${TERRACOTTA_HOME}\bin\dev-console.bat
  • 4. Connect to the Terracotta cluster.
  • Click Connect... in the Terracotta Developer Console.

Terracotta Developer Console Connection Panel

  • 5. Click the Topology node in the cluster navigation window to see the Terracotta servers and clients (application servers) in the Terracotta cluster.
  • Your console should have a similar appearance to the following figure.

Terracotta Developer Console Showing Clients

3.1.5 Step 5: Edit the Terracotta Configuration

This step shows you how to how run clients and servers on separate machines and add failover (High Availability). You will expand the Terracotta cluster and add High Availability by doing the following:

These tasks bring your cluster closer to a production architecture.

3.1.5a Procedure:

  • 1. Shut down the Terracotta cluster.
  • 2. Create a Terracotta configuration file called tc-config.xml with contents similar to the following:
<?xml version="1.0" encoding="UTF-8"?>
<!-- All content copyright Terracotta, Inc., unless otherwise indicated. 
     All rights reserved.
-->
<tc:tc-config xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-5.xsd" 
xmlns:tc="http://www.terracotta.org/config" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  
  <servers>
    <!-- Sets where the Terracotta server can be found. Replace the value of 
         host with the server's IP address. -->
    <server host="server.1.ip.address" name="Server1">
      <data>%(user.home)/terracotta/server-data</data>
      <logs>%(user.home)/terracotta/server-logs</logs>
    </server>
    <!-- If using a standby Terracotta server, also referred to as an ACTIVE-
         PASSIVE configuration, add the second server here. -->
    <server host="server.2.ip.address" name="Server2">
      <data>%(user.home)/terracotta/server-data</data>
      <logs>%(user.home)/terracotta/server-logs</logs>
    </server>
  </servers>
  <!-- Sets where the generated client logs are saved on clients. -->  
  <clients>
    <logs>%(user.home)/terracotta/client-logs</logs>
  </clients>
</tc:tc-config>
  • 3. Install Terracotta 3.2.1 on a separate machine for each server you configure in tc-config.xml .
  • 4. Copy the tc-config.xml to a location accessible to the Terracotta servers.
  • 5. Perform Step 2: Install Terracotta Job Store for Quartz and Step 3: Configure Terracotta Job Store for Quartz on each application node you want to run in the cluster.
  • Be sure to install your application and any application servers on each node.

  • 6. Edit the org.quartz.jobStore.tcConfigUrl property in quartz.properties to list both Terracotta servers:
org.quartz.jobStore.tcConfigUrl = server.1.ip.address:9510,server.2.ip.address:9510
  • 7. Copy quartz.properties to each application node and ensure that it is on your application's classpath. If you are using a WAR file, add the Quartz configuration file to WEB-INF/classes or to a JAR file that is included in WEB-INF/lib .
  • 8. Start the Terracotta server in the following way, replacing "Server1" with the name you gave your server in tc-config.xml :
UNIX/Linux
 [PROMPT] ${TERRACOTTA_HOME}/bin/start-tc-server.sh -f <path/to/tc-config.xml> -n Server1 &
Microsoft Windows
 [PROMPT] ${TERRACOTTA_HOME}\bin\start-tc-server.bat -f <path\to\tc-config.xml> -n Server1 &

    If you configured a second server, start that server in the same way on its machine, entering its name after the -n flag. The second server to start up becomes the "hot" standby, or PASSIVE. Any other servers you configured will also start up as standby servers.

  • 9. Start all application servers.
  • 10. Start the Terracotta Developer Console and view the cluster.

3.1.6 Step 6: Learn More

To learn more about working with a Terracotta cluster, see the following documents:


Top of 3.1 Terracotta Job Store for Quartz Express Installation