Piezo is a system for operating and managing a Quartz Scheduler cluster. The first component is the Worker, which is a driver or main class for running a Quartz instance. The second is the Admin, which is a web interface for administrating a Quartz cluster, including managing which jobs run, and viewing a history of what processing the cluster has completed. The third project in the diagram below is your library containing the actual jobs to run.
Worker is a process that runs a Quartz Scheduler instance.
Worker provides a java main() function for running a quartz scheduler as a daemon. It writes a PID file for help with start and stop (e.g. init.d) scripts. It handles the runtime shutdown event and graceful exits when it receives a shutdown signal (ctrl-c/SIGINT
).
Worker also expands the set of tables that quartz uses with additional tables to track historical job execution data.
You must have sbt 0.13.
sbt worker/compile
compiles sources.
sbt worker/packageBin
creates a JAR.
org.quartz.properties
- Quartz scheduler library config filepidfile.path
- path to file where PID should be written on startupWhen developing
sbt worker/run
This uses the quartz.properties file at the repo root and runs a heatbeat job.
To use to run jobs add com.lucidchart:piezo-worker:<version>
as a dependency to your project, and then run the
com.lucidchart.piezo.Worker class. For example,
java -Dorg.quartz.properties=<path to quartz properties> -Dpidfile.path=<path to pid file> -cp <classpath> com.lucidchart.piezo.Worker
Worker reports statistics to a StatsD server if available.
It also stores historical job execution data in a pair of database tables defined in create_history_tables.sql. These tables should be added to the same datasource as the standard quartz tables.
Admin is a web interface for viewing and managing the scheduled jobs.
You must have sbt 0.13.
sbt admin/debian:packageBin
creates a .deb that includes all library dependencies, and installs piezo-admin as an Upstart service running as piezo-admin
.
org.quartz.properties
- Quartz scheduler library config filelogback.configurationFile
- Logback config filepidfile.path
- path to file where PID should be written on startuphttp.port[s]
- Play Framework production configurationThe properties file must have org.quartz.scheduler.classLoadHelper.class: com.lucidchart.piezo.GeneratorClassLoader
.
When developing,
sbt admin/run
Then go to http://localhost:8001/ to view the admin.
Piezo admin can be installed as a service from a .deb (see Building).
Starting with version 2.0.0, the deb is available on the release page. (See also Issue #91.)
You can install by running
sudo dpkg --install piezo-admin*.deb
By default, it will use /etc/piezo-admin/quartz.properties. Adjust runtime options using /etc/piezo-admin/application.ini:
# -J for for Java options
-J-Xmx1g
# -D for system propertis
-Dorg.quartz.properties=path/to/quartz.properties
# -jvm-debug to enable JVM debugging
-jvm-debug 5005
For deploying to non-Debian platforms, you can use the zip file on the releases page. This is a zip of JARs and contains launcher
scripts in the bin
folder.
You can also create this zip yourself by runing sbt admin/universal:packageBin
which produces the zip at admin/target/universal.