CloverETL 4.6.x Server Reference Manual
تبلیغات
تبلیغات
CloverETL Server
Reference Manual
CloverETL Server: Reference Manual
This Reference Manual refers to CloverETL Server 4.6.x release.
Copyright © 2017 Javlin, a.s. All rights reserved.
Javlin www.cloveretl.com
www.javlininc.com
Feedback welcome:
If you have any comments or suggestions for this documentation, please send them by e-mail to [email protected]
.
Consider How to speed up communication with CloverCARE support before contacting the support.
Table of Contents
Installation of CloverETL Server License using a Web Form ....................................... 28
iii
CloverETL Server
Executed by HTTP API Run Graph Operation Invocation ......................................... 141
Executed by WS API Method executeGraph Invocation ............................................ 141
Executed by Task "Start a graph" by Graph/Jobflow Event Listener ............................ 141
iv
CloverETL Server
v
CloverETL Server
NodeA Cannot Establish HTTP Connection to NodeB .............................................. 253
NodeA Cannot Establish TCP Connection (Port 7800 by Default) to NodeB .................. 253
Long-Term Network Malfunction May Cause Jobs to Hang on ................................... 255
vi
Part I. CloverETL Server
Chapter 1. What is CloverETL Server?
The CloverETL Server is an enterprise runtime, monitoring, and automation platform for the CloverETL data integration suite. It provides the necessary tools to deploy, monitor, schedule, integrate, and automate data integration processes in large scale and complex projects.
CloverETL Server's HTTP and SOAP Web Services APIs provide additional automation control for integrating the CloverETL Server into existing application portfolios and processes.
The CloverETL Server is a Java application built to J2EE standards. We support a wide range of application servers including Apache Tomcat, Jetty, IBM WebSphere, Sun Glassfish, JBoss AS, and Oracle WebLogic.
2
Chapter 1. What is
CloverETL Server?
Table 1.1. CloverETL Server and CloverETL Engine comparison
CloverETL Server CloverEngine as executable tool
possibilities of executing graphs by calling http (or JMX, etc.) APIs (See
details in Simple HTTP API (p. 202).)
by executing external process or by calling Java API engine initialization during server startup init is called for each graph execution thread and memory optimalization threads recycling, graphs cache, etc.
scheduling scheduling by timetable, trigger, logging included onetime not implemented external tools (i.e. Cron) can be used statistics monitoring each graph execution has its own log file and result status is stored; each event triggered by the CS is logged not implemented
If graph fails, event listener will be notified. It may send an email, execute a shell command or execute another graph. See details in
server implements various APIs (HTTP and JMX) which may be used for monitoring of server/graphs status.
JMX mBean can be used while graph is running storage of graphs and related files graphs are stored on server file system in so called sandboxes security and authorization support
CS supports users/groups management, so each sandbox may have its own access privileges set. All interfaces require authentication. See details in
Chapter 15, Server Side Job Files -
passwords entered by user may be encrypted integration capabilities development of graphs
CS provides APIs which can be called using common protocols like HTTP. See
details in Simple HTTP API (p. 202).
CloverEngine library can be used as embedded library in client's Java code or it may be executed as separated OS process for each graph.
CS supports team cooperation above one project (sandbox). CloverETL Designer is fully integrated with CloverETL
Server (CS).
scalability jobflow
CS implements horizontal scalability of transformation requests as well as
data scalability. See details in Chapter
addition CloverEngine implements is vertical scalability natively.
Clover Engine implements vertical scalability
CS implements various jobflow components. See details in the
CloverETL manual.
Clover Engine itself has limited support of jobflow.
3
Part II. Installation Instructions
Chapter 2. System Requirements for CloverETL
Server
Hardware Requirements
Table 2.1. Hardware requirements of CloverETL Server
RAM
Processors
Disk space (installation)
Disk space (tempspace)
Disk space (data)
Disk space (shared) c
Basic Edition
4 GB
(recommended 16 GB) up to 4 cores
1 GB
> 25 GB b
> 50 GB b
-
Corporate Edition
8 GB
(recommended 64 GB)
16 cores
1 GB
> 25 GB b
> 50 GB b
-
Cluster
8 GB
(recommended 64 GB)
8 cores a
1 GB
> 25 GB b
> 50 GB b
> 50 GB b a
This may vary depending on total number of nodes and cores in license.
b
Minimum value, the disk space depends on data.
c
Disk space for shared sandboxes is required only for CloverETL Cluster.
Software Requirements
Operating system
• Microsoft Windows Server 2003/2008/2012 32/64 bit
• GNU/Linux 64 bit
• Mac OS X
• Unix
• HP-UX
• AIX
• IBM System i (also known as AS/400)
The support for 32 bit Linux was removed in 4.5.0.
Java Virtual Machine
• Oracle JDK 7/8 32/64 bit
• IBM SDK 7 (for IBM WebSphere only)
Application Server
•
Apache Tomcat 6 or 7 or 8 (p. 11)
•
•
•
•
•
Oracle WebLogic 11g (10.3.6) or 12c (12.1.2 or 12.1.3) 32/64 bit (p. 26)
5
Chapter 2. System Requirements for CloverETL Server
Table 2.2. CloverETL Server Compatibility Matrix
CloverETL 3.5
CloverETL 4.0
CloverETL 4.1,
4.2, 4.3, and 4.4
Java 6 and 7 Java 7
CloverETL 4.5
Java 7 Java 8 Java 7 Java 8 Application Server
Tomcat 6
Tomcat 7
Tomcat 8
Pivotal tc Server Standard
(3.1.3, Tomcat 7)
Jetty 6
Jetty 9
WebLogic 11g (10.3.6)
WebLogic 12c (12.1.2)
WebLogic 12c (12.1.3)
JBoss AS 5
JBoss AS 6
JBoss AS 7
Glassfish 2
Glassfish 3
WebSphere 7
WebSphere 8.5
1 2 1 2
1
EAP 6.2
2
EAP 6.4
We support Java 8 on particular supported application server only if the application server itself officially supports
Java 8.
Configuration Repository
We support the following database servers as a configuration repository. The officially supported versions, we are testing against, are in parentheses.
•
•
•
•
SQL Server 2008 (10.0.1600.22) (p. 60)
•
Firewall
• HTTP(S) incoming: Communication between Designer and Server
• JMX incoming: Tracking and debugging information
• Other outgoing: (depending on actual usage)
• JDBC connection to databases (DBInputTable, DBOutputTable, DBExecute)
• MQ (JMSReader, JMSWriter, JMS Listener)
• HTTP(S) (Readers, WebserviceClient, HTTPConnector)
• SMTP (EmailSender)
6
• IMAP/POP3 (EmailReader)
• FTP/SFTP/FTPS (readers, writers)
Chapter 2. System Requirements for CloverETL Server
7
Chapter 3. Installing
The following sections describe two different installation types.
The section
Enterprise Server (p. 11) includes details about further testing and production on your chosen
app-container and database.
To create a fully working instance of Enterprise CloverETL Server you should:
• install an application server
• create a database dedicated to CloverETL server
• set up limit on number of opened files and memory used
• install CloverETL Server into application server
• set up connection to database and mail server (optionally encrypting passwords in configuration files)
• install license
• set up a master password for secure parameters
• configure temp space
• configure sandboxes
8
Chapter 3. Installing
Evaluation Server
The default installation of CloverETL Server does not need any extra database server. It uses the embedded
Apache Derby DB. What is more, it does not need any subsequent configuration. CloverETL Server configures itself during the first startup. Database tables and some necessary records are automatically created on first startup with an empty database.
In the Sandboxes section of the web GUI, you can then check that sandboxes and a few demo graphs are created there.
Note
Default login credentials for CloverETL Server Console:
Username: clover
Password: clover
If you need to evaluate CloverETL Server features which need any configuration changes, e.g. sending e-mails,
LDAP authentication, clustering, etc., or the CloverETL Server must be evaluated on another application container then Tomcat, please proceed with the common installation:
Installation of CloverETL Server
1. Check if you meet prerequisites:
• Oracle JDK or JRE v. 1.7.x or higher (check it with java -version). We recommend JDK 1.8.x.
•
JAVA_HOME
or
JRE_HOME
environment variable has to be set.
Unix-like systems:
Check it with echo $JAVA_HOME and echo $JAVA_HOME commands.
It can be set up in the file
[tomcat]/bin/setenv.sh
from step 2 by inserting line to the beginning of the file, e.g.
export JAVA_HOME=/opt/jdk1.8.0_121
Windows system:
Check it with echo %JAVA_HOME% and echo %JRE_HOME% commands.
It can be set up in the file
[tomcat]/bin/setenv.bat
from step 2 by inserting line to the beginning of the file, e.g.
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
2. Unzip the CloverETLServer.4.5.0.Tomcat-8.0.30.zip
.
Note
We recommend you to place the unzipped content on path that does not contain space character.
Bad:
C:\Program Files
or
/home/user/some dir
Good:
C:\Users\Username
or
/home/user/some_dir
9
Chapter 3. Installing
3. Run Tomcat by
[tomcat_home]/bin/startup.sh
(or
[tomcat_home]/bin/startup.bat
on
Windows OS).
4. Check whether CloverETL Server is running on URLs:
• Web-app root http://[host]:[port]/[contextPath]
In this package, the Tomcat port for the http connector is 8083 and the default contextPath
for CloverETL
Server is "clover", thus the default URL is: http://localhost:8083/clover/
• Web GUI http://[host]:[port]/[contextPath]/gui http://localhost:8083/clover/gui
Use default administrator credentials to access the web GUI: username - "clover", password - "clover".
5. CloverETL Server is now installed and prepared for basic evaluation. There are couple of sandboxes with various demo transformations installed.
10
Chapter 3. Installing
Enterprise Server
This section describes installation of CloverETL Server on various app-containers in detail, also describes the ways how to configure the server. If you need just quickly evaluate CloverETL Server features which don't need
any configuration, evaluation installation may be suitable: Evaluation Server (p. 9)
CloverETL Server for enterprise environment is shipped as a Web application archive (WAR file). Thus standard methods for deploying a web application on you application server may be used. However each application server has specific behavior and features. Detailed information about their installation and configuration can be found in the chapters below.
List of Suitable Containers
•
•
•
•
Glassfish / Sun Java System Application Server (p. 19)
•
JBoss Application Server (p. 20)
•
Oracle WebLogic Server (p. 26)
In case of problems during your installation see Possible Issues during Installation (p. 33).
Apache Tomcat
Installation of Apache Tomcat (p. 11)
Apache Tomcat as a Windows Service (p. 12)
Apache Tomcat on IBM AS/400 (iSeries) (p. 13)
Installation of CloverETL Server (p. 13)
Configuration of CloverETL Server on Apache Tomcat (p. 14)
Installation of Apache Tomcat
If you have Apache Tomcat already installed, you can skip this section.
In case of installation as Windows Service skip this section and continue with
1. Download the binary distribution from http://tomcat.apache.org/download-60.cgi
(Tomcat 6) or http:// tomcat.apache.org/download-70.cgi
(Tomcat 7) or http://tomcat.apache.org/download-80.cgi
(Tomcat 8).
2. After you download the zip file, unpack it.
3. Run Tomcat by
[tomcat_home]/bin/startup.sh
(or
[tomcat_home]/bin/startup.bat
on
Windows OS).
4. Check whether Tomcat is running on URL: http://localhost:8080/ . Apache Tomcat info page should appear.
5. Apache Tomcat is installed.
If you need detailed installation instructions, go to: http://tomcat.apache.org/tomcat-6.0-doc/setup.html
(Tomcat
6) or to http://tomcat.apache.org/tomcat-7.0-doc/setup.html
(Tomcat 7) or to http://tomcat.apache.org/tomcat-8.0doc/setup.html
(Tomcat 8).
Continue with:
Installation of CloverETL Server (p. 13)
In case of installation on IBM AS/400 continue with Apache Tomcat on IBM AS/400 (iSeries) (p. 13).
11
Chapter 3. Installing
Apache Tomcat as a Windows Service
1. Download the binary distribution from http://tomcat.apache.org/download-60.cgi
(Tomcat 6) or http:// tomcat.apache.org/download-70.cgi
(Tomcat 7) or http://tomcat.apache.org/download-80.cgi
(Tomcat 8). Use the file called Windows Service Installer.
2. Use the standard installation wizard to install Apache Tomcat.
Important
The instructions mentioned bellow assume that Tomcat (as a service) is already installed. If this is not true, it is needed to do this first (using of Tomcat's Windows Service Installer is recommended).
Set up
JAVA_HOME
to point to the correct Java version: right click on This computer (or Computer on some Windows versions) and choose Properties
→
Advanced System Settings
→
Advanced
→
Environment
variables. The restart of operating system is needed to apply changes.
In case that Tomcat is installed as a Windows service, CloverETL configuration is performed using configuration of the respective service. The configuration can be performed either by graphical utility
[tomcat_home]/bin/
Tomcat8w.exe
or by command line utility
[tomcat_home]/bin/Tomcat8.exe
.
Graphical configuration utility
When using graphical configuration utility, select Java tab and set initial and maximum heap size in Initial
memory pool and Maximum memory pool fields. Other configuration parameters can be placed in Java Options field, being separated by new line. Then click on Apply and restart the service.
The Java tab allows you to use alternative Java virtual machine by setup of path to jvm.dll
file.
Command line tool
When using command line tool, navigate to [tomcat_home]/bin and stop the service (if running) using
(supposing that service is named "Tomcat8"):
.\Tomcat8.exe //SS//Tomcat8
Then configure service using command:
.\Tomcat8.exe //US//Tomcat8 --JvmMs=512 --JvmMx=1024
--JvmOptions=-Dclover.config.file=C:\path\to\clover-config.properties#-XX:MaxMetaspaceSize=256m
If you use Java 7, change -XX:MaxMetaspaceSize to -XX:MaxPermSize .
The parameter JvmMs is the initial and JvmMx is the maximum heap size in MB, JVM options are separated by
'#' or ';'. Finally start the service from Windows administration console or using:
.\Tomcat8.exe //TS//Tomcat8
When Apache Tomcat is run as a Windows service, it is not automatically available for tools like JConsole or
JVisualVM to attach and monitor Java process. However, those tools can still connect to the process via JMX. In order to expose Tomcat's Java process via JMX add the following options to the service settings:
-Dcom.sun.management.jmxremote.port=3333
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
Once the service is run with those options you can connect to port 3333 using JMX and monitor server.
12
Chapter 3. Installing
Note
The same instructions can be used with Tomcat 6 and tomcat 7, just replace the number 8 with the number 6 or 7.
More information about run of Java applications as Windows Service can be found at http://commons.apache.org/ proper/commons-daemon/procrun.html
Continue with:
Installation of CloverETL Server (p. 13)
Apache Tomcat on IBM AS/400 (iSeries)
To run CloverETL Server on the iSeries platform, there are some additional settings:
1. Declare you are using Java 7.0 32-bit
2. Run Java with parameter
-Djava.awt.headless=true
To configure this you can modify/create a file
[tomcat_home]/bin/setenv.sh
which contains:
JAVA_HOME=/QOpenSys/QIBM/ProdData/JavaVM/jdk70/32bit
JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"
Continue with:
Installation of CloverETL Server (p. 13)
Installation of CloverETL Server
1. Download the web archive file ( clover.war
) containing CloverETL Server for Apache Tomcat.
2. Check if you meet prerequisites:
• Oracle JDK or JRE v. 1.7.x or higher. We recommend JDK 1.8.x.
•
JAVA_HOME
or
JRE_HOME
environment variable has to be set.
• Apache Tomcat 6.0.x or 7.0.x or 8.0.x is installed. CloverETL Server is developed and tested with the Apache
Tomcat 6.0.x, 7.0.x and 8.0.x containers (it may work unpredictably with other versions). See
Installation of Apache Tomcat (p. 11) for details.
• It is strongly recommended you change default limits for the heap
and perm gen
memory spaces.
See section
Memory Settings (p. 38) for details.
You can set the minimum and maximum memory heap size by adjusting the "Xms" and "Xmx" JVM parameters. You can set JVM parameters for Tomcat by setting the environment variable
JAVA_OPTS
in the
[TOMCAT_HOME]/bin/setenv.sh
file (if it does not exist, you may create it).
Create setenv file:
Unix-like systems: [tomcat]/bin/setenv.sh
export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxMetaspaceSize=512m -Xms128m -Xmx1024m" export CATALINA_OPTS="$CATALINA_OPTS -Dderby.system.home=$CATALINA_HOME/temp -server" echo "Using CATALINA_OPTS: $CATALINA_OPTS"
Windows systems:
[tomcat]/bin/setenv.bat
13
Chapter 3. Installing set "CATALINA_OPTS=%CATALINA_OPTS% -XX:MaxMetaspaceSize=512m -Xms128m -Xmx1024m" set "CATALINA_OPTS=%CATALINA_OPTS% -Dderby.system.home=%CATALINA_HOME%/temp -server" echo "Using CATALINA_OPTS: %CATALINA_OPTS%"
If you use Java 7, change
-XX:MaxMetaspaceSize
to
-XX:MaxPermSize
.
As visible in the settings above, there is also switch -server . For performance reasons, it is recommended to run the container in the "server" mode.
3. Copy clover.war
(which is built for Tomcat) to
[tomcat_home]/webapps
directory.
Please note, that copying is not an atomic operation. If Tomcat is running, mind duration of the copying process!
Too long copying might cause failure during deployment as Tomcat tries to deploy an incomplete file. Instead, manipulate the file when the Tomcat is not running.
4. War file should be detected and deployed automatically without restarting Tomcat.
5. Check whether CloverETL Server is running on URLs:
• Web-app root http://[host]:[port]/[contextPath]
The default Tomcat port for the http connector is 8080 and the default contextPath for CloverETL Server is "clover", thus the default URL is: http://localhost:8080/clover/
• Web GUI http://[host]:[port]/[contextPath]/gui
The default Tomcat port for the http connector is 8080 and the default contextPath for CloverETL Server is "clover", thus the default URL is: http://localhost:8080/clover/gui
Use default administrator credentials to access the web GUI: user name - "clover", password - "clover".
Continue with:
Configuration of CloverETL Server on Apache Tomcat (p. 14)
Configuration of CloverETL Server on Apache Tomcat
Default installation (without any configuration) is only recommended for evaluation purposes. For production use, both DB data source and SMTP server configurations are recommended.
The connection to database is configured in property file. On Apache Tomcat, it is
$CATALINA_HOME/ webapps/clover/WEB-INF/config.properties
file.
Properties File on Specified Location
Example of such a file: jdbc.driverClassName=...
jdbc.url=...
jdbc.username=...
jdbc.password=...
jdbc.dialect=...
license.file=/path/to/license.dat
14
Chapter 3. Installing
Properties file is loaded from location specified by a system property or by an environment variable clover_config_file ( clover.config.file
).
On Apache Tomcat, you can set the system property in the
[TOMCAT_HOME]/bin/setenv.sh
file (if it does not exist, you may create it). Just add:
JAVA_OPTS="$JAVA_OPTS -Dclover_config_file=/path/ to/cloverServer.properties"
.
Continue with:
Installation of CloverETL Server License (p. 28)
Jetty
Installation of CloverETL Server (p. 15)
Configuration of CloverETL Server on Jetty (p. 15)
Installation of CloverETL Server
1. Download the web archive file ( clover.war
) containing the CloverETL Server application which is built for Jetty.
2. Check if prerequisites are met:
• Oracle JDK or JRE (See Java Virtual Machine (p. 5) for required Java version.)
• See Application Server (p. 5) in system requirements for currently supported versions of Jetty.
All Jetty releases are available at http://download.eclipse.org/jetty/ .
• Memory allocation settings
It involves JVM parameters: -Xms -Xmx (heap memory) and -XX:MaxMetaspaceSize (classloaders memory limit). See section
Memory Settings (p. 38) for details.
You can set the parameters by adding
JAVA_OPTIONS='$JAVA_OPTIONS -Xms128m -Xmx1024m -XX:MaxMetaspaceSize=256m' to [jetty-home]/bin/jetty.sh
On Windows OS, edit [jetty-home]/start.ini
and add those parameters on the end of the file, each parameter on a new line.
If you use Java 7, change
-XX:MaxMetaspaceSize
to
-XX:MaxPermSize
.
3. Copy clover.war
to
[jetty-home]/webapps
.
4. Run
[jetty-home]/bin/jetty.sh start
(or java -jar start.jar --exec
on Windows
OS).
Finally, you can check if the server is running e.g. on http://localhost:8080/clover/ .
Configuration of CloverETL Server on Jetty
Default installation (without any configuration) is only recommended for evaluation purposes. For production use, both DB data source and SMTP server configurations are recommended.
15
Chapter 3. Installing
There are more ways to set config properties, yet the most common one is a properties file in a specified location.
Properties file in Specified Location
Example of such a file: jdbc.driverClassName=...
jdbc.url=...
jdbc.username=...
jdbc.password=...
jdbc.dialect=...
license.file=/path/to/license.dat
Note
JDBC Driver must be JDBC 4 compliant and stored in the
[jetty-home]/lib/ext
.
The common properties file is loaded from a location which is specified by the environment/system property clover_config_file or clover.config.file
. This is a recommended way of configuring Jetty.
On Unix-like OS, you can set system property in the
[jetty-home]/bin/jetty.sh
file. Add:
JAVA_OPTIONS="$JAVA_OPTIONS -Dclover_config_file=/path/to/cloverServer.properties"
On Windows OS add the property to
[jetty-home]/start.ini
, just after the memory settings.
Continue with:
Installation of CloverETL Server License (p. 28)
IBM WebSphere
Installation of CloverETL Server (p. 16)
Configuration of CloverETL Server on IBM WebSphere (p. 18)
Installation of CloverETL Server
1. Get the web archive file ( clover.war
) with CloverETL Server application which is built for WebSphere.
2. Check if you meet prerequisites:
• IBM Java SDK (See
Java Virtual Machine (p. 5) for required Java version.)
Important
In order to ensure reliable function of CloverETL Server always use the latest version of IBM Java
SDK. At least SDK 7.0 SR6 (package IBM WebSphere SDK Java Technology Edition V7.0.6.1) is recommended. Using older SDKs may lead to deadlocks during execution of specific ETL graphs.
• See
Application Server (p. 5) in system requirements for currently supported version of IBM WebSphere.
(see http://www.ibm.com/developerworks/downloads/ws/was/ )
• Memory allocation settings
It involves JVM parameters: -Xms and -Xmx See section
Memory Settings (p. 38) for details.
You can set heap size in IBM WebSphere's Integrated Solutions Console (by default accessible at: http://[host]:9060/ibm/console/
)
16
Chapter 3. Installing
• Go to Servers →
Server Types
→
WebSphere application servers
→
[server1] (or another name of your server)
→
Java and Process Management
→
Process definition
→
Java Virtual Machine
• There is the Maximum heap size field. Default value is only 256 MB, which is not enough for ETL transformations.
Figure 3.1. Adjusting Maximum heap size limit
• On the same page, there is Generic JVM arguments. Add the perm space limit there, e.g. like this:
-XX:MaxPermSize=512M
Add the direct memory limit, e.g. like this:
-XX:MaxDirectMemorySize=512M
• Java runtime settings
Go to Servers
→
Application servers
→
[server1] (or another name of your server)
→
Java SDKs Here select version 1.7 as the default SDK.
• Save the changes to configuration and restart the server so that they take effect.
3. Deploy WAR file
• Go to Integrated Solutions Console
( http://localhost:9060/ibm/console/ )
• Go to Applications →
New Application
→
New Enterprise Application Here select a WAR archive of the
CloverETL server and deploy it to the application server, but do not start it.
4. Configure application class loading
17
Chapter 3. Installing
Go to WebSphere Enterprise Applications
→
clover_war (or other name of the Clover application)
→
Manage Modules
→
CloverETL Here under Class loader order select Classes loaded with local class
loader first (parent last).
5. Save the changes to the server configuration and start the clover_war application.
6. Check whether the server is running
Provided you set clover.war
as the application running with "clover" context path. Notice the port number has changed: http://localhost:9080/clover
Note
Please note, that some CloverETL features using third party libraries don't work properly on IBM
WebSphere
• Hadoop is guaranteed to run only on Oracle Java 1.6+, but Hadoop developers do make an effort to remove any Oracle/Sun-specific code. See Hadoop Java Versions on Hadoop Wiki.
• AddressDoctor5 on IBM WebSphere, requires additional JVM parameter
-Xmso2048k
to prevent AddressDoctor from crashing JVM. See documentation on AddressDoctor component.
Configuration of CloverETL Server on IBM WebSphere
Default installation (without any configuration) is only recommended for evaluation purposes. For production use, configuring at least the DB data source and SMTP server is recommended.
There are more ways to set config properties. The most common one is a properties file in the specified location.
Properties File in Specified Location
Example of such a file: jdbc.driverClassName=...
jdbc.url=...
jdbc.username=...
jdbc.password=...
jdbc.dialect=...
license.file=/path/to/license.dat
Set system property (or environment variable) clover_config_file
pointing to the config properties file.
• go to Integrated Solutions Console
( http://localhost:9060/ibm/console/ )
• Go to Servers →
WebSphere application servers
→
[server-name]
→
Java and Process Management
→
Process Definition
→
Java Virtual Machine
→
Custom Properties
• Create system property named clover_config_file
whose value is full path to config file named e.g.
cloverServer.properties
on your file system.
• This change requires restarting IBM WebSphere.
Continue with:
Installation of CloverETL Server License (p. 28)
18
Chapter 3. Installing
Glassfish / Sun Java System Application Server
Installation of CloverETL Server (p. 19)
Configuration of CloverETL Server on Glassfish (p. 19)
Important
Glassfish 3.1.2 contains a bug causing Launch Services to work improperly (see https://java.net/jira/ browse/GLASSFISH-18444 ). Use a different version of Glassfish (version 3.1.2.2 is recommended).
Installation of CloverETL Server
1. Get CloverETL Server web archive file ( clover.war
) which is built for Glassfish 3.
2. Check if you meet prerequisites
• Oracle JDK or JRE (See Java Virtual Machine (p. 5) for required java version.)
• Glassfish (CloverETL Server is tested with version 3.1.2.2)
• Memory allocation settings
It involves JVM parameters: -Xms -Xmx and -XX:MaxPermSize See section
You can set the heap size and perm space in XML file
[glassfish-home]/glassfish/domains/ domain1/config/domain.xml
Add or change these sub-elements to
<java-config>
:
<jvm-options>-XX:MaxPermSize=384m</jvm-options>
<jvm-options>-XX:PermSize=256m</jvm-options>
<jvm-options>-Xms512m</jvm-options>
<jvm-options>-Xmx2g</jvm-options>
These changes require restarting Glassfish to take effect.
3. Deploy WAR file
• Open Glassfish Administration Console
It is accessible at http://localhost:4848/ by default.
• Go to Applications →
Web Applications and click Deploy ....
• Upload WAR file with CloverETL server application or select the file from filesystem if it is present on the machine running Glassfish.
• Fill in attributes Application name and Context Root with "clover".
• Submit form.
Configuration of CloverETL Server on Glassfish
Default installation (without any configuration) is only recommended for evaluation purposes. For production use, configuring at least the DB data source and SMTP server is recommended.
There are more ways to set config properties. The most common one is a properties file in the specified location.
19
Chapter 3. Installing
Properties File in Specified Location
Example of such a file: datasource.type=JDBC jdbc.driverClassName=org.postgresql.Driver
jdbc.url=jdbc:postgresql://localhost:5432/cloverdb jdbc.username=root jdbc.password= jdbc.dialect=org.hibernate.dialect.PostgreSQLDialect
license.file=/path/to/license.dat
Set system property clover.config.file
pointing to the config properties file:
• Go to Glassfish Administration Console
By default accessible at http://localhost:4848/
• Go to Configuration →
System Properties
• Create system property named clover.config.file
whose value is a full path to the file on your file system named e.g.
/home/clover/cloverServer.properties
.
Copy the JDBC driver JAR file for a selected database (PostgreSQL) into
[glassfish]/glassfish/ domains/[domain-name]/lib
These changes require restarting Glassfish to take effect.
Continue with:
Installation of CloverETL Server License (p. 28)
JBoss Application Server
Installation of CloverETL Server (p. 20)
Configuration of CloverETL Server on JBoss AS (p. 21)
Installation of CloverETL Server
1. Get CloverETL Server web archive file ( clover.war
) that is built for JBoss AS.
2. Check if you meet prerequisites
• Oracle JDK or JRE (See Java Virtual Machine (p. 5) for required Java version.)
• JBoss AS 6.x http://www.jboss.org/jbossas/downloads
• Memory settings for JBoss Java process. See section
Memory Settings (p. 38) for details.
You can set the memory limits in
[jboss-home]/bin/run.conf
( run.conf.bat
on Windows
OS)
JAVA_OPTS="$JAVA_OPTS -XX:MaxMetaspaceSize=512m -Xms128m -Xmx2048m"
If you use Java 7, change
-XX:MaxMetaspaceSize
to
-XX:MaxPermSize
.
On Windows, perform steps analogic to the ones above.
20
Chapter 3. Installing
3. Create a separate JBoss server configuration
However it may be useful to use a specific JBoss server configuration, when it is necessary to run CloverETL:
• isolated from other JBoss applications
• with a different set of services
• with different libraries on the classpath than other applications
See the JBoss manual for details about the JBoss server configuration: JBoss Server Configurations Start the Server With Alternate Configuration
4. Configure database connection
As CloverETL Server's embedded Derby database does not work under JBoss AS, a database connection has to be always configured. We used MySQL accessed via JNDI-bound datasource in this example:
• Create datasource deployment file
[jboss-home]/server/[serverConfiguration]/ deploy/mysql-ds.xml
<datasources>
<local-tx-datasource>
<jndi-name>CloverETLServerDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/cloverServerDB</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password>root</password>
</local-tx-datasource>
</datasources>
Note
Special characters in the XML file have to be typed in as XML entities. For instance, ampersand
"&" as "&" etc.
"CloverETLServerDS" is the name under which the datasource will be accessible. The thing to do here is to set database connection parameters ( connection-url
, driver-class
, user-name
and password
) to the database. The database has to be empty before the first execution, the server creates its tables on its own.
• Put the JDBC driver JAR file for your database to the application server classpath. In this example we copied the file mysql-connector-java-5.1.5-bin.jar
to
[jboss-home]/server/
[serverConfiguration]/lib
5. Configure CloverETL Server according to the description in the next section (p. 21) .
6. Deploy the WAR file
Copy clover.war
to
[jboss-home]/server/[serverConfiguration]/deploy
7. Start JBoss AS via
[jboss-home]/bin/run.sh
(or run.bat
on Windows OS) If you want to run JBoss with a specific server configuration, it has to be specified as a parameter:
[jboss-home]/bin/run.sh c [serverConfiguration]
If the serverConfiguration isn't specified, the "default" is used.
Configuration of CloverETL Server on JBoss AS
Default installation (without any configuration) does not work under JBoss AS. In order to be able to use the
CloverETL Server, a working database connection is required.
21
Chapter 3. Installing
There are more ways to set configuration properties. The most common one is a properties file in a specified location.
Properties File in Specified Location
• Create cloverServer.properties
in a suitable (i.e. readable by JBoss AS process) directory datasource.type=JNDI datasource.jndiName=java:/CloverETLServerDS jdbc.dialect=org.hibernate.dialect.MySQLDialect
license.file=/home/clover/config/license.dat datasource.type
indicates the server will use JNDI-bound datasource created in steps above. The property datasource.jndiName
specifies where is the datasource to be found in JNDI. Set JDBC dialect according
• Set system property (or environment variable) clover.config.file
.
It should contain the full path to the cloverServer.properties
file created in the previous step.
The simplest way is setting Java parameter in [jboss-home]/bin/run.sh
, e.g.: export JAVA_OPTS="$JAVA_OPTS -Dclover.config.file=/home/clover/config/cloverServer.properties"
Do not override other settings in the
JAVA_OPTS
property - i.e. memory settings described above.
On Windows OS, edit
[jboss-home]/bin/run.conf.bat
and add this line to the section where options are passed to the JVM: set JAVA_OPTS=%JAVA_OPTS% -Dclover.config.file=C:/JBoss6/cloverServer.properties
• Restart the JBoss AS so that the changes take effect.
• Check the CloverETL Server application is running:
Server's console is accessible at http://localhost:8080/clover by default.
Continue with:
Installation of CloverETL Server License (p. 28)
JBoss Enterprise Application Platform
Installation of CloverETL Server (p. 22)
Configuration of CloverETL Server on JBoss EAP (p. 24)
Installation of CloverETL Server
1. Get CloverETL Server web archive file ( clover.war
) which is built for JBoss EAP.
2. Check if you meet prerequisites
• Oracle JDK or JRE (See Java Virtual Machine (p. 5) for required Java version.)
• JBoss EAP 6.x (JBoss AS 7) - see http://www.jboss.org/jbossas/downloads
22
Chapter 3. Installing
• Memory settings for JBoss Java process. See section
Memory Settings (p. 38) for details.
You can set the memory limits in
[jboss-home]/bin/standalone.conf
(
[jboss-home]/ bin/standalone.conf.bar
on Windows OS) for JBoss EAP in standalone mode:
JAVA_OPTS="$JAVA_OPTS -XX:MaxMetaspaceSize=512m -Xms128m -Xmx2048m"
If you use Java 7, change -XX:MaxMetaspaceSize to -XX:MaxPermSize .
On Windows, perform steps analogic to the ones above.
3. Configure database connection
By default CloverETL Server uses embedded Derby database, however such setup is not recommended for production use. You can use database connection provided by JNDI-bound datasource deployed by JBoss EAP. In order to define the datasource, edit the file
[jbosshome]/standalone/configuration/standalone.xml
and into section
<subsystem xmlns="urn:jboss:domain:datasources:1.1">
under element
<datasources>
add definition of the datasource. Here is an example of datasource connecting to MySQL database:
<datasource jndi-name="java:jboss/datasources/CloverETLServerDS"
pool-name="CloverETLServerDS-Pool" enabled="true">
<connection-url>jdbc:mysql://localhost:3307/cloverServerDB</connection-url>
<driver>com.mysql</driver>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<pool>
<min-pool-size>5</min-pool-size>
<max-pool-size>50</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>root</user-name>
<password>root</password>
</security>
<statement>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="com.mysql" module="mysql.driver">
<driver-class>com.mysql.jdbc.Driver</driver-class>
</driver>
</drivers>
4. The datasource definition references a module ( mysql.driver
) with MySQL JDBC driver. Take following steps to add the module:
5. Under JBoss EAP there are more options to setup CloverETL Server's database: along with JNDI-bound data source it is possible to use embedded Derby database or other supported database specified in CloverETL configuration file.
In order to be able to connect to the database, one needs to define global module so that the driver is available for CloverETL web application - copying the driver to the lib/ext
directory of the server will not work. Such module is created and deployed in few steps (the example is for MySQL and module's name is mysql.driver
):
• Create directory
[jboss-home]/modules/mysql/driver/main
(note that the directory path corresponds to module name mysql.driver
)
23
Chapter 3. Installing
• Copy the driver mysql-connector-java-5.1.5-bin.jar
to that directory and create there file module.xml
with following content:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="mysql.driver">
<resources>
<resource-root path="mysql-connector-java-5.1.5-bin.jar" />
</resources>
<dependencies>
<module name="javax.api" />
</dependencies>
</module>
• Add the module to global server modules: in case of the standalone JBoss EAP server they are defined in
[jboss-home]/standalone/configuration/standalone.xml
. The module is to be added into EE domain subsystem section:
<subsystem xmlns="urn:jboss:domain:ee:1.1">
<global-modules>
<module name="mysql.driver" slot="main" />
</global-modules>
<spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
<jboss-descriptor-property-replacement>true</jboss-descriptor-property-replacement>
</subsystem>
6. Configure CloverETL Server according to a description in the next section (p. 24) .
7. Deploy WAR file
Copy the file clover.war
to
[jboss-home]/standalone/deployments
8. Run
[jboss-home]/bin/standalone.sh
(or standalone.bat
on Windows OS) to start the JBoss platform.
It may take a couple of minutes until all applications are started.
9. Check JBoss response and CloverETL Server response
• JBoss administration console is accessible at http://localhost:8080/ by default. Default username/password is admin/admin
• CloverETL Server is accessible at http://localhost:8080/clover by default.
Configuration of CloverETL Server on JBoss EAP
Default installation (without any configuration) is only recommended for evaluation purposes. For production use, configuring at least the database connection and SMTP server connection is recommended.
There are more ways to set config properties. The most common one is a properties file in a specified location.
Properties File in Specified Location
• Create cloverServer.properties
in a directory the JBoss EAP has right to read:
24
Chapter 3. Installing datasource.type=JNDI datasource.jndiName=java:jboss/datasources/CloverETLServerDS jdbc.dialect=org.hibernate.dialect.MySQLDialect
license.file=/home/clover/config/license.dat
). You can set the path to the license file, too.
• Alternatively, you can set "JDBC" datasource.type
and configure the database connection to be managed directly by CloverETL Server (provided that you have deployed proper JDBC driver module to the server): datasource.type=JDBC jdbc.url=jdbc:mysql://localhost:3306/cloverServerDB jdbc.dialect=org.hibernate.dialect.MySQLDialect
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.username=root jdbc.password=root license.file=/home/clover/config/license.dat
• Set system property (or environment variable) clover.config.file
.
It should contain the full path to the cloverServer.properties
file created in the previous step.
The simplest way to set the system property is to edit the configuration file
[jboss-home]/standalone/ configuration/standalone.xml
, and to add the following snippet just under
<extensions> section:
<system-properties>
<property name="clover.config.file" value="C:/jboss-eap-6.2/cloverServer.properties" />
</system-properties>
• Restart the JBoss EAP so that the changes take effect.
• Check the CloverETL Server application is running:
Server's console is accessible at http://localhost:8080/clover by default.
Note
The JBoss EAP has, by default, enabled HTTP session replication. This requires session serialization that is not supported by CloverETL Server, and produces lots of harmless errors in JBoss's console like this:
10:56:38,248 ERROR [org.infinispan.transaction.TransactionCoordinator] (http-/127.0.0.1:8080-2)
ISPN000188: Error while processing a commit in a two-phase transaction: java.lang.UnsupportedOperationException: Serialization of HTTP session objects is not supported by CloverETL Server - disable the session passivation/replication for this web application.
at com.cloveretl.server.web.gui.e.writeExternal(Unknown Source) [cs.jar:]
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:874)
To get rid of these errors, disable the session replication. Edit
[jboss-home]/standalone/ configuration/standalone.xml
and comment out whole
<cache-container name="web" aliases="standard-session-cache">
block under
<subsystem xmlns="urn:jboss:domain:infinispan:1.5">
section.
25
Chapter 3. Installing
Continue with:
Installation of CloverETL Server License (p. 28)
Oracle WebLogic Server
Installation of CloverETL Server (p. 26)
Configuration of CloverETL Server on WebLogic (p. 27)
Installation of CloverETL Server
1. Get CloverETL Server web archive file ( clover.war
) which is built for WebLogic.
2. Check if you meet prerequisites
• Oracle JDK or JRE (See Java Virtual Machine (p. 5) for required Java version.)
• WebLogic (CloverETL Server is tested with WebLogic Server 11g (10.3.6) and WebLogic Server 12c
(12.1.2), see http://www.oracle.com/technetwork/middleware/ias/downloads/wls-main-097127.html)
WebLogic has to be running and a domain has to be configured. You can check it by connecting to
Administration Console: http://hostname:7001/console/ (7001 is the default port for HTTP). Username and password are specified during installation.
• Memory allocation settings
It involves JVM parameters: -Xms -Xmx and -XX:MaxMetaspaceSize
See section
Memory Settings (p. 38) for details.
You can set it i.e. with export JAVA_OPTIONS='$JAVA_OPTIONS -Xms512m -Xmx2048m -XX:MaxMetaspaceSize=512m' to the start script
If you use Java 7, change
-XX:MaxMetaspaceSize
to
-XX:MaxPermSize
.
This change requires restarting the domain.
3. Change HTTP Basic Authentication configuration
• When WebLogic finds "Authentication" header in an HTTP request, it tries to find a user in its own realm.
This behavior has to be disabled so CloverETL could authenticate users itself.
• Modify config file
[domainHome]/config/config.xml
. Add
<enforce-valid-basicauth-credentials>false</enforce-valid-basic-auth-credentials>
element into
<security-configuration>
element (just before the end tag).
4. Deploy a WAR file (or an application directory)
• Get a clover.war suitable for your WebLogic version.
• Deploy the clover.war using the WebLogic Server Administration Console. See the Oracle Fusion
Middleware Administrator's Guide (http://docs.oracle.com/cd/E23943_01/core.1111/e10105/toc.htm) for details.
5. Configure a license and other configuration properties. (See
Configuration of CloverETL Server on
6. Check a CloverETL Server URL
• Web-app is started automatically after deployment, so you can check whether it is up and running.
26
Chapter 3. Installing
CloverETL Server is accessible at http://host:7001/clover by default. The port 7001 is the default WebLogic
HTTP Connector port.
Configuration of CloverETL Server on WebLogic
Default installation (without any configuration) is only recommended for evaluation purposes. For production use, at least the DB data source and SMTP server configuration is recommended.
There are more ways to set config properties. The most common one is a properties file in a specified location.
Properties File in Specified Location
Create cloverServer.properties
in a suitable directory.
Config file should contain DB datasource config, SMTP connection config, etc.
Set clover_config_file
system property (or environment variable) pointing to the config properties file.
• Set JAVA_OPTIONS variable in the WebLogic domain start script
[domainHome]/startWebLogic.sh
JAVA_OPTIONS="${JAVA_OPTIONS} -Dclover_config_file=/path/to/clover-config.properties
• This change requires restarting WebLogic.
Important
When CloverETL Server is deployed on WebLogic and JNDI Datasource pointing to Oracle DB is used, there must be an extra config property in the config file: quartz.driverDelegateClass=org.quartz.impl.jdbcjobstore.oracle.weblogic.WebLogicOracleDelegate
Continue with:
Installation of CloverETL Server License (p. 28)
27
Chapter 3. Installing
Installation of CloverETL Server License
To be able to execute graphs, CloverETL Server requires a valid license. You can install CloverETL Server without any license, but no graph will be executed.
There are three ways of installing the license working on all application servers.
• The simplest way is using 'Add license form' and save the license content to a database. See
CloverETL Server License using a Web Form (p. 28).
• The second way is configuring a license.file
property to set the plain license file. See
CloverETL Server License using a license.file Property (p. 31).
• The last way is a separate web application clover-license.war
. See Separate License WAR (p. 31).
Note
CloverETL license can be changed any time by replacing license.dat
file. Afterwards, you have to let CloverETL Server know the license has changed.
• Go to server web GUI →
Configuration
→
Setup
→
License
• Click Reload license.
• Alternatively, you can restart the CloverETL Server application.
Note
All three ways listed below can be used at the same time. The most recent valid license is used.
Installation of CloverETL Server License using a Web Form
If the CloverETL Server has been started without assigning any license, you can use Add license form in the server gui to install it. In this case the hyperlink No license available in system. Add new license is displayed on the login page. It links to the form.
28
Chapter 3. Installing
Figure 3.2. Login page of CloverETL Server without license
You can paste a license text into License key or use Browse button to search for license file in the filesystem.
After clicking Update button the license is validated and saved to the database table clover_licenses. If the license is valid, a table with license's description appears. To proceed to CloverETL Serve console click Continue to
server console.
To skip adding a license you can use Close button.
29
Chapter 3. Installing
Figure 3.3. Add new license form
Update of CloverETL Server License in the Configuration Section
If the license has been already installed, you can still change it by using form in the server web gui.
• Go to server web GUI →
Configuration
→
CloverETL Info
→
License
• Click Update license.
You can paste a license text into a License key textarea or use the Browse button to search for a license file in the filesystem. To skip adding a license you can use Close button.
After clicking the Update button the license is saved to the database table clover_licenses and reloaded.
30
Chapter 3. Installing
Figure 3.4. Update license form
Note
The license in the database is common for all nodes in the cluster. Reloading of the license occurs on each node in the cluster.
Note
If you assign more valid licenses, the most recent one is used.
Installation of CloverETL Server License using a license.file Property
1. Get the license.dat
file.
2. Set the CloverETL Server license.file
parameter to the path to license.dat
. Set its value to full path to the license.dat
file.
See Chapter 9, List of Properties (p. 70) for list of properties.
3. Restart the application server.
Separate License WAR
Simple approach, but it may be used only for standalone server running on Apache Tomcat.
1. Download the clover-license.war
web archive file.
2. Copy clover-license.war
to the
[tomcat_home]/webapps
directory.
3. The war file should be detected and deployed automatically without restarting Tomcat.
4. Check whether the license web-app is running on:
31
Chapter 3. Installing http://[host]:[port]/clover-license/
(Note: clover-license
contextPath is mandatory and cannot by changed)
IBM InfoSphere MDM Plugin Installation
Downloading
IBM InfoSphere MDM Components for CloverETL Server are downloaded as a ZIP file containing the extension. The ZIP file is available for download under your account on www.cloveretl.com in CloverETL Server download area, under the Utilities section as ibm-mdm-connectors.${version}.zip
file.
Requirements
Requirements of IBM InfoSphere MDM Components:
• supported OS are Microsoft Windows 32 bit, Microsoft Windows 64 bit, Linux 64 bit, and Mac OS X Cocoa
• at least 512MB of RAM
• installed CloverETL Server
The support for 32 bit Linux was removed in 4.5.0.
Installation into Server
The following steps are needed to install IBM InfoSphere MDM Components into CloverETL Server:
1. Install CloverETL Server, see its documentation for details.
2. Download the ZIP file with IBM InfoSphere MDM Components for Server and store it on the system where
CloverETL Server is installed. See
Downloading (p. 32) for instructions for the download.
3. The ZIP file contains a CloverETL plugin. Your Server installation needs to be configured to find and load the plugin from the ZIP file. This is done by setting the engine.plugins.additional.src
Server configuration property to the absolute path of the ZIP file, e.g. engine.plugins.additional.src=c:/Server/ibm-mdm-connectors.4.6.0.zip
(in case the Server is configured via a property file).
Details for setting the configuration property depend on your Server installation specifics, application server used etc. See CloverETL Server documentation for details. Typically the property would be set similarly to how you set-up the properties for connection to the Server's database. Updating the configuration property usually requires restart of the Server.
4. To verify that the plugin was loaded successfully, login to the Server's Reporting Console and look in the Configuration > CloverETL Info > Plugins page. In the list of plugins you should see cloveretl.engine.initiate
.
Troubleshooting
If you get an Unknown component or Unknown connection error when running a graph with IBM
InfoSphere MDM components, it means that the IBM InfoSphere MDM Components plugin was not loaded by the Server successfully. Please check the above steps to install the plugin, especially the path to the ZIP file.
32
Chapter 3. Installing
Possible Issues during Installation
Since CloverETL Server is considered a universal JEE application running on various application servers, databases and jvm implementations, problems may occur during the installation. These can be solved with a proper configuration of the server environment. This section contains tips for the configuration.
Memory Issues on Derby (p. 33)
JAVA_HOME or JRE_HOME Environment Variables Are Not Defined (p. 33)
Apache Tomcat Context Parameters Do Not Have Any Effect (p. 34)
Tomcat Log File catalina.out Is Missing on Windows (p. 34)
Timeouts Waiting for JVM (p. 34)
clover.war as Default Context on WebSphere (Windows OS) (p. 35)
Tomcat 6.0 on Linux - Default DB (p. 35)
Derby.system.home Cannot be Accessed (p. 35)
Environment Variables and More than one CloverETL Server Instances Running on Single Machine (p. 36)
Special Characters and Slashes in Path (p. 36)
File System Permissions (p. 36)
JMS API and JMS Third-Party Libraries (p. 36)
Using an Unsupported JDBC Connector for MySQL (p. 36)
Memory Issues on Derby
If your server suddenly starts consuming too much resources (CPU, memory) despite having been working well before, it might be because of running the internal Derby DB. Typically, causes are incorrect/incomplete shutdown of Apache Tomcat and parallel (re)start of Apache Tomcat.
Solution: move to a standard (standalone) database.
How to fix this? Redeploy CloverETL Server:
1. Stop Apache Tomcat and verify there are no other instances running. If so, kill them.
2. Backup the config file, if you configured any.
3. Delete the webapps/clover
directory.
4. Start Apache Tomcat server. It will automatically redeploy Clover Server.
5. Verify you can connect from Designer and from web.
6. Shutdown Apache Tomcat.
7. Restore the config file and point it to your regular database.
8. Start Apache Tomcat.
JAVA_HOME or JRE_HOME Environment Variables Are Not Defined
If you are getting this error message during an attempt to start your application server (mostly Tomcat), perform the following actions.
Linux:
These two commands will help you set paths to the variables on the server.
• [root@server /] export JAVA_HOME=/usr/local/java
•
[root@server /] export JRE_HOME=/usr/local/jdk
As a final step, restart the application server.
33
Chapter 3. Installing
Windows OS:
Set
JAVA_HOME
to your JDK installation directory, e.g.
C:\Program Files\java\jdk1.8.0
. Optionally, set also
JRE_HOME
to the JRE base directory, e.g.
C:\Program Files\java\jre8
.
Important
If you only have JRE installed, specify only
JRE_HOME
.
Apache Tomcat Context Parameters Do Not Have Any Effect
Tomcat may sometimes ignore some of context parameters. It may cause weird CloverETL Server behaviour, since it looks like configured, but only partially. Some parameters are accepted, some are ignored. Usually it works fine, however it may occur in some environments. Such behaviour is consistent, so after restart it's the same. It's probably related to Tomcat issues: https://issues.apache.org/bugzilla/show_bug.cgi?id=47516 and https://issues.apache.org/bugzilla/show_bug.cgi?id=50700 To avoid this, please use a properties file instead of context parameters to configure CloverETL Server.
Tomcat Log File catalina.out Is Missing on Windows
Tomcat start batch files for Windows aren't configured to create catalina.out file which contains standard output of the application. The catalina.out
file may be vital when the Tomcat isn't started in console and any issue occurs. Or even when Tomcat is executed in the console, it may be closed automatically just after the error message appears in it.
Please follow these steps to enable catalina.out creation:
• Modify [tomcat_home]/bin/catalina.bat. Add parameter "/B" to lines where "_EXECJAVA" variable is set.
There should be two these lines. So they will look like this: set _EXECJAVA=start /B [the rest of the line]
Parameter /B causes, that "start" command doesn't open new console window, but runs the command it's own console window.
• Create new startup file. e.g. [tomcat_home]/bin/startupLog.bat, containing only one line: catalina.bat start > ..\logs\catalina.out 2<&1
It executes Tomcat in the usual way, but standard output isn't put to the console, but to the catalina.out file.
Then use the new startup file instead of
[tomcat_home]/bin/startup.bat
.
Timeouts Waiting for JVM
If you get the Jetty application server successfully running but cannot start Clover Server, it might be because of the wrapper waiting for JVM too long (it is considered a low-memory issue). Examine
[JETTY_HOME]\logs
\jetty-service.log
for a line like this:
Startup failed: Timed out waiting for signal from JVM.
If it is there, edit
[JETTY_HOME]\bin\jetty-service.conf
and add these lines: wrapper.startup.timeout=60 wrapper.shutdown.timeout=60
34
Chapter 3. Installing
If that does not help either, try setting 120 for both values. Default timeouts are 30 both.
clover.war as Default Context on WebSphere (Windows OS)
If you are deploying clover.war
on the IBM WebSphere server without context path specified, be sure to check whether it is the only application running in the context root. If you cannot start Clover Server on WebSphere, check the log and look for a message like this:
com.ibm.ws.webcontainer.exception.WebAppNotLoadedException:
Failed to load webapp: Failed to load webapp: Context root /* is already bound.
Cannot start application CloverETL
If you can see it, then this is the case. Getting rid of the issue, the easiest way is to stop all other (sample) applications and leave only clover.war
running on the server. That should guarantee the server will be available in the context root from now on (e.g. http://localhost:9080/).
Figure 3.5. Clover Server as the only running application on IBM WebSphere
Tomcat 6.0 on Linux - Default DB
When using the internal (default) database on Linux, your Clover Server might fail on first start for no obvious reasons. Chances are that the
/var/lib/tomcat6/databases
directory was not created (because of access rights in parent folders).
Solution: Create the directory yourself and try restarting the server. This simple fix was successfully tested with
Clover Server deployed as a WAR file via Tomcat web admin.
Derby.system.home Cannot be Accessed
If the server cannot start and the following message is in the log: java.sql.SQLException: Failed to start database 'databases/cloverserver'
35
Chapter 3. Installing then see the next exception for details. After that check settings of the derby.system.home
system property.
It may point to an unaccessible directory, or files may be locked by another process. We suggest you set a specific directory as the system property.
Environment Variables and More than one CloverETL Server Instances
Running on Single Machine
If you are setting environment variables like clover_license_file
or clover_config_file
, remember you should not be running more than one CloverETL Server. Therefore if you ever needed to run more
all possibilities) The reason is the environment variable is shared by all applications in use causing them to share configurations and fail unexpectedly. Instead of environment variables you can use system properties (passed to the application container process using parameter with -D prefix: -Dclover_config_file).
Special Characters and Slashes in Path
When working with servers, you ought to stick to folder naming rules more than ever. Do not use any special characters in the server path, e.g. spaces, accents, diacritics are all not recommended. It's unfortunately common naming strategy on Windows systems. It can produce issues which are hard to find. If you are experiencing weird errors and cannot trace the source of them, why not install your application server in a safe destination like:
C:\JBoss6\
Similarly, use slashes but never backslashes in paths inside the
*.properties
files, e.g. when pointing to the
Clover Server license file. If you incorrectly use backlash, it will be considered an escape character and the server may not work fine. This is an example of a correct path: license.file=C:/CoverETL/Server/license.dat
File System Permissions
Application server must be executed by OS user which has proper read/write permissions on file system. Problem may occur, if app-server is executed by root user for the first time, so log and other temp files are created by root user. When the same app-server is executed by another user, it will fail because it cannot write to root's files.
JMS API and JMS Third-Party Libraries
Missing JMS libraries do not cause fail of server startup, but it is issue of deployment on an application server, thus it still suits to this chapter.
clover.war itself does not contain jms.jar, thus it has to be on an application server's classpath. Most of the application servers have jms.jar by default, but e.g. Tomcat does not. So if the JMS features are needed, the jms.jar
has to be added explicitly.
If "JMS Task" feature is used, there must be third-party libraries on a server's classpath as well. The same approach is recommended for JMS Reader/Writer components, even if these components allow to specify external libraries.
It is due to common memory leak in these libraries which causes "OutOfMemoryError: PermGen space".
Using an Unsupported JDBC Connector for MySQL
CloverETL Server requires MySQL 5 up to version 5.5 included. Using an unsupported JDBC connector for
MySQL might cause exception, for example:
36
Chapter 3. Installing could not execute query
You have an error in your SQL syntax; check the manual that coresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT' at line 1
37
Chapter 4. Postinstallation Configuration
Memory Settings
Current implementation of Java Virtual Machine allows only global configuration of memory for the JVM system process. Thus whole application server, together with WARs and EARs running on it, share one memory space.
Default JVM memory settings is too low for running application container with CloverETL Server. Some application servers, like IBM WebSphere, increase JVM defaults themselves, however they still may be too low.
The best memory limits depend on many conditions, i.e. transformations which CloverETL should execute. Please note, that maximum limit isn't amount of permanently allocated memory, but limit which can't be exceeded. If the limit was exhausted, the OutOfMemoryError would be raised.
JVM Memory Areas
JVM memory consists of several areas: Heap memory, PermGen space (for loaded classes), so called direct memory (used by graph edges), and stack memory (allocated for each thread). JVM memory is not just HEAP memory. Thus it's not wise to set HEAP limit too high, since if it consumed whole RAM, JVM wouldn't be able to allocate direct memory and stack for new threads.
Configuring Memory
You can set the minimum and maximum memory heap size by adjusting the "Xms" and "Xmx" JVM parameters.
There are more ways to change the settings depending on the used application container.
Recommended Heap Memory Configuration
If you have no idea about the memory required for the transformations, a maximum of 1-2 GB heap memory is recommended. This limit may be increased during transformations development when
OutOfMemoryError occurs.
Heap limit is not limit of memory used by JVM. If you do not understand JVM in details, you should not assign more than 50% of main memory to heap.
Memory Configuration in Different Java Versions
In Java 7 and earlier, memory space for loading classes (so called "PermGen space") is separated from heap memory, and can be set by the JVM parameter "-XX:MaxPermSize". By default, it is just 64 MB which is not enough for enterprise applications. Again, suitable memory limit depends on various criteria, but 512 MB should be enough in most cases. If the PermGen space maximum is too low,
OutOfMemoryError: PermGen space may occur.
In Java 8, memory space for loading classes (so called "Metaspace") is separated from heap, and can be set by the
JVM parameter -XX:MaxMetaspaceSize. The default maximum Metaspace size is unlimited. You can change it by parameter
-XX:MaxMetaspaceSize
.
Please see the specific container section for details how to make the settings.
Codecache Size
Some clover server installations can occasionally run into performance issue: JVM is running more than hundred times slower. The issue can be caused by a full codecache (https://docs.oracle.com/javase/8/embedded/developapps-platforms/codecache.htm). Reserved code cache size is platform dependent and can be too small for clover server. It is highly recommended to increase code cache size using following JVM argument:
-XX:ReservedCodeCacheSize=256m
38
Chapter 4. Postinstallation
Configuration
Maximum Number of Open Files
When using resource-greedy components, such as FastSort, or when running a large number of graphs concurrently, you may hit the system limit on simultaneously open files. This is usually indicated by the java.io.IOException: Too many open files
exception.
The default limit is fairly low in many Linux distributions (e.g. 4096 in Ubuntu). Such a limit can be easily exceeded, considering that one FastSort component can open up to 1,000 files when sorting 10 million records.
Furthermore, some application containers recommend increasing the limit themselves (8192 for IBM WebSphere).
Therefore it is recommended to increase the limit for production systems. Reasonable limits vary from 10,000 to about 100,000 depending on the expected load of CloverETL Server and the complexity of your graphs.
The current limit can be displayed in most UNIX-like systems using the ulimit -Hn command.
The exact way of increasing the limit is OS-specific and is beyond the scope of this manual.
39
Chapter 5. Upgrading Server to Newer Version
General Notes on Upgrade
• Upgrade of CloverETL Server requires down time; plan a maintenance window
• Successful upgrade requires about 30 minutes; rollback requires 30 minutes
• Performing the below steps in development/testing environment first before moving onto production one
Upgrade Prerequisites
• Having new CloverETL Server web application archive ( clover.war
appropriate for the application server used) & license files available
• Having release notes for particular CloverETL version available (and all version between current and intended version to be upgraded to)
• Having the graphs and jobs updated and tested with regards to Known Issues & Compatibility for particular
CloverETL version.
Configuration Sources and Their Priorities (p. 43)
Connection Configuration (p. 53)
• Having a separate sandbox with test graph that can be run anytime to verify that CloverETL Server runs correctly and allows for running jobs
Upgrade Instructions
1. Suspend all sandboxes, wait for running graphs to finish processing
2. Shutdown CloverETL Server application (or all servers, if they run in cluster mode)
3. Backup existing CloverETL database schema (if any changes to the database schema are necessary, the new server will automatically make them when you start it for the first time)
4. Backup existing CloverETL web application archive ( clover.war
) & license files (on all nodes)
5. Backup existing CloverETL sandboxes (on all nodes)
6. Re-deploy the CloverETL Server web application. Instructions how to do that are application server dependent
your new server will be configured based on the previous version's configuration.
7. Replace old license files by the valid one (or you can later use web GUI form to upload new license). The license file is shipped as a text containing a unique set of characters. If you:
• received the new license as a file (
*.dat
), then simply use it as new license file.
• have been sent the licence text e.g inside an e-mail, then copy the license contents (i.e. all text between
Company
and
END LICENSE
) into a new file called clover-license.dat
. Next, overwrite the old license file with the new one or upload it in the web GUI.
See Installation of CloverETL Server License (p. 28) for details on license installation.
8. Start CloverETL Server application (on all nodes)
40
Chapter 5. Upgrading
Server to Newer Version
9. Review that contents of all tabs in CloverETL Server Console, especially scheduling and event listeners looks
OK.
10.Update graphs to be compatible with the particular version of CloverETL Server (this should be prepared and tested in advance)
11.Resume the test sandbox and run a test graph to verify functionality
12.Resume all sandboxes
Rollback Instructions
1. Shutdown CloverETL Server application
2. Restore CloverETL Server web application ( clover.war
) & license files (on all nodes)
3. Restore CloverETL Server database schema
4. Restore CloverETL sandboxes (on all nodes)
5. Start CloverETL Server application (on all nodes)
6. Resume the test sandbox and run a test graph to verify functionality
7. Resume all sandboxes
Important
Evaluation Version - a mere upgrade of your license is not sufficient. When moving from evaluation to enterprise server, you should not use the default configuration and database. Instead, take some time to configure Clover Server so that it best fits your production environment.
41
Part III. Configuration
We recommend the default installation (without any configuration) only for evaluation purposes. For production use, we recommend configuring a dedicated database and properly configuring the SMTP server for sending notifications.
Chapter 6. Configuration Sources and Their
Priorities
Configuration Sources
There are several sources of configuration properties. If a property isn't set, application default is used.
Warning: Do not combine sources specified below. Configuration becomes confusing and maintenance will be much more difficult.
Environment Variables
Environment variables are variables configured by means of your operating system. E.g.
$PATH
is an environment variable.
Set environment variable with prefix clover.
, i.e. ( clover.config.file
)
Some operating systems may not use dot character, so also underlines (
_
) may be used instead of dots (
.
). So the clover_config_file
works as well.
System Properties
System properties are configured by means of JVM, e.g. with
-D
argument (
-Dclover.config.file
).
Set system property with clover.
prefix, i.e. ( clover.config.file
)
Also underlines (
_
) may be used instead of dots (
.
) so the clover_config_file
works as well.
Properties File on Default Location
Source is a common properties file (text file with key-value pairs):
[property-key]=[property-value]
By default, CloverETL tries to find the config file
[workingDir]/cloverServer.properties
.
Properties File on Specified Location
A file has the same file structure as in case above, but its location is specified with a clover_config_file or clover.config.file
environment variable or system property.
This is the recommended way of configuration if context parameters cannot be set in application server.
Modification of Context Parameters in web.xml
Unzip clover.war
and modify the
WEB-INF/web.xml
file. Add the following piece of code into the file:
<context-param>
<param-name>[property-name]</param-name>
<param-value>[property-value]</param-value>
</context-param>
43
Chapter 6. Configuration
Sources and Their Priorities
This way isn't recommended, but it may be useful when none of approaches above ways is possible.
Context Parameters (Available on Apache Tomcat)
Some application servers allow you to set context parameters without modification of a WAR file.
This way of configuration is possible, but is it not recommended, as Apache Tomcat may ignore some of context parameters in some environments. Use of a properties file is almost as convenient and much more reliable way.
Example for Apache Tomcat
On Tomcat, it is possible to specify context parameters in a context configuration file.
[tomcat_home]/conf/
Catalina/localhost/clover.xml
which is created automatically just after deployment of a CloverETL
Server web application.
You can specify a property with adding this element:
<Parameter name="[propertyName]" value="[propertyValue]" override="false" />
Priorities of Configuration Sources
Configuration sources have these priorities:
1. context parameters (specified in an application server or directly in a web.xml
file)
2. external config file; CS tries to find it in this order. Only one of them is loaded.
• path specified with a config.file
context parameter
• path specified with a clover_config_file or clover.config.file
system property.
• path specified with a clover_config_file or clover.config.file
environment variable.
• default location ( [workingDir]/cloverServer.properties
)
3. system properties
4. environment variables
5. default values
44
Chapter 7. Setup
CloverETL Server Setup helps you with configuration of CloverETL server. Instead of typing the whole configuration file in a text editor, the Setup generates content of the configuration file according to your instructions. It let you set up License and configure Database Connection, LDAP Connection, SMTP Server
Connection, Sandbox Paths, Encryption and Cluster Configuration.
The Setup is accessible from Server Console under Configuration
→
Setup.
Using Setup
If you start an unconfigured server, you can see decorators pointing to the Setup. The decorators mark problems to be solved. The displayed number corresponds to the number of items.
•
•
The following states mean error as mentioned in the text above:
error
warning
• restart required
Setup will help you with solving the problems.
Path to the Configuration File
Firstly, you have to configure a path to a configuration file. Without this, the Setup does not know, to which file the configuration should be saved. Each application server has different way to configure it.
Apache Tomcat
Edit bin/setenv.sh
(or bin/setenv.bat
) and add
-Dclover.config.file=/absolute/path/ to/cloverServer.properties
to
CATALINA_OPTS
.
See also Apache Tomcat (p. 11).
Jetty
Edit bin/jetty.sh
and add cloverServer.properties
to
JAVA_OPTS
.
-Dclover.config.file=/absolute/path/to/
45
Chapter 7. Setup
Glassfish
Add clover.config.file
property in application server GUI (accessible on http://localhost:4848). The property can be added under Configuration
→
System Properties.
See also Glassfish / Sun Java System Application Server (p. 19).
JBoss
See also JBoss Application Server (p. 20).
WebSphere
See also IBM WebSphere (p. 16).
WebLogic
See also Oracle WebLogic Server (p. 26).
Adding Libraries to Classpath
Secondly, you should configure connection to a database.
Place necessary libraries to a suitable directory. You usually need a jdbc driver for connection to a database or a .jar file with an encryption provider.
Having added the libraries restart the application server and configure Clover Server using Setup.
46
Chapter 7. Setup
Configuring Particular Items
Use Setup. Items configured in Setup are saved into a file defined with clover.config.file
.
If you need encryption, configure the Encryption first.
Configure connection to database and then update license. Later, you can configure other setup items.
Some Setup items (Database and Cluster) require restart of an application server. The latter items (License,
Sandboxes, E-mail, LDAP) do not need restarting; the changes to them are applied immediately. If you change something in a Configuration file tab, restart it or not depending on the updated part of the file.
As the last step, restart the server to use the new configuration.
Setup Tabs
Each setup page consists of a menu with setup tabs on the left, a main configuration part in the middle and a configuration status and a text on the right side.
Menu tabs have icons surrounding the text: a tick marks a configured tab, a wheel marks an inactive tab, a floppy disk marks a configuration that needs saving. Arrows signalize request on restart.
The main configuration part contains several buttons:
Discard Changes discards unsaved changes and returns to currently used values.
Save checks the configuration. If the configuration is valid, it is saved to the configuration file. If the configuration is not valid, Save Anyway button appears. The Save Anyway button allows you to save the configuration considered as invalid. E.g. Database connection is considered invalid if there is a required library missing. If you see Save disabled, use Validate to validate the configuration first.
Validate validates the configuration on a current tab.
Configuration File
Configuration tab displays content of a configuration file. You do not have to edit the content of the file manually, use the particular tab to configure the corresponding subsystem.
License
License tab let you specify license. The license is stored in database.
You should configure database before specifying license. Otherwise, you will have to specify the license twice.
47
Chapter 7. Setup
Database
Database tab let you configure connection to database. You can connect via JDBC.
Or you can use JNDI to access the datasource on an application server level. Choose a suitable item of a JNDI tree.
Sandboxes
Sandboxes let you configure path to sandboxes: shared, local, partitioned.
48
Chapter 7. Setup
Encryption
Encryption tab let you enable encryption of sensitive items of the configuration file. You can choose an encryption provider and an encryption algorithm. An alternative encryption provider can be used; the libs have to be added to classpath . (In the same way as database libraries.)
Save & Encrypt button saves the configuration and encrypts the passwords.
E-mail tab let you configure connection to SMTP server. The connection is necessary for reporting event on server via e-mails.
E-mail configuration can be tested with sending an e-mail from the dialog.
49
Chapter 7. Setup
LDAP
LDAP tab let you use an existing LDAP database for user authentication.
50
Chapter 7. Setup
Firstly, you should specify connection to the LDAP server. Secondly, define pattern for user DN. The login can be validated using any user matching the pattern.
See also LDAP Authentication (p. 93).
Cluster
Cluster tab let you configure clustering features.
51
Chapter 7. Setup
Note
You can use the setup in a fresh installation of CloverETL Server, even if it had not been activated yet: log in into Server Console and use Close button to access the menu.
To access Setup section, you need a Server Setup permission. See Server Setup permission (p. 110).
52
Chapter 8. Examples of DB Connection
Configuration
In standalone deployment (non-clustered), configuration of DB connection is optional, since embedded Apache
Derby DB is used by default and it is sufficient for evaluation. However, configuration of external DB connection is strongly recommended for production deployment. It is possible to specify common JDBC DB connection attributes (URL, username, password) or JNDI location of DB DataSource.
In clustered deployment, at least one node in cluster must have DB connection configured. Other nodes may have their own direct connection (to the same DB) or may use another node as proxy for persistent operations, however
feature, this section describes only direct DB connection configuration.
DB Configurations and their changes may be as follows:
•
•
•
•
•
•
•
See Configuration Repository (p. 6) for officially supported versions of particular databases.
53
Chapter 8. Examples of DB
Connection Configuration
Embedded Apache Derby
Apache Derby embedded DB is used with default CloverETL Server installation. It uses working directory as a storage directory for data persistence by default. This may be a problem on some systems. In case of any problems with connecting to Derby DB, we recommend you configure connection to external DB or at least specify Derby home directory:
Set derby.system.home
system property to set path which is accessible for application server. You can specify this system property with this JVM execution parameter:
-Dderby.system.home=[derby_DB_files_root]
If you use a properties file for configuration, specify these parameters: jdbc.driverClassName, jdbc.url, jdbc.username, jdbc.password, jdbc.dialect.
For example: jdbc.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
jdbc.url=jdbc:derby:databases/cloverDb;create=true jdbc.username= jdbc.password= jdbc.dialect=com.cloveretl.server.dbschema.DerbyDialect
Take a closer look at the jdbc.url
parameter. Part databases/cloverDb means a subdirectory for DB data. This subdirectory will be created in the directory which is set as derby.system.home
(or in the working directory if derby.system.home
is not set). Value databases/cloverDb is a default value, you may change it.
Derby JDBC 4 compliant driver is bundled with CloverETL Server, thus there is no need to add it on the classpath.
54
Chapter 8. Examples of DB
Connection Configuration
MySQL
CloverETL Server supports MySQL 5, up to version 5.5 included.
Creating database
The following steps will create database clover_db
and user clover
with password clover
.
1. Create database clover_db
, set charset and collate.
CREATE SCHEMA clover_db CHARACTER SET utf8 COLLATE utf8_unicode_ci;
2. Use clover_db as the current database.
USE clover_db;
3. Create a new user with password and host.
CREATE USER 'clover'@'%' IDENTIFIED BY 'clover';
4. Add all privileges to user 'clover' in DB clover_db.
GRANT ALL ON clover_db.* TO 'clover'@'%';
5. Reload privileges.
FLUSH privileges;
CloverETL setup
If you use a properties file for configuration, specify these parameters: jdbc.driverClassName, jdbc.url, jdbc.username, jdbc.password, jdbc.dialect.
For example: jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://127.0.0.1:3306/clover?useUnicode=true&characterEncoding=utf8 jdbc.username=root jdbc.password= jdbc.dialect=org.hibernate.dialect.MySQLDialect
Please don't forget to add a JDBC 4 compliant driver on the classpath. A JDBC Driver which doesn't meet JDBC
4 won't work properly.
Create DB with a proper charset, like this:
CREATE DATABASE IF NOT EXISTS clover DEFAULT CHARACTER SET 'utf8';
55
Chapter 8. Examples of DB
Connection Configuration
DB2
Creating database
1. Create a dedicated user for the Clover database and set a password (UNIX/Linux).
useradd clover passwd clover
2. Create a new database.
db2 "CREATE DATABASE cloverdb PAGESIZE 32768 RESTRICTIVE"
3. Activate the database.
db2 activate db cloverdb
4. Connect to the database.
db2 connect to cloverdb
5. Grant the user DBADM authority (DBADM authority is an administrative authority for a specific database. The database administrator possesses the privileges that are required to create objects and issue database commands.
By default, DATAACCESS and ACCESSCTRL authority are also granted).
db2 "GRANT DBADM ON DATABASE TO USER clover"
6. Disconnect from database db2 connect reset
DB2 on Linux/Windows
If you use a properties file for configuration, specify these parameters: jdbc.driverClassName, jdbc.url, jdbc.username, jdbc.password, jdbc.dialect.
For example: jdbc.driverClassName=com.ibm.db2.jcc.DB2Driver
jdbc.url= jdbc:db2://localhost:50000/clover jdbc.username=usr jdbc.password=pwd jdbc.dialect=org.hibernate.dialect.DB2Dialect
Please don't forget to add a JDBC 4 compliant driver on the classpath. A JDBC Driver which doesn't meet JDBC
4 won't work properly.
56
Chapter 8. Examples of DB
Connection Configuration
Possible problems
Wrong pagesize
Database clover has to be created with suitable
PAGESIZE
. DB2 has several possible values for this property:
4096, 8192, 16384 or 32768.
CloverETL Server should work on DB with
PAGESIZE
set to 16384 or 32768. If
PAGESIZE
value is not set properly, there should be error message in the log file after failed CloverETL Server startup:
ERROR:
DB2 SQL Error: SQLCODE=-286, SQLSTATE=42727, SQLERRMC=16384;
ROOT, DRIVER=3.50.152
SQLERRMC contains suitable value for
PAGESIZE
.
You can create database with proper
PAGESIZE
like this:
CREATE DB clover PAGESIZE 32768;
The table is in the reorg pending state
After some ALTER TABLE commands, some tables may be in "reorg pending state". This behaviour is specific for
DB2. ALTER TABLE DDL commands are executed only during the first start of new CloverETL Server version.
Error message for this issue may look like this:
Operation not allowed for reason code "7" on table "DB2INST2.RUN_RECORD"..
SQLCODE=-668, SQLSTATE=57016 or like this
DB2 SQL Error: SQLCODE=-668, SQLSTATE=57016, SQLERRMC=7;DB2INST2.RUN_RECORD, DRIVER=3.50.152
In this case "RUN_RECORD" is table name which is in "reorg pending state" and "DB2INST2" is DB instance name.
To solve this, go to DB2 console and execute command (for table run_record): reorg table run_record
DB2 console output should look like this: db2 => connect to clover1
Database Connection Information
Database server = DB2/LINUX 9.7.0
SQL authorization ID = DB2INST2
Local database alias = CLOVER1 db2 => reorg table run_record
DB20000I The REORG command completed successfully.
db2 => disconnect clover1
DB20000I The SQL DISCONNECT command completed successfully.
"clover1" is DB name
57
Chapter 8. Examples of DB
Connection Configuration
DB2 does not allow ALTER TABLE which trims DB column length.
This problem depends on DB2 configuration and we've experienced this only on some AS400s so far. CloverETL
Server applies set of DP patches during the first installation after application upgrade. Some of these patches may apply column modifications which trims length of the text columns. These changes never truncate any data, however DB2 does not allow this since it "may" truncate some data. DB2 refuses these changes even in DB table which is empty. Solution is, to disable the DB2 warning for data truncation, restart CloverETL Server which applies patches, then enable DB2 warning again.
DB2 on AS/400
The connection on AS/400 might be slightly different.
If you use a properties file for configuration, specify these parameters: jdbc.driverClassName, jdbc.url, jdbc.username, jdbc.password, jdbc.dialect. For example: jdbc.driverClassName=com.ibm.as400.access.AS400JDBCDriver
jdbc.username=javlin jdbc.password=clover jdbc.url=jdbc:as400://host/cloversrv;libraries=cloversrv;date format=iso jdbc.dialect=org.hibernate.dialect.DB2400Dialect
Use credentials of your OS user for jdbc.username
and jdbc.password
.
cloversrv
in jdbc.url
above is the name of the DB schema.
You can create schema in AS/400 console:
• execute command
STRSQL
(SQL console)
• execute
CREATE COLLECTION cloversrv IN ASP 1
• cloversrv
is the name of the DB schema and it may be at most 10 characters long
Proper JDBC driver must be in the application server classpath.
I use JDBC driver jt400ntv.jar
, which I've found in
/QIBM/ProdData/Java400
on the server.
Use jt400ntv.jar
JDBC driver.
Please don't forget to add a JDBC 4 compliant driver on the classpath. A JDBC Driver which doesn't meet JDBC
4 won't work properly.
58
Chapter 8. Examples of DB
Connection Configuration
Oracle
Creating database
Run the following script to create a role, a user and a tablespace for CloverETL server.
Role: cloverRole
User: cloverUser
Password: cloverPassword
-- Create a new role and grant it privileges
CREATE ROLE cloverRole NOT IDENTIFIED;
GRANT CREATE SESSION TO cloverRole;
GRANT ALTER SESSION TO cloverRole;
GRANT CREATE TABLE TO cloverRole;
GRANT CREATE SEQUENCE TO cloverRole;
GRANT CREATE TRIGGER TO cloverRole;
-- Create a new database user with password
CREATE USER cloverUser IDENTIFIED BY cloverPassword;
-- Set quota on tablespace
GRANT UNLIMITED TABLESPACE TO cloverUser;
-- Connect a new role to a new user
GRANT cloverRole TO cloverUser;
CloverETL setup
If you use a properties file for configuration, specify these parameters: jdbc.driverClassName, jdbc.url, jdbc.username, jdbc.password, jdbc.dialect.
For example: jdbc.driverClassName=oracle.jdbc.OracleDriver
jdbc.url=jdbc:oracle:thin:@host:1521:db jdbc.username=user jdbc.password=pass jdbc.dialect=org.hibernate.dialect.Oracle10gDialect
Please don't forget to add a JDBC 4 compliant driver on the classpath. A JDBC Driver which doesn't meet the
JDBC 4 specification won't work properly.
These are privileges which have to be granted to schema used by CloverETL Server:
CONNECT
CREATE SESSION
CREATE/ALTER/DROP TABLE
CREATE/ALTER/DROP SEQUENCE
QUOTA UNLIMITED ON <user_tablespace>;
QUOTA UNLIMITED ON <temp_tablespace>;
59
Chapter 8. Examples of DB
Connection Configuration
Microsoft SQL Server
Creating database
It is advised to use SQL Server Authentication instead of Windows Authentication. To enable it, select the server instance in Micorosft SQL Server Management Studio, go to Properties / Security / Server authentication and select SQL Server and Windows Authentication mode. The server instance needs to be restarted.
1. Create a new database
CREATE DATABASE clover_db;
2. Enable Read Committed Snapshot Isolation on the new database
ALTER DATABASE clover_db SET READ_COMMITTED_SNAPSHOT ON;
3. Create a new login role.
CREATE LOGIN clover with PASSWORD = 'clover', DEFAULT_DATABASE = clover_db;
4. Connect to the database.
USE clover_db;
5. Create a new database user.
CREATE USER clover FOR LOGIN clover;
6. Add database role membership db_owner (Members of the db_owner fixed database role can perform all configuration and maintenance activities on the database, and can also drop the database).
EXEC sp_addrolemember 'db_owner','clover';
CloverETL setup
Using MS SQL requires configuration of database server.
• run Micorosft SQL Server Management Studio tool
• create a new user under Security/Logins
• under Databases create a new database (e.g. 'clover') for ClovarETL server, select the user from previous step as owner of the database
• under database Options set option Is Read Committed Snapshot On to True
If you use a properties file for configuration, specify these parameters: jdbc.driverClassName, jdbc.url, jdbc.username, jdbc.password, jdbc.dialect.
For example: jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.url=jdbc:sqlserver://localhost:1433;instance=SQLSERVERINSTANCE;database=clover_db
60
Chapter 8. Examples of DB
Connection Configuration jdbc.username=user jdbc.password=pass jdbc.dialect=org.hibernate.dialect.SQLServerDialect
Please do not forget to add a JDBC 4 compliant driver on the application server classpath. A JDBC Driver that does not meet the JDBC 4 specification will not work properly.
61
Chapter 8. Examples of DB
Connection Configuration
Postgre SQL
Creating database
Advanced users can create their own table space
We are going to create a database for clover to use a 'user group' role which will own the database and a user role which we will add to the user group. This user role will be then used by the server to access the database.
Database name: clover_db
UserGroup: cloveretl
User: clover
Password: clover
1. Optionally, you can create new tablespace
2. Connect as postgres (default admin) to the default db postgres and execute the following commands:
CREATE ROLE cloveretl NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT NOLOGIN;
CREATE ROLE clover NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN ENCRYPTED PASSWORD 'clover';
GRANT cloveretl TO clover;
CREATE DATABASE clover_db;
GRANT ALL ON DATABASE clover_db TO cloveretl;
REVOKE ALL ON DATABASE clover_db FROM public;
To separate database into its own tablespace create a tablespace before creating the database: and use the following command to create the db:
CREATE DATABASE clover_db WITH OWNER cloveretl TABLESPACE tablespace_name; https://www.postgresql.org/docs/9.2/static/sql-createtablespace.html
CloverETL setup
If you use a properties file for configuration, specify these parameters: jdbc.driverClassName, jdbc.url, jdbc.username, jdbc.password, jdbc.dialect.
For example: jdbc.driverClassName=org.postgresql.Driver
jdbc.url=jdbc:postgresql://localhost/clover?charSet=UTF-8 jdbc.username=postgres jdbc.password= jdbc.dialect=org.hibernate.dialect.PostgreSQLDialect
Please don't forget to a add JDBC 4 compliant driver on the classpath. A JDBC Driver which doesn't meet the
JDBC 4 specification won't work properly.
The JDBC driver for PostgreSQL can be downloaded from: https://jdbc.postgresql.org/download.html. In Apache
Tomcat you would place libs into
$CATALINA_HOME/libs
directory.
62
Chapter 8. Examples of DB
Connection Configuration
JNDI DB DataSource
CloverETL Server can connect to database using JNDI DataSource, which is configured in application server or container. However there are some CloverETL parameters which must be set, otherwise the behaviour may be unpredictable: datasource.type=JNDI # type of datasource; must be set, because default value is JDBC datasource.jndiName=# JNDI location of DB DataSource; default value is java:comp/env/jdbc/clover_server # jdbc.dialect=# Set dialect according to DB which DataSource is connected to.
The same dialect as in sections above. #
The parameters above may be set in the same ways as other params (in properties file or Tomcat context file)
Example of DataSource configuration in Apache Tomcat. Add following context resource configuration may be added to the
[tomcat_home]/conf/server.xml
file to the
<Host>
element.
<Context path="/clover" >
<Resource name="jdbc/clover_server" auth="Container"
type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1:3306/clover?useUnicode=true&characterEncoding=utf8"
username="root" password=""
maxActive="20" maxIdle="10" maxWait="-1"/>
</Context>
Do no put the code above into
<GlobalNamingResources>
element, since the resource would not be visible by the CloverETL webapp.
Note
The resource configuration may be also added to context file
[tomcat_home]/conf/
Catalina/localhost/clover.xml
.
Note
Special characters you type in the context file have to be specified as XML entities. E.g. ampersand
"&" as "&" etc.
Important
The default jndi pool DBCP in Apache Tomcat does not handle connections in efficient way. With
DBCP jndi pool, low performance can be seen if DBOutputTable with returning statement is used.
Use tomcat-jdbc-pool instead. Just add factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
to the definition of the jndi resource. See https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html
See Chapter 9, List of Properties (p. 70) for list of properties.
63
Chapter 8. Examples of DB
Connection Configuration
Encrypted JNDI
You can store password for database connection encrypted. The configuration differs between particular application servers.
Encrypted JNDI on Tomcat (p. 64)
Encrypted JNDI on Jetty 9 (9.2.6) (p. 65)
Encrypted JNDI on Glassfish 3 (3.1.2.2) (p. 68)
Encrypted JNDI on WebSphere 8.5.5.0
Encrypted JNDI on WebLogic (p. 69)
Encrypted JNDI on Tomcat
You need secure-cfg-tool to encrypt the passwords. Use the version of secure-cfg-tool
Configuration Properties (p. 76).
Use encrypt.sh
or encrypt.bat
for encryption of a password. Place the encrypted password into a configuration file, and put cloveretl-secure-jndi-resource-{version}.jar
and jasypt-1.9.0.jar
files on classpath of the application server. The
.jar
files can be found in tomcatsecure-jndi-resource
directory packed in secure-cfg-tool.
The tomcat-secure-jndi-resource
directory contains useful file
README
with further details on encrypted JNDI.
Example of encrypted JNDI connection for Postgresql
Encrypt the password:
./encrypt.sh -a PBEWithSHA1AndDESede
The configuration is placed in
${CATALINA_HOME}/webapps/clover/META-INF/cotext.xml
. Note that the encryption algorithm PBEWithSHA1AndDESede is not default.
<Resource name="jdbc/clover_server"
auth="Container"
factory="com.cloveretl.secure.tomcatresource.SecureDataSourceFactory"
secureAlgorithm="PBEWithSHA1AndDESede"
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://127.0.0.1:5432/clover410m1?charSet=UTF-8"
username="conf#rPz5Foo7HPn4dFTRV5Ourg=="
password="conf#4KlNp8/FVDR+rTWX0dEqWA=="
maxActive="20"
maxIdle="10"
maxWait="-1"/>
If you use other JCE (e.g. Bouncy Castle), it has to be added to the classpath of an application server
(
${CATALINA_HOME}/lib
). The encrypt command requires the path to directory with JCE too.
./encrypt.sh -l ~/lib/ -c org.bouncycastle.jce.provider.BouncyCastleProvider
-a PBEWITHSHA256AND256BITAES-CBC-BC
<Resource name="jdbc/clover_server"
auth="Container"
factory="com.cloveretl.secure.tomcatresource.SecureDataSourceFactory"
secureProvider="org.bouncycastle.jce.provider.BouncyCastleProvider"
secureAlgorithm="PBEWITHSHA256AND256BITAES-CBC-BC"
64
Chapter 8. Examples of DB
Connection Configuration
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://127.0.0.1:5432/clover410m1?charSet=UTF-8"
username="conf#Ws9IuHKo9h7hMjPllr31VxdI1A9LKIaYfGEUmLet9rA="
password="conf#Cj1v59Z5nCBHaktn6Ubgst4Iz69JLQ/q6/32Xwr/IEE="
maxActive="20" maxIdle="10"
maxWait="-1"/>
Encrypted JNDI on Jetty 9 (9.2.6)
http://eclipse.org/jetty/documentation/current/configuring-security-secure-passwords.html
Configuration of a JNDI jdbc connection pool is stored in the plain text file,
$JETTY_HOME/etc/jetty.xml
.
<New id="MysqlDB" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg></Arg>
<Arg>jdbc/MysqlDS</Arg>
<Arg>
<New class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
<Set name="URL">jdbc:mysql://localhost:3306/clover_empty</Set>
<Set name="User">user</Set>
<Set name="Password">password</Set>
</New>
</Arg>
</New>
Obfuscating the Password
Password can be obfuscated using org.eclipse.jetty.util.security.Password
class within lib/ jetty-util-{VERSION}.jar
: java -cp lib/jetty-util-9.2.6.v20141205.jar org.eclipse.jetty.util.security.Password password
Command returns obfuscated and hashed password. The obfuscated one will be used to replace the plain password value.
Replacing the Password
Replace the plain text password with the Call element. Its only argument is a string starting with the OBF: prefix returned by the command mentioned in the previous section.
<New id="MysqlDB" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg></Arg>
<Arg>jdbc/MysqlDS</Arg>
<Arg>
<New class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
<Set name="URL">jdbc:mysql://localhost:3306/clover_empty</Set>
<Set name="User">user</Set>
<Set name="Password">
<Call class="org.eclipse.jetty.util.security.Password" name="deobfuscate">
<Arg>OBF:1v2j1uum1xtv1zej1zer1xtn1uvk1v1v</Arg>
</Call>
</Set>
</New>
</Arg>
</New>
Password in the JMS connection can be also obfuscated.
Encrypted JNDI on JBoss 6.0.0
Original datasource with an unencrypted password:
65
Chapter 8. Examples of DB
Connection Configuration
<datasources>
<local-tx-datasource>
<jndi-name>MysqlDS</jndi-name>
<connection-url>jdbc:mysql://127.0.0.1:3306/clover</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>user</user-name>
<password>password</password>
</local-tx-datasource>
</datasources>
Encrypt the data source password
Linux java -cp client/jboss-logging.jar:lib/jbosssx.jar org.jboss.resource.security.SecureIdentityLoginModule password
Windows java -cp client\jboss-logging.jar;lib\jbosssx.jar org.jboss.resource.security.SecureIdentityLoginModule password
NOTE: in the JBoss documentation client/jboss-logging-spi.jar
is used, but there is no such a file in my JBossAS [6.0.0.Final "Neo"], but client/jboss-logging.jar
can be used instead.
The command will return an encrypted password, e.g. 5dfc52b51bd35553df8592078de921bc.
Create a new application authentication policy in conf/login-config.xml
within currently used server's profile directory (e.g. server/default/conf/login-config.xml
).
<application-policy name="EncryptDBPassword">
<authentication>
<login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
<module-option name="username">user</module-option>
<module-option name="password">5dfc52b51bd35553df8592078de921bc</module-option>
<module-option name="managedConnectionFactoryName">jboss.jca:name=MysqlDS,service=LocalTxCM</module-option>
</login-module>
</authentication>
</application-policy>
Replace authentication entries with a reference to the application authentication policy
<security-domain>EncryptDBPassword</security-domain>
The final datasource looks like this:
<datasources>
<local-tx-datasource>
<jndi-name>MysqlDS</jndi-name>
<connection-url>jdbc:mysql://127.0.0.1:3306/clover</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<security-domain>EncryptDBPassword</security-domain>
</local-tx-datasource>
</datasources>
The same mechanism can be probably used also for JMS.
<tx-connection-factory>
...
<security-domain-and-application>RealmWithEncryptedPassword</security-domain-and-application>
66
Chapter 8. Examples of DB
Connection Configuration
...
</tx-connection-factory>
See http://docs.jboss.org/jbosssecurity/docs/6.0/security_guide/html/Encrypting_Data_Source_Passwords.html
JBoss 7
JBoss 7 - JBoss EAP 6.2.0.GA - AS 7.3.0.Final-redhat-14
Configuration steps are similar to configuring of JBoss 6.
All configuration takes place in the single configuration file, e.g. for standalone profile
JBOSS_HOME/ standalone/configuration/standalone.xml
.
Original datasource:
<datasources>
<datasource jndi-name="java:/MysqlDS" pool-name="MySQLPool">
<connection-url>jdbc:mysql://localhost:3306/clover</connection-url>
<driver>mysql</driver>
<pool>
<max-pool-size>30</max-pool-size>
</pool>
<security>
<user-name>user</user-name>
<password>password</password>
</security>
</datasource>
<drivers>
<driver name="mysql" module="com.cloveretl.jdbc">
<driver-class>com.mysql.jdbc.Driver</driver-class>
</driver>
</drivers>
<datasources>
In JBOSS_HOME directory run cli command: java -cp modules/system/layers/base/org/picketbox/main/picketbox-4.0.19.SP2-redhat-1.jar:client/jboss-logging.jar org.picketbox.datasource.security.SecureIdentityLoginModule password
The command will return an encrypted password, e.g. 5dfc52b51bd35553df8592078de921bc.
Add a new security-domain to security-domains, the password value is a result of the command from the previous step.
<security-domain name="EncryptDBPassword" cache-type="default">
<authentication>
<login-module code="org.picketbox.datasource.security.SecureIdentityLoginModule" flag="required">
<module-option name="username" value="user"/>
<module-option name="password" value="5dfc52b51bd35553df8592078de921bc"/>
<module-option name="managedConnectionFactoryName" value="jboss.jca:service=LocalTxCM,name=MysqlPool"/>
</login-module>
</authentication>
</security-domain>
Replace user and password with a reference to the security domain.
<datasources>
<datasource jndi-name="java:/MysqlDS" pool-name="MysqlPool" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/clover</connection-url>
<driver>mysql</driver>
<pool>
<max-pool-size>30</max-pool-size>
67
Chapter 8. Examples of DB
Connection Configuration
</pool>
<security>
<security-domain>EncryptDBPassword</security-domain>
</security>
</datasource>
<drivers>
<driver name="mysql" module="com.cloveretl.jdbc">
<driver-class>com.mysql.jdbc.Driver</driver-class>
</driver>
</drivers>
</datasources>
The same mechanism can be probably used also for JMS.
http://middlewaremagic.com/jboss/?p=1026
Encrypted JNDI on Glassfish 3 (3.1.2.2)
Configuration of jdbc connection pool is stored in the plain text file, $DOMAIN/config/domain.xml.
<jdbc-connection-pool driver-classname="com.mysql.jdbc.Driver" datasource-classname="" res-type="java.sql.Driver" description="" name="jdbc/MysqlDS">
<property name="URL" value="jdbc:mysql://localhost:3306/clover_empty"></property>
<property name="user" value="user"></property>
<property name="password" value="password"></property>
</jdbc-connection-pool>
Password is unencrypted, but can be replaced with so called password alias:
A password alias stores a password in encrypted form in the domain keystore, providing a clear-text alias name to use instead of the password. In password files and the domain configuration file, use the form ${ALIAS=aliasname} to refer to the encrypted password.
Creating a Password Alias
There are two ways to create a password alias: using create-password-alias command in a command-line adminconsole utility, or in the web Server Administration Console in the Password Aliases section (Domain->Password
Aliases).
Replacing the Password with the Password Alias
Replace password (the attribute value) with a ${ALIAS=password_alias_name} string, where password_alias_name is the name of the alias.
<jdbc-connection-pool driver-classname="com.mysql.jdbc.Driver" datasource-classname="" res-type="java.sql.Driver" description="" name="jdbc/MysqlDS">
<property name="URL" value="jdbc:mysql://localhost:3306/clover_empty"></property>
<property name="user" value="user"></property>
<property name="password" value="${ALIAS=password_alias_name}"></property>
</jdbc-connection-pool>
NOTE: Glassfish's Administration Server Console mentions a lower case keyword alias, but it doesn't work for me. Changing to upper case ALIAS makes the connection pool work.
Password for a JMS connection can be replaced with an alias as well.
Encrypted JNDI on WebSphere 8.5.5.0
In WebSphere, user credentials aren't saved in plain text, but as J2C authentication data.
http://www-01.ibm.com/support/docview.wss?uid=nas8N1011315
68
Chapter 8. Examples of DB
Connection Configuration
The same mechanism can be used also for JMS connection.
(Configuring an external JMS provider: https://www.ibm.com/developerworks/community/blogs/timdp/entry/ using_activemq_as_a_jms_provider_in_websphere_application_server_7149?lang=en )
Encrypted JNDI on WebLogic
Password in a JNDI datasource file is encrypted by default when created by admin's web console (Service/
Datasource).
Example of datasource file (located in DOMAIN/config/jdbc/ directory):
<?xml version='1.0' encoding='UTF-8'?>
<jdbc-data-source xmlns="http://xmlns.oracle.com/weblogic/jdbc-data-source" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/jdbc-data-source http://xmlns.oracle.com/weblogic/jdbc-data-source/1.0/jdbc-data-source.xsd">
<name>MysqlDS</name>
<jdbc-driver-params>
<url>jdbc:mysql://127.0.0.1:3306/clover</url>
<driver-name>com.mysql.jdbc.Driver</driver-name>
<properties>
<property>
<name>user</name>
<value>user</value>
</property>
</properties>
<password-encrypted>{AES}zIiq6/JutK/wD4CcRPX1pOueIlKqc6uRVxAnZZcC3pI=</password-encrypted>
</jdbc-driver-params>
<jdbc-connection-pool-params>
<test-table-name>SQL SELECT 1</test-table-name>
</jdbc-connection-pool-params>
<jdbc-data-source-params>
<jndi-name>jdbc/MysqlDS</jndi-name>
<global-transactions-protocol>OnePhaseCommit</global-transactions-protocol>
</jdbc-data-source-params>
</jdbc-data-source>
The same mechanism is also used for encrypting password in the JMS connection.
(Configuring an external JMS provider: http://docs.oracle.com/cd/E12840_01/wls/docs103/ConsoleHelp/ taskhelp/jms_modules/foreign_servers/ConfigureForeignServers.html
69
Chapter 9. List of Properties
Table 9.1. General configuration
config.file
license.file
key
engine.config.file
sandboxes.home
description
location of a CloverETL Server configuration file
default
[working_dir]/ cloverServer.properties
location of a CloverETL Server licence file (license.dat) location of a CloverETL engine configuration properties file properties file packed with CloverETL
This property is primarily intended to be used as a placeholder in the sandbox root path specification. So the sandbox path is specified with the placeholder and it's resolved to the real path just before it's used.
Sandbox path may still be specified as an absolute path, but placeholder has some significant advantages:
${user.data.home}/
CloverETL/ sandboxes
* sandbox definition may be exported/imported to another environment with a different directory structure
* user creating sandboxed doesn't have to care about physical location on the filesystem
* each node in cluster environment may have a different
"sandboxes.home" value, so the directory structure doesn't have to be identical private.properties
The default value uses content of a "user.data.home" configuration property, which points to the home directory of the user which runs the JVM process.
Directory depends on the OS. On unix-like systems it's typically /home/[username]
List of server properties which are used only by
CloverETL Server code. So these properties are not accessible outside of the ServerFacade. By default there are all properties which may contain password in the list. Basically it means, that their values are not visible for web GUI users. Values are replaced by single star
"*". Changes in this list may cause unexpected behavior of some server API.
jdbc.password, executor.password, security.ldap.password, clover.smtp.password
engine.plugins.additional.src
This property may contain an absolute path to some
"source" of additional CloverETL engine plugins.
These plugins are not a substitute for plugins packed in WAR. "Source" may be a directory or a zip file.
Both, a directory and a zip, must contain a subdirectory for each plugin. Changes in the directory or the ZIP file apply only when the server is restarted. For details
see Chapter 27, Extensibility - CloverETL Engine
empty datasource.type
Set this explicitly to JNDI if you need CloverETL
Server to connect to a DB using JNDI datasource. In such case, "datasource.jndiName" and "jdbc.dialect" parameters must be set properly. Possible values: JNDI
| JDBC
JDBC
70
Chapter 9. List of Properties
key
datasource.jndiName
description default
JNDI location of a DB DataSource. It is applied only if
"datasource.type" is set to "JNDI".
java:comp/env/jdbc/ clover_server class name for jdbc driver name jdbc.driverClassName
jdbc.url
jdbc.username
jdbc.password
jdbc.dialect
jdbc url used by CloverETL Server to store data jdbc database user name jdbc database user name hibernate dialect to use in ORM quartz.driverDelegateClass
SQL dialect for quartz. Value is automatically derived from "jdbc.dialect" property value.
sandboxes.access.check.boundaries.enabled
true true | false If it is set to false, then path relative to sandbox root may point out of the sandbox. No file/ folder outside of the sandbox is accessible by the relative path otherwise.
security.session.validity
Session validity in milliseconds. When the request of logged-in user/client is detected, validity is automatically prolonged.
14400000 security.session.exchange.limit Interval for exchange of invalid tokens in milliseconds. 360000 security.default_domain
Domain which all new users are included in. Stored in user's record in the database. Shouldn't be changed unless the "clover" must be white-labelled.
clover security.basic_authentication.features_list
List of features which are accessible using HTTP and which should be protected by Basic HTTP
Authentication. The list has form of semi-colon separated items; Each feature is specified by its servlet path.
/request_processor;/ simpleHttpApi;/ launch;/launchIt;/ downloadStorage;/ downloadFile;/ uploadSandboxFile;/ downloadLog;/ webdav security.basic_authentication.realm
CloverETL Server
Realm string for HTTP Basic Authentication.
security.digest_authentication.features_list
List of features which are accessible using HTTP and which should be protected by HTTP Digest
Authentication. The list has form of semi-colon separated items. Each feature is specified by its servlet path.
Please keep in mind, that HTTP Digest Authentication is feature added to the version 3.1. If you upgraded your older CloverETL Server distribution, users created before the upgrade cannot use the HTTP Digest
Authentication until they reset their passwords. So when they reset their passwords (or the admin does it for them), they can use Digest Authentication as well as new users.
security.digest_authentication.storeA1.enabled
false
71
Chapter 9. List of Properties
key description
Switch whether the A1 Digest for HTTP Digest
Authentication should be generated and stored or not. Since there is no CloverETL Server API using the HTTP Digest Authentication by default, it's recommended to keep it disabled. This option is not automatically enabled when any feature is specified in the security.digest_authentication.features_list
property.
default
security.digest_authentication.realm
Realm string for HTTP Digest Authentication. If it is changed, all users have to reset their passwords, otherwise they won't be able to access to the server features protected by HTTP digest Authentication.
CloverETL Server security.digest_authentication.
nonce_validity clover.event.
fileCheckMinInterval
Interval of validity for HTTP Digest Authentication specified in seconds. When the interval passes, server requires new authentication from the client. Most of the
HTTP clients do it automatically.
300
Interval of the timer, running file event listener checks
(in milliseconds). See File Event Listeners (remote and local) (p. 194) for details.
1000 clover.smtp.transport.protocol
SMTP server protocol. Possible values are "smtp" or
"smtps".
smtp clover.smtp.host
SMTP server hostname or IP address clover.smtp.port
clover.smtp.authentication
clover.smtp.username
clover.smtp.password
clover.smtp.additional.*
SMTP server port true/false If it is false, username and password are ignored
SMTP server username
SMTP server password logging.project_name
Properties with a "clover.smtp.additional." prefix are automatically added (without the prefix) to the
Properties instance passed to the Mailer. May be useful for some protocol specific parameters. The prefix is removed.
used in log messages where it is necessary to name the product name
CloverETL logging.default_subdir
name of a default subdirectory for all server logs; it is relative to the path specified by system property
"java.io.tmpdir". Don't specify as an absolute path, use properties which are intended for absolute path.
cloverlogs logging.logger.server_audit.enabled
Enables logging of operations called on ServerFacade and JDBC proxy interfaces. The name of output file is
"server-audit.log". It is stored in the same directory as other CloverETL Server log files by default. The default logging level is DEBUG so it logs all operations which may process any change.
false launch.log.dir
Location, where server should store launch requests
logs. See Launch Services (p. 216) for details.
${java.io.tmpdir}/
[logging.
default_subdir]/ launch where
72
Chapter 9. List of Properties
key
graph.logs_path
description default
${java.io.tmpdir} is system property
Location, where server should store Graph run logs. See
Chapter 11, Logging (p. 80) for details.
${java.io.tmpdir}/
[logging.
default_subdir]/ graph where
${java.io.tmpdir} is system property
%d %-5p
%-3X{runId} [%t]
%m%n
UTF-8 logging.appender.jobs.encoding Encoding of the jobs' log files temp.default_subdir
graph.pass_event_params
_to_graph_in_old_style
Name of default subdirectory for server tmp files; it is relative to the path specified by system property
"java.io.tmpdir".
clovertmp
Since 3.0. It is switch for backwards compatibility of passing parameters to the graph executed by a graph event. In version prior to 3.0 all params has been passed to executed graph. Since 3.0 just specified parameters are passed. Please see
details.
false threadManager.pool.corePoolSize
4
Number of threads which are always active (running or idling). Related to a thread pool for processing server events.
threadManager.pool.queueCapacity
0
Max size of the queue (FIFO) which contains tasks waiting for an available thread. Related to a thread pool for processing server events. For queueCapacity=0, there are no waiting tasks, each task is immediately executed in an available thread or in a new thread.
threadManager.pool.maxPoolSize
8192
Max number of active threads. If no thread from a core pool is available, the pool creates new threads up to
"maxPoolSize" threads. If there are more concurrent tasks then maxPoolSize, thread manager refuses to execute it.
threadManager.pool.allowCoreThreadTimeOut
false
Switch for idling threads timeout. If true, the
"corePoolSize" is ignored so all idling threads may be time-outed threadManager.pool.keepAliveSeconds
20 task.archivator.batch_size
launch.http_header_prefix
timeout for idling threads in seconds
Max number of records deleted in one batch. It is used for deleting of archived run records.
50
Prefix of HTTP headers added by launch services to the
HTTP response.
X-cloveretl
73
Chapter 9. List of Properties
key
task.archivator.
archive_file_prefix license.context_names
description
Prefix of archive files created by the archivator.
default
cloverArchive_
A comma-separated list of web-app contexts which may contain license. Each of them has to start with a slash!
Works only on Apache Tomcat.
/clover-license,/ clover_license properties_resolver.resolve_server_props.server_props_list_additional
A list of properties from a subset of properties, which values are resolved. The properties' values may use system properties or environment variables as placeholders. Values are resolved during the server startup. If the system property is changed later, the resolved CloverETL Server property value doesn't change. Users may use this property, if some property they need to resolve is missing in the property: properties_resolver.resolve_server_props.server_props_list_default.
If already the property specified by to resolve the is property properties_resolver.resolve_server_props.server_props_list_default, don't add it to this property.
properties_resolver.resolve_server_props.server_props_list_default
A list of properties from a subset of properties, which values are resolved. The properties' values may use system properties or environment variables as placeholders. Values are resolved during the server startup. If the system property is changed later, the resolved CloverETL Server property value doesn't change. Users are discouraged from modification sandboxes.home, sandboxes.home.local, sandboxes.home.partitioned, cluster.jgroups.bind_address, cluster.jgroups.start_port, cluster.jgroups.external_address, cluster.jgroups.external_port, cluster.jgroups.tcpping.initial_hosts, of the property, unles it's necessary. Instead users may add more properties by modifying property: cluster.group.name, cluster.http.url
properties_resolver.resolve_server_props.server_props_list_additional
properties_resolver.placeholders.server_props_list_default
A list of properties from a subset of properties, that may be used as placeholders and shall be resolved if used in paths. The properties can be used if you define a path to the root of sandbox, or to locations of local or partitioned sandboxes, or path to a script, or path in archiver job. Users are strongly discouraged from modification of the property. The property name changed since CloverETL 4.2, however also the obsolete name is still accepted to maintain backwards compatibility.
sandboxes.home, sandboxes.home.local, sandboxes.home.partitioned, user.data.home
webDav.method.propfind.maxDepth
40
Maximum depth for webDAV method PROPFIND.
When the depth is not specified, the default is supposed to be infinite (according to the rfc2518), however it's necessary to set some limit, otherwise the webDav client might overload the server filesystem.
Also if the depth value specified by webDAV client in the request is higher than the pre-configured max depth, only the pre-configured maximum is used.
jvm.implementation.check.enabled
warnings when unsupported Java implementation is used.
true
74
Chapter 9. List of Properties
Table 9.2. Defaults for job execution configuration - see
key
executor.tracking_interval
executor.log_level
description default
An interval in milliseconds for scanning of a current status of a running graph. The shorter interval, the bigger log file.
2000
Log level of graph runs. TRACE | DEBUG | INFO | WARN |
ERROR
INFO executor.max_job_tree_depth
Defines maximal depth of the job execution tree, e.g. for recursive job it defines the maximal level of recursion (counting from root job).
32 executor.max_running_concurrently Amount of graph instances which may exist (or run) concurrently.
0 means no limits
0 executor.max_graph_instance_age
Interval in milliseconds. Specifies how long graph instance can be idling before it is released from memory. 0 means no limits.
0 executor.classpath
executor.skip_check_config
executor.password
executor.verbose_mode
executor.use_jmx
executor.debug_mode
This property has been renamed since 2.8. Original name was executor.maxGraphInstanceAge
Classpath for transformation/processor classes used in the graph.
Directory [sandbox_root]/trans/ does not have to be listed here, since it is automatically added to graph run classpath.
Disables check of graph configuration. Increases performance of graph execution, however may be useful during graph development.
true
This property is deprecated. Password for decoding of encoded
DB connection passwords.
If true, more descriptive logs of graph runs are generated.
If true, graph executor registers jmx mBean of running graph.
true true
If true, edges with enabled debug store data into files in debug directory.
false
See Chapter 29, Clustering Features (p. 229) for more properties.
75
Chapter 10. Secure Configuration Properties
Some configuration properties can be confidential (e.g. password to database, mail client) and thus it's desirable to encrypt them. For this purpose there is a command-line utility secure-cfg-tool.jar.
Advanced Usage - Custom Settings (p. 77)
Basic Utility Usage
1. Get a utility archive file ( secure-cfg-tool.zip
) and unzip it.
The utility is available in the download section of your CloverETL account - at the same location as the download of CloverETL Server.
2. Execute the script given for your operating system, encrypt.bat
for MS Windows, encrypt.sh
for
Linux. You will be asked for inserting a value of a configuration property intended to be encrypted.
Example:
C:\secure-cfg-tool>encrypt.bat
**************************************************************
Secure config encryption (use --help or -h option to show help)
**************************************************************
****** Config settings ******
Provider: SunJCE
Algorithm: PBEWithMD5AndDES
*****************************
Enter text to encrypt: mypassword
Text to encrypt: "mypassword"
Encrypted text: conf#eCflGDlDtKSJjh9VyDlRh7IftAbI/vsH
C:\secure-cfg-tool>
If you want configure the way how are values encrypted, see Advanced Usage - Custom Settings (p. 77)
3. Encrypted string has conf#encrypted_property format. The encrypted string can be used as a value of a configuration property in the properties file, clover.xml
file or web.xml
file (see details about
configuration sources in Chapter 6, Configuration Sources and Their Priorities (p. 43)).
Example (snippet of a configuration property file): jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://example.com:3306/clover?useUnicode=true&characterEncoding=utf8 jdbc.username=example jdbc.password=conf#eCflGDlDtKSJjh9VyDlRh7IftAbI/vsH jdbc.dialect=org.hibernate.dialect.MySQLDialect
Note
Alternatively, java -jar secure-cfg-tool.jar command can be used.
76
Chapter 10. Secure
Configuration Properties
Important
Values encrypted by a Secure parameter form (Chapter 13, Secure Parameters
be used as a value of a configuration property.
Advanced Usage - Custom Settings
The way how configuration values are encrypted described so far, uses default configuration settings (a default provider and algorithm). But if there is a need to change these default settings with the custom ones, the secure-
cfg-tool.jar utility offers a set of parameters to achieve that.
Table 10.1. Parameters
Parameter
--algorithm, -a
--file, -f
--help, -h
--providerclass, -c
--providerlocation, -l
--providers, -p
Description
algorithm to encrypt config file location show help
Example
--algorithm PBEWithMD5AndDES
-f C:\User\John\cloverServer.properties
--help custom provider class -c org.provider.ProviderClass
path to jar/folder containing custom provider class (it will be added to classpath)
--providerlocation C:\User\John\lib
\customprovider.jar, -l C:\User\John\lib\ print available security providers and their algorithms
--providers
Note
To demonstrate usage of an external provider the Bouncy Castle provider is used.
To find out a list of algorithms use -p or --providers
C:\secure-cfg-tool>encrypt.bat -p
If you want to find out a list of algorithms of an external provider, you must pass the provider's class name and path to jar file(s)
C:\secure-cfg-tool>encrypt.bat -p -c org.bouncycastle.jce.provider.BouncyCastleProvider -l C:\User\John\bcprov-jdk15on-152.jar
Result might look like this
***** List of available providers and their algorithms *****
Provider: SunJCE
Provider class: com.sun.crypto.provider.SunJCE
Algorithms:
PBEWithMD5AndDES
PBEWithSHA1AndDESede
PBEWithSHA1AndRC2_40
Provider: BC
Provider class: org.bouncycastle.jce.provider.BouncyCastleProvider
Algorithms:
PBEWITHMD2ANDDES
PBEWITHMD5AND128BITAES-CBC-OPENSSL
77
PBEWITHMD5AND192BITAES-CBC-OPENSSL
PBEWITHMD5AND256BITAES-CBC-OPENSSL
Chapter 10. Secure
Configuration Properties
Provider class is displayed on the row starting with Provider class, algorithms are strings with PBE prefix. Both can be used to configure encryption.
Configuring the Encryption Process
Algorithm and provider can be passed to the utility in two ways.
•
Using command line arguments
To change the algorithm use argument -a. Provider remains the default one (SunJCE in case of Oracle Java).
C:\secure-cfg-tool>encrypt.bat -a PBEWithMD5AndDES
Using of an external provider is a little more complex. Provider's class name must be specified (argument
--providerclass or -c) and jar(s) must be added to the classpath (argument --providerlocation, -l). Provider location must point to concrete jar file or directory containing jar(s) and can be used several times for several paths.
C:\secure-cfg-tool>encrypt.bat -a PBEWITHSHA256AND256BITAES-CBC-BC -c org.bouncycastle.jce.provider.BouncyCastleProvider -l C:\User\John\bcprov-jdk15on-152.jar
•
Using configuration file
A configuration file is a common properties file (text file with key-value pairs):
[property-key]=[property-value]
It might look like this (example comes from secure.config.example.properties
, distributed within secure-cfg-tool.zip
):
security.config_properties.encryptor.providerClassName=org.bouncycastle.jce.provider.BouncyCastleProvider
security.config_properties.encryptor.algorithm=PBEWITHSHA256AND256BITAES-CBC-BC
security.config_properties.encryptor.provider.location=C:\\User\\libs
To let utility know about the configuration file use -f argument
C:\secure-cfg-tool>encrypt.bat -f secure.config.example.properties
Note
More jar locations can be set in the security.config_properties.encryptor.providerLocation, locations are delimited by semicolon.
Configuring an application server
CloverETL Server application needs to know how the values have been encrypted, therefore the properties must
be passed to the server (see details in Part III, “ Configuration ” (p. 42)). For example:
78
Chapter 10. Secure
Configuration Properties
...
security.config_properties.encryptor.providerClassName=org.bouncycastle.jce.provider.BouncyCastleProvider
security.config_properties.encryptor.algorithm=PBEWITHSHA256AND256BITAES-CBC-BC
...
Important
If a third-party provider is used, its classes must be accessible for the application server. Property
security.config_properties.encryptor.providerLocation will be ignored.
79
Chapter 11. Logging
Another Useful Logging Settings (p. 80)
Access Log in Apache Tomcat (p. 81)
Main Logs
The CloverETL Server uses the log4j library for logging. The WAR file contains the default log4j configuration.
The log4j configuration file log4j.xml
is placed in
WEB-INF/classes
directory.
By default, log files are produced in the directory specified by system property "java.io.tmpdir" in the cloverlogs
subdirectory.
"java.io.tmpdir" usually contains common system temp dir i.e.
/tmp
. On Tomcat, it is usually
$TOMCAT_HOME/ temp
The default logging configuration (log4j.xml bundled in the clover.war) may be changed to another log4j configuration file using system property log4j.configuration
. If you override the configuration, only the properties from the new file are used.
The log4j.configuration
should contain the URL of the a new log4j configuration file. It's not just file system path, it must be URL, so it may look like this: log4j.configuration=file:/home/clover/config/log4j.xml
It is better to copy the original file and modify the copy, than to create a new one.
Please note, that "log4j.configuration" is not a CloverETL Server config property, but system property, thus it must be set on the JVM command line by -Dlog4j.configuration or in other way suitable for the application container.
Best possibility how to set a system property for each application container is described in the "Installation" chapter.
Since such a configuration overrides the default configuration, it may have influence over Graph run logs. So your own log config has to contain following fragment to preserve Graph run logs
<logger name="Tracking" additivity="false">
<level value="debug"/>
</logger>
Another Useful Logging Settings
These system properties allow for logging of HTTP requests/responses to stdout:
Client side: com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
(for more information consult CloverETL Designer Users's Guide - chapter Integrating CloverETL Designer with
CloverETL Server )
Server side: com.sun.xml.ws.transport.http.HttpAdapter.dump=true
80
Chapter 11. Logging
Access Log in Apache Tomcat
If you need to log all requests processed by server, add the following code to
$CATALINA_HOME/conf/ server.xml
.
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t %D %r %s %b" />
The format defined above has following meaning
[IP address] [date-time] [processing duration in millis] [method] [URL] [protocol+version] [response code] [response size]
The log will look like the next line
172.17.30.243 - - [13/Nov/2014:12:53:03 +0000] 2 "POST /clover/sDispatcher/clusterNodeApi HTTP/1.1" 200 1435"
Graph Run Logs
Each graph or jobflow run has its own log file – for example, in the Server Console, section "Executions History".
By default, these log files are saved in the subdirectory cloverLogs/graph in the directory specified by
"java.io.tmpdir" system property.
It’s possible to specify a different location for these logs with the CloverETL "graph.logs_path" property. This property does not influence main Server logs.
Server Audit Logs
Server Audit Log logs operations called on ServerFacade and JDBC proxy interfaces.
Audit logging can be enabled by setting (adding) the value of CloverETL property logging.logger.server_audit.enabled
to true . In server GUI, you can change the property value in Configuration
→
Setup
→
Configuration File. Audit logging is enabled by default.
The name of output file is server-audit.log
. The file is in the same directory as main server log files.
Default log level is DEBUG, so all operations which may do any change or another important operations (e.g.
login or openJdbcConnection) are logged. To enable logging of all operations, change log level to TRACE in the log4j configuration.
Each logged operation is logged by two messages: entering method and exiting method (if the exception is raised, it's logged instead of output parameters)
• Entering method (marked as "inputParams"). All method's parameters (except for passwords) are printed.
• Exiting method (marked as "outputParams"). Method's return value is printed.
• Exception in method (marked as "EXCEPTION"). Exception's stacktrace is printed.
Message also contains:
• username, if the user is known
• client IP address, if it's known
• cluster node ID
• Interface name and the operation name
Values of transient and lazy initialized (in entity classes) fields and fields with binary content are not printed.
81
Part IV. Administration
Chapter 12. Temp Space Management
Many of the components available in the CloverETL Server require temporary files or directories in order to work correctly. Temp space is a physical location on the file system where these files or directories are created and maintained. CloverETL Server allows you to configure and manage temp spaces - you can specify their locations, see usage of the filesystem etc.
To access this administration section, you need
Temp Space Management permission (p. 110).
Overview
The overview of temp spaces defined in CloverETL Server is available under Configuration > Temp space
management > Overview
The overview panel displays list of temp spaces for each node in the cluster. These properties are displayed for each temp space:
• Root Path - location of the temp space with unresolved placeholders (see note below for placeholders)
• Resolved Path - location of the temp space with resolved placeholders (see note below for placeholders)
• Free Space - remaining space for the temp space
• Filesystem Size - all available space for the temp space (actual size of the filesystem where the temp space resides)
• Filesystem Usage - size of used space in percentage
• Available - the directory exists and is writable
• Status - current status of temp space, can be
Active
or
Suspended
Note
It is possible to use system properties and environment variables as placeholders. See
Using environment variables and system properties (p. 85).
Figure 12.1. Configured temp spaces overview - one default temp space on each cluster node
83
Chapter 12. Temp
Space Management
Management
Temp space management offers an interface to add, disable, enable and delete a temp space. It is accessible under
Configuration > Temp space management > Edit.
The screen is divided in two drop-down areas: Global Configuration and Per Node Configuration. The Global
configuration manages temp spaces of standalone server or in case of a server cluster temp spaces on all its nodes.
The Per Node Configuration allows to maintain temp spaces on each particular node.
Using environment variables and system properties (p. 85)
Initialization
When CloverETL Server is starting the system checks temp space configuration: in case no temp space is configured a new default temp space is created in the directory where java.io.tmpdir
system property points.
The directory is named as follows:
•
${java.io.tmpdir}/clover_temp
in case of a standalone server
•
${java.io.tmpdir}/clover_temp_<node_id>
in case of server cluster
Adding Temp Space
In order to define new temp space enter its path into text field under last row in the table and click the Add link.
If the directory entered does not exist, it will be created.
Tip
The main point of adding additional temp spaces is to enable higher system throughput - therefore the paths entered should point to directories residing on different physical devices to achieve maximal
I/O performance.
84
Chapter 12. Temp
Space Management
Figure 12.2. Newly added global temp space.
Using environment variables and system properties
Environment variables and system properties can be used in the temp space path as a placeholder; they can be arbitrarily combined and resolved paths for each node may differ in accord with its configuration.
Note
The environment variables have higher priority than system properties of the same name. The path with variables are resolved after system has added new temp space and when the server is starting.
In case the variable value has been changed it is necessary to restart the server so that the change takes effect.
Examples:
• Given that an environment variable USERNAME has a value Filip . and is used as a placeholder in the path
C:\Users\${USERNAME}\tmp , the resolved path is C:\Users\Filip\tmp .
• Given that Java system property java.io.tmpdir
has a value
C:\Users\Filip\AppData\Local
\Temp
and the property is used as a placeholder in the path
${java.io.tmpdir}\temp_folder
, the resolved path is
C:\Users\Filip\AppData\Local\Temp\temp_folder
.
• Node node01
has been started with
-Dcustom.temporary.dir=C:\tmp_node01
parameter. Node node02
has been started with
-Dcustom.temporary.dir=C:\tmp_node02
parameter. The declared path is
${custom.temporary.dir}
. The resolved path is different for each node,
C:\tmp_node01
for node01
and
C:\tmp_node02
for node02
.
• When the declared path is
${java.io.tmpdir}\${USERNAME}\tmp_folder
, the resolved path is
C:
\tmp\Filip\tmp_folder
.
85
Chapter 12. Temp
Space Management
Figure 12.3. Temp spaces using environment variables and system properties
Disabling Temp Space
To disable a temp space click on "Disable" link in the panel. Once the temp space has been disabled, no new temporary files will be created in it, but the files already created may be still used by running jobs. In case there are files left from previous or current job executions a notification is displayed.
Note
The system ensures that at least one enabled temp space is available.
86
Chapter 12. Temp
Space Management
Figure 12.4. Disable operation reports action performed
Enabling Temp Space
To enable a temp space click on "Enable" link in the panel. Enabled temp space is active, i.e. available for temporary files and directories creation.
Removing Temp Space
To remove a temp space click on "Remove" link in the panel. Only the disabled temp space may be removed. If there are any running jobs using the temp space, the system will not allow its removal. In case there are some files left in the temp space directory, it is possible to remove them in the notification panel. The available options are:
• Remove - remove temp space from a system, but keep its content
• Remove and delete - remove the temp space from a system and its content too
• Cancel - do not proceed with operation
87
Chapter 12. Temp
Space Management
Figure 12.5. Remove operation asks for confirmation in case there are data present in the temp space
88
Chapter 13. Secure Parameters
Transformation graphs in CloverETL Server environment allow you to define secure graph parameters. Secure graph parameters are regular graph parameters, either internal or external (in a *.prm file), but the values of the graph parameters are not stored in plain text on the file system - encrypted values are persisted instead. This allows you to use graph parameters to handle sensitive information, typically credentials such as passwords to databases.
Secure parameters are only available in CloverETL Server environment, including working with CloverETL
Server Projects in CloverETL Designer.
The encryption algorithm must be initialized with a master password. The master password has to be manually set after server installation in Configuration > Secure Parameters > Master password. Secure parameters cannot be used before the master password is set.
Figure 13.1. Master password initialization
After setting the master password secure parameters are fully available in Graph parameter editor in CloverETL
Designer. When setting value of a secure parameter, it will be automatically encrypted using the master password.
Secure parameters are automatically decrypted by server in graph runtime. A parameter value can also be encrypted in the CloverETL Server Console in the Configuration > Secure Parameters page - use the Encrypt text section.
Figure 13.2. Graph parameters tab with initialized master password
If you change the master password, the secure parameters encrypted using the old master password cannot be decrypted correctly anymore. In that case existing secure parameters need to be encrypted again with the new master password. That can be accomplished simply by setting their value (non-encrypted) again in the Graph
parameter editor. Similar master password inconsistency issue can occur if you move a transformation graph with some secure parameters to another server with a different master password. So it is highly recommended to use the identical master password for all your CloverETL Server installations.
89
Chapter 13. Secure Parameters
See documentation of secure parameters in CloverETL Designer manual for further details.
Secure parameters configuration
Encryption of secure parameters can be further customized via server configuration parameters.
Table 13.1. Secure parameters configuration parameters
Property name Default value
security.job_parameters.encryptor.algorithm
PBEWithMD5AndDES
Description
The algorithm to be used for encryption. This algorithm has to be supported by your JCE provider
(if you specify a custom one, or the default JVM provider if you don't). The name of algorithm should start with PBE prefix.
The list of available algorithms depends on your JCE provider, e.g. for the default SunJCE provider you can find them on http://docs.oracle.com/javase/6/docs/technotes/ guides/security/
SunProviders.html#SunJCEProvider or for the
Bouncy
Castle provider on http:// www.bouncycastle.org/specifications.html
(section Algorithms/PBE)).
security.job_parameters.encryptor.master_password_encryption.password
clover The password used to encrypt values persisted in the database table secure_param_passwd (the master password is persisted there).
security.job_parameters.encryptor.providerClassName
Empty string. The default
JVM provider is used (e.g.
for Oracle Java the SunJCE provider is used)
The name of the security provider to be asked for the encryption algorithm.
It must implement
java.security.Provider
interface. For example set to
org.bouncycastle.jce.provider.BouncyCastleProvider
for the Bouncy Castle JCE provider, see below.
Installing Bouncy Castle JCE provider
Algorithms provided by JVM could be too weak to satisfy an adequate security. Therefore it is recommended to install a third-party JCE provider. Following example demonstrates installation of one concrete provider, Bouncy
Castle JCE provider. Another provider would be installed similarly.
1. Download Bouncy Castle provider jar (e.g. bcprov-jdk15on-150.jar) from http://bouncycastle.org/ latest_releases.html
2. Add the jar to the classpath of your application container running CloverETL Server, e.g. to directory
WEB-
INF/lib
3. Set value of the security.job_parameters.encryptor.providerClassName attribute to
org.bouncycastle.jce.provider.BouncyCastleProvider in file WEB-INF/config.properties
.
4. Set value of the security.job_parameters.encryptor.algorithm attribute to the desired algorithm (e.g.
PBEWITHSHA256AND256BITAES-CBC-BC).
Example of configuration using Bouncy Castle:
90
Chapter 13. Secure Parameters
security.job_parameters.encryptor.algorithm=PBEWITHSHA256AND256BITAES-CBC-BC
security.job_parameters.encryptor.providerClassName=org.bouncycastle.jce.provider.BouncyCastleProvider
91
Chapter 14. Users and Groups
The CloverETL Server has a built-in security module that manages users and groups. User groups control access permissions to sandboxes and operations the users can perform on the Server, including authenticated calls to
Server API functions. A single user can belong to multiple groups.
LDAP or Active Directory can be configured with the Server to authenticate users and optionally assign their effective groups (and permissions) from a global directory.
You can manage users and user groups in Configuration/Users and Groups. Please note that you need a “List users” (“List groups” respectively) permission for that.
92
Chapter 14. Users and Groups
LDAP Authentication
Since 3.2 it's possible to configure CloverETL Server to use LDAP server for users authentication. So the credentials of users registered in LDAP may be used for authentication to any CloverETL Server interface (API or web console).
However authorization (access levels to sandboxes content and privileges for operations) is still handled by Clover security module. Each user, event though logged-in using LDAP authentication, must have his own "user" record
(with related groups) in the CloverETL security module. So there must be the user with the same username and domain set to "LDAP". Such record has to be created by a Server administrator before the the user can log in.
What does the CloverETL do to authenticate an LDAP user?
1. User specifies the LDAP credentials in a login form to the Server web console
2. CloverETL Server looks up a user record and checks whether has "LDAP" domain set
3. If the system is configured to use LDAP for authentication only, it attempts to connect to LDAP server using user's credentials. If it succeeds, the user is logged in.
4. In case the system is configured for user group synchronization the procedure is as follows:
5. CloverETL Server connects to the LDAP server and checks whether the user exists (it uses specified search to lookup in LDAP).
6. If the user exists in LDAP, CloverETL Server performs authentication.
7. If succeeded, CloverETL Server searches LDAP for user's groups.
8. Clover user is assigned to the Clover groups according to his current assignation to the LDAP groups.
9. User is logged-in.
Note
Switching domains:
• If a user was created as LDAP and then switched to clover domain, you have to set a password for him in Change password tab.
• If a user was created as clover and then switched to LDAP domain, he has a password in clover domain, but it is overridden by the LDAP password. After switching back to clover domain, the original password is re-used. It can be reset in the Change password tab if needed (e.g.
forgotten).
Configuration
By default CloverETL Server allows only its own internal mechanism for authentication. To enable authentication with LDAP, set the configuration property "security.authentication.allowed_domains" properly. It is a list of user domains that are used for authentication.
Currently there are 2 authentication mechanism implemented: "LDAP" and "clover" ("clover" is an identifier of
CloverETL internal authentication and may be changed by security.default_domain property, but only for whitelabelling purposes). To enable LDAP authentication, set value to "LDAP" (only LDAP) or "clover,LDAP". Users from both domain may login. It's recommended to allow both mechanisms together, until the LDAP is properly configured. So the admin user can still login to web GUI although the LDAP connection isn't properly configured.
You can use Setup to configure LDAP authentication. See the section called “ LDAP
93
Chapter 14. Users and Groups
Basic LDAP connection properties
# Implementation of context factory security.ldap.ctx_factory=com.sun.jndi.ldap.LdapCtxFactory
# URL of LDAP server security.ldap.url=ldap://hostname:port
# User DN pattern that will be used to create LDAP user DN from login name. security.ldap.user_dn_pattern=uid=${username},dc=company,dc=com
Depending on the LDAP server configuration the property security.ldap.user_dn_pattern
can be pattern for user's actual distinguished name in the LDAP directory, or just the login name - in such case just set the property to ${username} .
Configuration of user and group lookup
In order to be able to synchronize the Clover groups with those defined in LDAP directory, the security.ldap.user_dn_pattern
has to be left unspecified. There are additional properties required so that the server is able to search the LDAP directory.
# User DN of a user that has sufficient privileges to search LDAP for users and groups security.ldap.userDN=cn=Manager,dc=company,dc=com
# The password for user mentioned above.
security.ldap.password=
There are optional settings affecting how the LDAP directory is searched.
# Timeout for queries searching the directory.
security.ldap.timeout=5000
# Maximal number of records that the query can return.
security.ldap.records_limit=2000
# How LDAP referrals are processed, possible values are: 'follow', 'ignore' and 'throw'.
# The default depends on the context provider. security.ldap.referral=
Specified values work for this specific LDAP tree:
• dc=company,dc=com
• ou=groups
• cn=admins
(objectClass=groupOfNames,member=(uid=smith,dc=company,dc=com),member=(uid=jones,dc=company,dc=com))
• cn=developers (objectClass=groupOfNames,member=(uid=smith,dc=company,dc=com))
• cn=consultants (objectClass=groupOfNames,member=(uid=jones,dc=company,dc=com))
• ou=people
• uid=smith (fn=John,sn=Smith,[email protected])
• uid=jones (fn=Bob,sn=Jones,[email protected])
Following properties are necessary for lookup for the LDAP user by his username. (step [4] in the login process above)
# Base specifies the node of LDAP tree where the search starts security.ldap.user_search.base=dc=company,dc=eu
# Filter expression for searching the user by his username.
# Note, that this search query must return just one record.
# Placeholder ${username} will be replaced by username specified by the logging user.
94
Chapter 14. Users and Groups security.ldap.user_search.filter=(uid=${username})
# Scope specifies type of search in "base". There are three possible values: SUBTREE | ONELEVEL | OBJECT
# http://download.oracle.com/javase/6/docs/api/javax/naming/directory/SearchControls.html
security.ldap.user_search.scope=SUBTREE
Following properties are names of attributes from the search defined above. They are used for getting basic info about the LDAP user in case the user record has to be created/updated by Clover security module: (step [6] in the login process above) security.ldap.user_search.attribute.firstname=fn security.ldap.user_search.attribute.lastname=sn security.ldap.user_search.attribute.email=mail
# This property is related to the following step "searching for groups".
# Groups may be obtained from specified user's attribute, or found by filter (see next paragraph)
# Leave this property empty if the user doesn't have such attribute.
security.ldap.user_search.attribute.groups=memberOf
In the following step, clover tries to find groups which the user is assigned to. (step [4] in the login process above).
There are two ways how to get list of groups which the user is assigned to. The user-groups relation is specified on the "user" side. The user record has some attribute with list of groups. It's "memberOf" attribute usually. Or the relation is specified on the "group" side. The group record has an attribute with list of assigned users. It's
"member" attribute usually.
In case the relation is specified on users side, please specify property: security.ldap.user_search.attribute.groups=memberOf
Leave it empty otherwise.
In case the relation is specified on the groups side, set properties for searching: security.ldap.groups_search.base=dc=company,dc=com
# Placeholder ${userDN} will be replaced by user DN found by the search above
# If the filter is empty, searching will be skipped.
security.ldap.groups_search.filter=(&(objectClass=groupOfNames)(member=${userDN})) security.ldap.groups_search.scope=SUBTREE
Otherwise, please leave property security.ldap.groups_search.filter empty, so the search will be skipped.
Clover user record will be assigned to the clover groups according to the LDAP groups found by the search (or the attribute). (Groups synchronization is performed during each login)
# Value of the following attribute will be used for lookup for the Clover group by its code.
# So the user will be assigned to the Clover group with the same "code" security.ldap.groups_search.attribute.group_code=cn
95
Chapter 14. Users and Groups
Users
This section is intended to users management. It offers features in dependence on user's permissions. I.e., user may enter this section, but cannot modify anything. Or user may modify, but cannot create new users.
All possible features of users section:
• create new user
• modify basic data
• change password
• disable/enable user
• assign user to groups - Assignment to groups gives user proper permissions
Table 14.1. After default installation on an empty DB, admin user is created automatically
clover
User name Description
Clover user has admin permissions, thus default password "clover" should be changed after installation.
Figure 14.1. Web GUI - section "Users" under "Configuration"
Table 14.2. User attributes
Domain
Username
Password
Attribute Description
Domain which is the origin of the user. There are only two possible values currently: "clover" or "ldap".
Common user identifier. Must be unique, cannot contain spaces or special characters, just letters and numbers.
Case sensitive password. If user looses his password, the new one must be set. Password is stored in encrypted form for security reasons, so it cannot be retrieved from database and must be changed by the user who has proper permission for such operation.
First name
Last name
E-mail E-mail address which may be used by CloverETL administrator or by CloverETL server for automatic notifications. See
96
Chapter 14. Users and Groups
Edit user record
User with permission "Create user" or "Edit user" can use this form to set basic user parameters.
Figure 14.2. Web GUI - edit user
Change users Password
If user looses his password, the new one must be set. So user with permission "Change passwords" can use this form to do it.
Figure 14.3. Web GUI - change password
Group assignment
Assignment to groups gives user proper permissions. Only logged user with permission "Groups assignment" can access this form and specify groups which the user is assigned in. See
Groups (p. 99) for details about
permissions.
97
Chapter 14. Users and Groups
Figure 14.4. Web GUI - groups assignment
Disabling / enabling users
Since user record has various relations to the logs and history records, it can't be deleted. So it's disabled instead.
It basically means, that the record doesn't display in the list and the user can't login.
However disabled user may be enabled again. Please note, that disabled user is removed from its groups, so groups should be assigned properly after re-enabling.
98
Chapter 14. Users and Groups
Groups
Group is an abstract set of users, which gives assigned users some permissions. So it is not necessary to specify permission for each single user.
There are independent levels of permissions implemented in CloverETL Server
• permissions to Read/Write/eXecute in sandboxes - sandbox owner can specify different permissions for different groups. See
Sandbox Content Security and Permissions (p. 114) for details.
• permissions to perform some operation - user with operation permission "Permission assignment" may assign specific permission to existing groups.
• permissions to launch specific service - see
Launch Services (p. 216) for details.
Table 14.3. Default groups created during installation
admins all users
Group name Description
This group has operation permission "all" assigned, which means, that it has unlimited permission. Default user "clover" is assigned to this group, which makes him administrator.
Every single CloverETL user is assigned to this group by default.
It is possible to remove user from this group, but it is not a recommended approach. This group is useful for some permissions to sandbox or some operation, which you would like to make accessible for all users without exceptions.
Figure 14.5. Web GUI - section "Groups"
Users Assignment
Relation between users and groups is N:M. Thus in the same way, how groups are assignable to users, users are assignable to groups.
99
Chapter 14. Users and Groups
Figure 14.6. Web GUI - users assignment
Groups permissions
Groups permissions are structured as a tree, where permissions are inherited from the root to leafs. Thus if some permission (tree node) is enabled (blue dot), all permissions in sub tree are automatically enabled (white dot).
Permissions with red cross are disabled.
Thus for "admin" group just "all" permission is assigned, every single permission in sub tree is assigned automatically.
Figure 14.7. Tree of permissions
With no of the following privileges, user can: login to the server console, create server project (in Designer) from its own sandbox, create a file in its own existing sandbox, and run graphs.
• all
A user with this permission has all available permissions. Admin group has all permissions by default.
• Unlimited access to sandboxes
This permission allows user to perform operations on all sandboxes, even if the sandbox accessibility is not specified explicitly.
Unlimited access to sandboxes permission does not include the suspend sandbox permission (p. 107).
• Sandboxes
This permission allows user work with sandboxes. This permission contains all the permissions below. The user can perfom operations only on sandboxes owned by himself or on sandboxes with explicitly added access to him.
100
Chapter 14. Users and Groups
See Chapter 15, Server Side Job Files - Sandboxes (p. 111).
• List sandbox
In server web interface, this permission allows user to list her sandboxes and list sandboxes with read permission granted to the user's group.
In server web interface, this permission is necessary to create, edit, or delete sandboxes.
Within a sandbox with write access granted, user can edit or remove files and create or delete directories even without this permission.
• Create sandbox
This permission allows user to create a new sandbox.
If the sandbox is to be created in web interface, the user is required to have the
list sandbox permission (p. 101).
• Delete sandbox
This permission allows user to delete a sandbox.
If the sandbox is to be deleted in web interface, the user is required to have the
list sandbox permission (p. 101).
• Edit sandbox
This permission allows user to edit a sandbox.
If the sandbox is to be modified in web interface, the user is required to have the
list sandbox permission (p. 101).
• May delete files missing in uploaded ZIP
In Sandbox
→
Upload ZIP, this permission allows user to use a checkbox to delete files missing in the
ZIP to be uploaded. If the user does not have this permission, the checkbox to delete mission files in
ZIP is not displayed.
If the sandbox is to be uploaded from a ZIP file in server web interface, it is required to have the
list sandbox permission (p. 101).
• Scheduling
This permission allows user to manage schedules.
See Chapter 22, Scheduling (p. 165).
• List schedule
This permission allows user to list all schedules.
• List schedule limited
This permission allows user to list the enabled schedules.
• Create schedule
This permission allows user to create a new schedule.
101
Chapter 14. Users and Groups
The user needs the
list schedule limited permission (p. 101) to access the scheduling section to create
a new schedule.
• Delete schedule
This permission allows user to delete the schedule.
User needs
list schedule limited permission list schedule permission (p. 101) to access
the scheduling section to delete the schedule.
• Edit schedule
This permision allows user to edit the schedule.
User needs
list schedule limited permission list schedule permission (p. 101) to access
the scheduling section to edit the schedule.
• Event listeners
This permission allows user to manage event listeners.
See Chapter 24, Listeners (p. 176).
• List of Event Listeners
This permission allows user to list all event listeners.
• List of Jobflow Event Listeners unlimited
This permission allows user to list jobflow event listeners.
See Jobflow Event Listeners (p. 184)
• List of Jobflow Event Listeners limited
This permission allows user to list jobflow event listeners of sandboxes the user can read from.
• List of Graph Event Listeners unlimited
This permission allows user to list all graph event listeners.
See Graph Event Listeners (p. 177).
• List of Graph Event Listeners limited
This permission allows user to list graph event listeners from sandboxes the user can read from.
• List of File Event Listeners unlimited
This permission allows user to list all file event listeners.
See File Event Listeners (remote and local) (p. 194).
• List of File Event Listeners limited
This permission allows user to list all file event listeners.
• List of JMS Event Listeners unlimited
This permission allows user to list all JMS listeners.
See JMS Messages Listeners (p. 187).
102
Chapter 14. Users and Groups
• List of JMS Event Listeners limited
This permission allows user to list all JMS listeners.
• List of Universal Event Listeners unlimited
This permission allows user to list all universal event listeners.
See Universal Event Listeners (p. 192).
• List of Universal Event Listeners limited
This permission allows user to list all universal event listeners.
See Universal Event Listeners (p. 192).
• Create Event Listener
This permission allows user to create event listeners.
If the event listener is to be created in server web interface, the user needs to have permission to list the event listeners of the particular type.
• Create Jobflow Event Listener
This permission allows user to create a new Jobflow Event listener.
If the jobflow event listener is to be created in server web interface, the user needs to have the
list of jobflow event listeners limited permission (p. 102).
See Jobflow Event Listeners (p. 184).
• Create Graph Event Listener
This permission allows user to create a graph event listener.
See Graph Event Listeners (p. 177).
• Create File Event Listener
This permission allows user to create a graph event listener.
If the file event listener is to be created in server web interface, the user needs to have the
list of file event listeners limited permission (p. 102).
See File Event Listeners (remote and local) (p. 194).
• Create JMS Listener
This permission allows user to create a JMS event listener.
If the JMS event listener is to be created in server web interface, the user needs to have the
list of JMS event listeners limited permission (p. 103).
See JMS Messages Listeners (p. 187).
• Create Universal Event Listener
103
Chapter 14. Users and Groups
This permission allows user to create a universal event listener.
If the universal event listener is to be created in server web interface, the user needs to have the
list of universal event listeners limited permission (p. 103).
See Universal Event Listeners (p. 192).
• Edit Event Listener
This permission allow user to edit an event listener.
If the event listener is to be created in server web interface, the user needs to have permission to list event listener of the particular type.
• Edit Jobflow Event Listener
This permission allows user to edit a jobflow event listener.
If the jobflow event listener is to be edited in server web interface, the user needs to have the
list of jobflow event listeners limited permission (p. 102).
See Jobflow Event Listeners (p. 184).
• Edit Graph Event Listener
This permission allows user to edit a graph event listener.
If the graph event listener is to be edited in server web interface, the user needs to have the
list of graph event listeners limited permission (p. 102).
See Graph Event Listeners (p. 177).
• Edit File Event Listener
This permission allows user to edit a file event listener.
See File Event Listeners (remote and local) (p. 194).
• Edit JMS Event Listener
This permission allows user to edit a JMS event listener.
If the JMS event listener is to be edited in server web interface, the user needs to have the
list of JMS event listeners limited permission (p. 103).
• Edit Universal Event Listener
This permission allows user to edit a universal event listener.
If the universal event listener is to be edited in server web interface, user needs to have permission
list of universal event listeners limited permission (p. 103).
See Universal Event Listeners (p. 192).
• Delete Event Listener
This permission allows user to delete event listeners.
104
Chapter 14. Users and Groups
• Delete Jobflow Event Listener
This permisison allows user to delete a jobflow event listener.
User needs to have the
delete graph event listener permission (p. 105) to delete a jobflow event
listener.
It the jobflow event listener is to be deleted in server web interface, the user needs to have the
list of jobflow event listeners limited permission (p. 102)
• Delete Graph Event Listener
This permission allows user to delete a graph event listener.
See Graph Event Listeners (p. 177).
• Delete File Event Listener
This permission allows user to delete a file event listener.
If the file event listener is to be deleted in server web interface, the user needs to have the
list of file event listeners limited permission (p. 102).
See File Event Listeners (remote and local) (p. 194).
• Delete JMS Event Listener
This permission allows user to delete a JMS Event Listener.
The user needs to have the
delete graph event listener permission (p. 105) to delete a JMS event
listener.
• Delete Universal Event Listener
This permission allows user to delete a universal event listener.
The user needs to have the
delete graph event listener permission (p. 105) to delete universal event
listener.
If the universal event listener is to be deleted in server web interface, the user needs to have the
list of universal event listeners limited permission (p. 103).
See Universal Event Listeners (p. 192).
• Manual task Execution
This permission allows user to manually execute a task (send an email, execute a script, etc.) with an immediate effect.
See Chapter 21, Manual Task Execution (p. 164).
• Unlimited access to execution history
105
Chapter 14. Users and Groups
This permission allows user to perform the same operations as
unlimited access to execution history list permission (p. 106).
• Unlimited access to execution history list
This permission allows user to view execution history of all jobs.
• Limited access to execution history list
This permission allows user to view execution history of jobs from sandboxes the user can read from.
In Designer, this permission is required to be able to view Execution log in Designer's console and execution history in Execution tab.
• Launch Services
This permission allows user to list, create, edit, and delete launch services.
• List Launch Services unlimited
This permission allows user to list all launch services.
• List Launch Services Limited
This permission allows user to list launch services from sandboxes the user can read from.
• Create Launch service
This permission allows user to create a new launch service.
User has to have the
create graph event listener permission (p. 103) to bind the launch service with a
graph.
If the launch service is to be created in server web interface, the user has to have the
list launch services limited permission (p. 106) (or the list launch services unlimited permission
section with launch services.
• Delete Launch Service
This permission allows user to delete a launch service.
User has to have delete graph event listener permission (p. 105) to delete a launch service.
• Edit Launch Service
This permission allows user to edit a launch services.
User has to have edit graph event listener (p. 104) to edit the launch service.
If the launch service is to be edited in server web interface, the user needs to have the
• Tasks history
This permission allows user to access Tasks history section.
See Chapter 20, Tasks (p. 144).
106
Chapter 14. Users and Groups
• Monitoring
Monitoring permission grants user all its subpermissions.
• Monitoring section
This permission allows user to access the monitoring section.
See Chapter 16, CloverETL Server Monitoring (p. 124).
• Suspend
This permission allows user to suspend the server, a cluster node, or a sandbox.
The user needs to have the monitoring section permission (p. 107) to access the Monitoring section.
• Suspend server
This permission allows user to suspend or resume the server.
The user needs to have the monitoring section permission (p. 107) to access the monitoring section.
• Suspend cluster node
This permission allows user to suspend or resume a cluster node.
The user needs to have the monitoring section permission (p. 107) to access the monitoring section.
• Suspend sandbox
This permission allows user to suspend a sandbox. The user needs to have
list sandbox permission (p. 101) to view the sandboxes to suspend them.
See also Chapter 15, Server Side Job Files - Sandboxes (p. 111).
• Reset caches
Deprecated.
• Running jobs unlimited
If the graph is to be run from server web interface, the user needs to have the
list sandbox permission (p. 101) to list the graphs.
• Running jobs limited
If the graph is to be run from server web interface, the user needs to have the
list sandbox permission (p. 101) to list the graphs.
• Configuration
This permission allows user to access the configuration section.
• Users
This permission allow user to access the Users section and configure user accounts.
• List user
This permission allows user to list users and access to the Users administation section (Configuration
→
Users)
107
Chapter 14. Users and Groups
• Change passwords
This permission allows user to change his password and to change password of another user.
To see list of users, the user needs the
list user permission (p. 107).
• Edit user
This permission allows user to change group assignment.
To see the list of users, the user needs to have the list user permission (p. 107).
• Edit own profile and password
This permisison allows user to change his profile (first name, last name, email, and password).
The user can access her profile in main web onsole view under username, in upper right corner of the page.
• Delete user
This permission allows user to disable a user.
The user needs to have the list user permission (p. 107) to list available users.
• Create user
This permission allows user to create a new user.
If the user is to be created in server web interface, the creating user needs to have the
list user permission (p. 107) to list users to access this option.
• Groups assignement
This permission allows user to assign users to groups.
The user needs to have the
edit user permission (p. 108) to sucessfully finish the assigment of users
to groups.
If the user is to be created in server web interface, the creating user needs to have the
list user permission (p. 107) to list users to access this option.
• Groups
This permission allows user to manage groups: user can list groups, create groups, delete groups, edit the group, assign users to the group, and change permissions of the group.
• List groups
This permission allows user to list groups. This permission is necessary for use of other options from the
Groups group.
• Create group
This permission allows user to create a new user group.
If the user group is to be created in server web interface, the user needs to have the
list groups permission (p. 108) to view a list of groups and to access this option.
• Delete group
108
Chapter 14. Users and Groups
This permission allows user to delete a user group.
Only empty groups can be deleted. You need to have the
list groups permission (p. 108) to view list
of groups and to access this option.
• Edit group
This permission allow user to edit user groups.
This permission does not include User assignment and Permission assignment.
If the user group is to be edited from server web interface, the user needs to have the
list groups permission (p. 108).
• Users assignment
This permission allows user to assign users to groups.
The user needs
Edit group permission (p. 109) to commit the changes in the assignment.
If the assignment is to be edited in server web interface, the user needs to have the
list groups permission (p. 108) to list the groups.
• Permission assignment
This permission allows user to configure group Permissions.
The user needs have the
Edit group permission (p. 109) to commit the changes.
If the permissions are to be edited in server web interface, the user needs to have the
list groups permission (p. 108) to list the groups.
• Secure parameters administration
• Secure params
This permission allows user to change the value of a secure parameter.
The user can use secure parameters in graphs even without this permission.
• CloverETL/System info sections
This permission allows user to view System Info and CloverETL Info sections.
• CloverETL Server properties
This permission allows user to view Server Properties tab and Data Profiler properties tab in CloverETL
Info section.
The user needs to have the
CloverETL/System info sections permission (p. 109) to access CloverETL
Info section.
• Reload license
This permission allows user to reload and view the server license.
The user needs to have the
CloverETL/System info sections permission (p. 109) to access the
Configuration section.
• Upload license
109
Chapter 14. Users and Groups
This permission allows user to update the server license.
The user needs to have the
CloverETL/System info sections permission (p. 109) to access the
Configuration section.
See Installation of CloverETL Server License (p. 28).
• Server Configuration Management
This permission allows user to import and export the server configuration.
See Chapter 17, Server Configuration Migration (p. 132).
• Export Server Configuration
This permission allows user to export the server configuration.
See Server Configuration Export (p. 133).
• Import Server Configuration
This permission allows user to import the server configuration.
See Server Configuration Import (p. 134).
• Temp Space Management
This permission allows user to access Temp Space Management section.
See Chapter 12, Temp Space Management (p. 83).
• Server Setup
This permission allows user to access the server setup.
• Heap Memory Dump
This permission allows user to create a Thread dump and a Heap Memory Dump.
See Chapter 18, Diagnostics (p. 138).
• Groovy Code API
This permission allows user to run groovy scripts.
• Open Profiler Reporting Console
This permission allows user to login to the Profiler reporting console.
The permission is necessary to view the results of Clover Profiling Jobs in Designer.
Even without this permission, a user can create and run .cpj jobs from Designer.
110
Chapter 15. Server Side Job Files - Sandboxes
A sandbox is a place where you store all your project’s transformation graph files, jobflows, data, and other resources. It’s a server side analogy to a Designer project. The Server adds additional features to sandboxes, like user permissions management and global per-sandbox configuration options.
The Server and the Designer are integrated so that you are able to connect to a Server sandbox using a “Server
Project” in your Designer workspace. Such a project works like a remote file system – all data is stored on the
Server and accessed remotely. Nonetheless, you can do everything with Server Projects the same way as with local projects – copy and paste files, create, edit, and debug graphs, etcetera. See the CloverETL Designer manual for details on configuring a connection to the Server.
Technically, a sandbox is a dedicated directory on the Server host file system and its contents are managed by the Server. Advanced types of sandboxes, like “partitioned sandbox” have multiple locations to allow distributed
another sandbox within – it’s a single root path for a project.
It's recommended to put all sandboxes in a folder outside the CloverETL Server installation (by default the sandboxes would be stored in the ${user.data.home}/CloverETL/sandboxes, where the "user.data.home" is automatically detected user home directory). However, each sandbox can be located on the file system independently of the others if needed. The containing folder and all its contents must have read/write permission for the user under which the CloverETL Server/application server is running.
Figure 15.1. Sandboxes Section in CloverETL Server Web GUI
Each sandbox in non-cluster environment is defined by following attributes:
111
Chapter 15. Server Side
Job Files - Sandboxes
Table 15.1. Sandbox attributes
Sandbox ID
Sandbox
Sandbox root path
Owner
A unique "name" of the sandbox. It is used in server APIs to identify sandbox. It must meet common rules for identifiers. It is specified by user in during sandbox creation and it can be modified later. Note: modifying is not recommended, because it may be already used by some
APIs clients.
Sandbox name used just for display. It is specified by user in during sandbox creation and it can be modified later.
Absolute server side file system path to sandbox root. It is specified by user during sandbox creation and it can be modified later. Instead of the absolute path, it's recommended to use ${sandboxes.home} placeholder, which may be configurable in the CloverETL Server configuration. So e.g. for the sandbox with ID "dataReports" the specified value of the
"root path" would be "${sandboxes.home}/dataReports". Default value of "sandboxes.home" config property is "${user.data.home}/CloverETL/sandboxes" where the "user.data.home" is configuration property specifying home directory of the user running JVM process - it's OS dependent). Thus on the unix-like OS, the fully resolved sandbox root path may be: "/home/
clover/CloverETL/sandboxes/dataReports". See Chapter 29, Clustering Features
for details about sandboxes root path in cluster environment.
It is set automatically during sandbox creation. It may be modified later.
112
Chapter 15. Server Side
Job Files - Sandboxes
Referencing Files from the ETL Graph or Jobflow
In some components you can specify file URL attribute as a reference to some resource on the file system. Also external metadata, lookup or DB connection definition is specified as reference to some file on the filesystem.
With CloverETL Server there are more ways how to specify this relation.
• Relative path
All relative paths in your graphs are considered as relative paths to the root of the same sandbox which contains job file (ETL graph or Jobflow).
• sandbox:// URLs
Sandbox URL allows user to reference the resource from different sandboxes with standalone CloverETL Server or the cluster. In cluster environment, CloverETL Server transparently manages remote streaming if the resource is accessible only on some specific cluster node.
See Using a Sandbox Resource as a Component Data Source (p. 234) for details about the sandbox URLs.
113
Chapter 15. Server Side
Job Files - Sandboxes
Sandbox Content Security and Permissions
Each sandbox has its owner which is set during sandbox creation. This user has unlimited privileges to this sandbox as well as administrators. Another users may have access according to sandbox settings.
Figure 15.2. Sandbox Permissions in CloverETL Server Web GUI
Permissions to a specific sandbox are modifiable in Permissions tab in sandbox detail. In this tab, selected user groups may be allowed to perform particular operations.
There are 3 types of operations:
Table 15.2. Sandbox permissions
Read
Write
Execute
Profiler Read
Profiler Admin
Users can see this sandbox in their sandboxes list.
Users can modify files in the sandbox through CS APIs.
Users can execute jobs in this sandbox. Note: jobs executed by "graph event listener" and
similar features is actually executed by the same user as job which is source of event. See details in "graph event listener". Job executed by schedule trigger is actually executed by
the schedule owner. See details in Chapter 22,
(p. 165). If the job needs any
files from the sandbox (e.g. metadata), user also must have read permission, otherwise the execution fails.
User can view results of profiler jobs executed from the sandbox.
User can administer results of profiler jobs executed from the sandbox.
Please note that, these permissions modify access to the content of specific sandboxes. In additions, it's possible to configure permissions to perform operations with sandbox configuration. e.g. create sandbox, edit sandbox, delete
sandbox, etc. Please see Chapter 14, Users and Groups (p. 92) for details.
114
Chapter 15. Server Side
Job Files - Sandboxes
Sandbox Content
Sandbox should contain jobflows, graphs, metadata, external connection and all related files. Files, especially graph or jobflow files, are identified by relative path from sandbox root. Thus you need two values to identify specific job file: sandbox and path in sandbox. Path to the Jobflow or ETL graph is often referred as "Job file".
Figure 15.3. Web GUI - section "Sandboxes" - context menu on sandbox
Although web GUI section sandboxes isn't file-manager, it offers some useful features for sandbox management.
Figure 15.4. Web GUI - section "Sandboxes" - context menu on folder
Download sandbox as ZIP
Select a sandbox in left panel, then web GUI displays button "Download sandbox as ZIP" in the tool bar on the right side.
Created ZIP contains all readable sandbox files in the same hierarchy as on file system. You can use this ZIP file for upload files to the same sandbox, or another sandbox on different server instance.
115
Chapter 15. Server Side
Job Files - Sandboxes
Figure 15.5. Web GUI - download sandbox as ZIP
Upload ZIP to sandbox
Select a sandbox in left panel. You must have write permission to the selected sandbox. Then select tab "Upload
ZIP" in the right panel. Upload of a ZIP is parametrized by couple of switches, which are described below. Open a common file chooser dialog by button "+ Upload ZIP". When you choose a ZIP file, it is immediately uploaded to the server and result message is displayed. Each row of the result message contains description of one single file upload. Depending on selected options, file may be skipped, updated, created or deleted.
Figure 15.6. Web GUI - upload ZIP to sandbox
116
Chapter 15. Server Side
Job Files - Sandboxes
Figure 15.7. Web GUI - upload ZIP results
Table 15.3. ZIP upload parameters
Label Description
Encoding of packed file names
File names which contain special characters (non ASCII) are encoded. By this select box, you choose right encoding, so filenames are decoded properly.
Overwrite existing files If this switch is checked, existing file is overwritten by a new one, if both of them are stored in the same path in the sandbox and both of them have the same name.
Replace content If this option is enabled, all files which are missing in uploaded ZIP file, but they exist in destination sandbox, will be deleted. This option might cause loose of data, so user must have special permission "May delete files, which are missing in uploaded ZIP" to enable it.
Download file in ZIP
Select a file in the left panel, then web GUI displays button "Download file as ZIP" in the tool bar on the right side.
Created ZIP contains just selected file. This feature is useful for large files (i.e. input or output file) which cannot be displayed directly in web GUI. So user can download it.
Figure 15.8. Web GUI - download file as ZIP
117
Chapter 15. Server Side
Job Files - Sandboxes
Download file HTTP API
It is possible to download/view sandbox file accessing "download servlet" by simple HTTP GET request: http://[host]:[port]/[Clover Context]/downloadFile?[Parameters]
Server requires BASIC HTTP Authentication. Thus with linux command line HTTP client "wget" it would look like this: wget --user=clover --password=clover
http://localhost:8080/clover/downloadFile?sandbox=default\&file=data-out/data.dat
Please note, that ampersand character is escaped by back-slash. Otherwise it would be interpreted as commandline system operator, which forks processes.
URL Parameters
• sandbox - Sandbox code. Mandatory parameter.
• file - Path to the file relative from sandbox root. Mandatory parameter.
• zip - If set to "true", file is returned as ZIP and response content type is "application/x-zip-compressed". By default it is false, so response is content of the file.
118
Chapter 15. Server Side
Job Files - Sandboxes
Job Config Properties
Each ETL graph or Jobflow may have set of config properties, which are applied during the execution. Properties are editable in web GUI section "sandboxes". Select job file and go to tab "Config properties".
The same config properties are editable even for each sandbox. Values specified for sandbox are applied for each job in the sandbox, but with lower priority then config properties specified for the job.
If neither sandbox nor job have config properties specified, defaults from main server configuration are applied. Global config properties related to Job config properties have prefix "executor.". E.g. server property
In addition, it is possible to specify additional job parameters, which can be used as placeholders in job XML.
Please keep in mind, that these placeholders are resolved during loading and parsing of XML file, thus such job couldn't be pooled.
If you use a relative path, the path is relative to
${SANDBOX_ROOT}
.
In path definition, you can use system properties - e.g.
${java.io.tmpdir}
- and some of server config properties:
${sandboxes.home}
,
${sandboxes.home.partitioned}
and
${sandboxes.home.local}
.
Table 15.4. Job config parameters
Property name
tracking_interval enqueue_executions log_level max_graph_instance_age classpath
2000 false
INFO
0
Default value
max_running_concurrently unlimited
Description
Interval in ms for sampling nodes status in running transformation.
Max number of concurrently running instances of this transformation. In cluster environment, the limit is per node.
Boolean value. If it is true, executions above max_running_concurrently are enqueued, if it is false executions above max_running_concurrently fail.
Log4j log level for this graph executions. (ALL
| TRACE | DEBUG | INFO | WARN | ERROR
| FATAL) For lower levels (ALL, TRACE or
DEBUG), also root logger level must be set to lower level. Root logger log level is INFO by default, thus transformation run log does not contain more detail messages then INFO event if job config
parameter "log_level" is set properly. See Chapter 11,
Logging (p. 80) for details about log4j configuration.
A time interval in ms which specifies how long may a transformation instance last in server's cache.
0 means that the transformation is initialized and released for each execution. The transformation cannot be stored in the pool and reused in some cases (a transformation uses placeholders using dynamically specified parameters)
List of paths or jar files which contain external classes used in the job file (transformations, generators, JMS processors). All specified resources will be added to runtime classpath of the transformation job. All
Clover Engine libraries and libraries on applicationserver's classpath are automatically on the classpath. Separator is specified by Engine property
119
Property name
compile_classpath classloader_caching skip_check_config password verbose_mode use_jmx debug_mode
Chapter 15. Server Side
Job Files - Sandboxes
Default value Description
"DEFAULT_PATH_SEPARATOR_REGEX".
Directory path must always end with a slash character
"/", otherwise ClassLoader doesn't recognize it's a directory. Server always automatically adds "trans" subdirectory of job's sandbox, so It doesn't have to be added explicitly.
List of paths or jar files which contain external classes used in the job file (transformations, generators, JMS processors) and related libraries for their compilation.
Please note, that libraries on applicationserver's classpath aren't included automatically.
Separator is specified by Engine property
"DEFAULT_PATH_SEPARATOR_REGEX". The directory path must always end with a slash character
"/", otherwise ClassLoader doesn't recognize it's a directory. Server always automatically adds
"SANDBOX_ROOT/trans/" directory and all JARs in "SANDBOX_ROOT/lib/" directory, so they don't have to be added explicitly.
false Clover creates new classloaders whenever is necessary to load a class in runtime. For example,
Reformat component with a Java transformation has to create a new classloader to load the class.
It is worth noting that classloaders for JDBC drivers are not re-created. Classloader cache is used to avoid PermGen out of memory errors
(some JDBC drivers automatically register itself to
DriverManager, which can cause the classloader cannot be released by garbage collector). This behaviour can be inconvenient for example if you want to share POJO between components. For example, a Reformat component creates an object
(from a jar file on runtime classpath) and stores it into a dictionary. Another Reformat component get the object from the dictionary and tries to cast the object to expected class. ClassCastException is thrown due different classloaders used in the
Reformat components. Using this flag you can force
CloverServer to re-use classloader when possible.
default value is taken from engine property
Switch which specifies whether check config must be performed before transformation execution.
true true false
This property is deprecated. Password for decoding of encoded DB connection passwords.
If true, more descriptive logs of job runs are generated.
If true, job executor registers jmx mBean of running transformation.
If true, edges with debug enabled will store data into files in a debug directory.
Without explicit setting, running of a graph from
Designer with server integration would set the debug_mode to true. On the other hand, running of a
120
Chapter 15. Server Side
Job Files - Sandboxes delete_obsolete_temp_files false use_local_context_url jobflow_token_tracking locale
Property name
time_zone
Default value Description
graph from the server console sets the debug_mode to false.
If true, system will remove temporary files produced during previous finished runs of the respective job.
false true
DEFAULT_LOCALE engine property
DEFAULT_TIME_ZONE engine property
This property is useful together with enabled debug mode ensuring that obsolete debug files from previous runs of a job are removed from temp space. This property is set to "true" by default when executing job using designer-server integration.
If true, the context URL of a running job will be a local "file:" URL. Otherwise, a "sandbox:" URL will be used.
If false, token tracking in jobflow executions will be disabled.
Can be used to override the DEFAULT_LOCALE engine property.
Can be used to override
DEFAULT_TIME_ZONE engine property.
the
Figure 15.9. Job config properties
121
Chapter 15. Server Side
Job Files - Sandboxes
WebDAV Access to Sandboxes
Since 3.1
WebDAV API allows you to access and manage sandbox content using a standard WebDAV specification.
Specifically, it allows for:
• Browsing a directory structure
• Editing files
• Removing files/folders
• Renaming files/folders
• Creating files/folders
• Copying files
• Moving files
The WebDAV interface is accessible from the URL: "http://[host]:[port]/clover/webdav".
Note: Although common browsers will open this URL, most of them are not rich WebDAV clients. Thus, you will only see a list of items, but you cannot browse the directory structure.
WebDAV Clients
There are many WebDAV clients for various operating systems, some OS support WebDAV natively.
Linux like OS
Great WebDAV client working on Linux systems is Konqueror. Please use different protocol in the URL: webdav://[host]:[port]/clover/webdav
Another WebDAV client is Nautilus. Use different protocol in the URL dav://[host]:[port]/clover/ webdav
.
MS windows
Last distributions of MS Windows (Win XP and later) have native support for WebDAV. Unfortunately, it is more or less unreliable, so it is recommended to use some free or commercial WebDAV client.
• The best WebDAV client we've tested is BitKinex: http://www.bitkinex.com/webdavclient
• Another option is to use Total Commander (http://www.ghisler.com/index.htm) with WebDAV plugin: http:// www.ghisler.com/plugins.htm#filesys
Mac OS
Mac OS supports WebDAV natively and in this case it should be without any problems. You can use "finder" application, select "Connect to the server ..." menu item and use URL with HTTP protocol: "http://[host]:[port]/ clover/webdav".
WebDAV Authentication/Authorization
CloverETL Server WebDAV API uses the HTTP Basic Authentication by default. However it may be reconfigured
to use HTTP Digest Authentication. Please see Part III, “ Configuration ” (p. 42) for details.
Digest Authentication may be useful, since some WebDAV clients can't work with HTTP Basic Authentication, only with Digest Authentication.
122
Chapter 15. Server Side
Job Files - Sandboxes
HTTP Digest Authentication is feature added to the version 3.1. If you upgraded your older CloverETL Server distribution, users created before the upgrade cannot use the HTTP Digest Authentication until they reset their passwords. So when they reset their passwords (or the admin does it for them), they can use Digest Authentication as well as new users.
123
Chapter 16. CloverETL Server Monitoring
Monitoring section in the server Web GUI displays useful information about current performance of the standalone
CloverETL Server or all cluster nodes if the clustering is enabled.
Monitoring section of the standalone server has slightly different design from cluster environment. In case of standalone server, the server-view is the same as node detail in cluster environment.
The section is refreshed each 15 seconds so the displayed data is up-to-date. Page can be also anytime refreshed manually by the "Refresh" button
Standalone Server Detail
Standalone server detail view displays info collected from the standalone server. The info is grouped in several panels. The following ones are displayed by default.
• Performance
• Resource utilization
• 10 longest-running jobs
• System
• Status history
You can display the hidden actions with Actions button: choose Actions
→
Show details.
Figure 16.1. Standalone server detail
124
Chapter 16. CloverETL
Server Monitoring
Performance
The Performance panel contains a chart with two basic performance statistics: a number of running jobs and an amount of used heap memory. The graph displays values gathered within a specific interval. The interval can be set up with the combo box above the graph or it can be configured by "cluster.node.sendinfo.history.interval" config property. By default, the values are gathered within a couple of last minutes.
Figure 16.2. Performance
Resource Utilization
Resource utilization shows stats: average load, number of runnig jobs, heap memory, non-heap memory, and event listeners.
Figure 16.3. Resource Utilization
CPU Load
The CPU Load panel displays a chart with info about total CPU load and CPU load caused by JVM.
Figure 16.4. CPU Load
Running Jobs
Running jobs panel lists currently running jobs, 10 oldest runs are displayed.
125
Chapter 16. CloverETL
Server Monitoring
Figure 16.5. Running jobs
System
System panel contains info about operating system and license.
Figure 16.6. System
Status History
Status history panel displays node statuses history since restart of the server.
Figure 16.7. Status History
User's Access
User's Access panel lists info about activities on files performed by users. The list displays a timestamp of an event, a username, and a name of the method.
Figure 16.8. Users' Accesses panel
126
Chapter 16. CloverETL
Server Monitoring
Classloader cache
Classloader cache lists all currently cached classloaders. The classloader cache may be empty as classloader caching is disabled by default.
Figure 16.9. Classloader cache
Status
Status panel displays current node status since last server restart. It displays current server status (ready, stopped, ...), exact Java version, exact CloverETL Server version, way of access to database, URLs for synchronous and asynchronous messaging, available heap and non-heap memory, etc.
Figure 16.10. Status
Heartbeat
Heartbeat panel displays a list of heartbeat events and their results.
Figure 16.11. Heartbeat
127
Chapter 16. CloverETL
Server Monitoring
Threads
Threads panel lists java threads and their states.
Figure 16.12. Threads
Quartz
Quartz panel lists scheduled actions: their name, description, start time, end time, time of previous event, time of next event and expected final event.
Figure 16.13. Quartz
128
Chapter 16. CloverETL
Server Monitoring
Cluster Overview
Cluster overview displays info collected from all cluster nodes. The info is grouped in several panels:
• List of nodes with a toolbar - allows manipulation with selected nodes
• Status history - Displays last 10 status changes for all cluster nodes
• Node detail - Displays several basic performance attributes for selected nodes. It's visible on the right side only when activated by button on the toolbar.
• Running jobs - It's displayed only when there are running jobs.
Figure 16.14. Cluster overview
129
Chapter 16. CloverETL
Server Monitoring
Node Detail
Node Detail is similar to the "Standalone server detail" mentioned above, however it displays detail info about node selected in the tree on the left.
Figure 16.15. Node detail
130
Chapter 16. CloverETL
Server Monitoring
Server Logs
Server Logs tab allows user to investigate log messages logged on other cluster nodes. Since the log messages are collected in memory, the maximum number of collected messages is relatively low by default, however it's customisable.
There are different "Log types":
• COMMON - Ordinary server logs as stored in log files.
• CLUSTER - Only cluster - related messages are visible in this log
• LAUNCH_SERVICES - Only requests for launch services
• AUDIT - Detail logging of operations called on the CloverETL Server core. Since the full logging may affect
server performance, it's disabled by default. See Server Audit Logs (p. 81) for details
• USER_ACTION - Contains some of user operations, e.g. login, logout, job execution
Figure 16.16. Server Logs
131
Chapter 17. Server Configuration Migration
CloverETL Server provides means to migrate its configuration (e.g. event listeners, schedules etc.) or parts of the configuration between separate instances of the server. A typical use case is deployment from test environment to production - this involves not only deployment of CloverETL graphs, but also copying parts of configuration such as file event listeners etc.
Configuration migration is performed in 2 steps - export of the configuration from the source server, followed by import of the configuration at the destination server. After exporting, the configuration is stored as an XML file. The file can be modified manually before import, for example to migrate only parts of the configuration.
Additionally, the configuration file can be stored in a versioning system (such as Subversion or Git) for versioning of the CloverETL Server configuration.
It is recommended to perform import of configuration on a suspended CloverETL Server and to plan for maintenance. Additionally, it is recommended to backup the CloverETL Server configuration database before the import.
The following items are parts of the Server Configuration and can be migrated between servers:
• Users & Groups (see Chapter 14, Users and Groups (p. 92))
• Sandboxes (see Chapter 15, Server Side Job Files - Sandboxes (p. 111))
• Job Parameters (see Chapter 19, Graph/Jobflow Parameters (p. 140))
• Schedules (see Chapter 22, Scheduling (p. 165))
• Event Listeners (see
Graph Event Listeners (p. 177),
Jobflow Event Listeners (p. 184),
File Event Listeners (remote and local) (p. 194))
• Launch Services (see Launch Services (p. 216))
• Temp Spaces (see Chapter 12, Temp Space Management (p. 83))
Permissions for Configuration Migration
Whether a user is entitled to perform configuration migration is determined by having Server Configuration
Management permission; this permission has two sub-permissions: Export Server Configuration and Import Server
Configuration (see
Groups permissions (p. 100) for further information on permissions). These permissions are
of higher priority than permissions related to a particular migrated item type - so even if the user does not have a permission e.g. to list server's schedules, with Export Server Configuration he will be allowed to export all of defined schedules. The same is true for adding and changing items with the Import Server Configuration permission.
See Server Configuration permission (p. 110).
132
Chapter 17. Server
Configuration Migration
Server Configuration Export
Export of a server configuration is performed from the Server Console - the screen for export can be found in
After clicking on the Export Configuration an XML file will be offered for download. The name of the XML file reflects time when the configuration was exported.
In case user manually edits the exported XML file, you shell ensure that the file has a valid content. This can be done by validation against XSD schema. The schema for a configuration XML document can be found at http://[host]:[port]/[contextPath]/schemas/clover-server-config.xsd
.
The XML file contains selected items of the CloverETL server instance. The file can by modified before the import to another server instance - for example to import schedules only.
Figure 17.1. Server Configuration Export screen
133
Chapter 17. Server
Configuration Migration
Server Configuration Import
Import of CloverETL Server configuration merges the configuration exported from another server into the running server instance where the import was initiated. The configuration to be imported is loaded from an XML file
Server Console - the screen for import can be found in Configuration > Import section.
Figure 17.2. Server Configuration Import screen
The XML configuration file defines configuration items to be imported into the destination server. The items are matched against current configuration of the destination server. Depending on result of the matching, the items from the XML configuration are either added to the destination server or will update existing item with properties defined in the XML file. Matching of items is based on a key that depends on the item type:
• users - user code
• user groups - group code
• sandboxes - sandbox code
• job parameters - triplet (job parameter name, sandbox code, job file)
• event listeners - event listener name
• schedule - schedule description
• launch service - triplet (service name, server user, service user group)
• temp spaces - pair (temp space node ID, temp space path)
Configuration Import Process
Uploading Configuration
The first step in the configuration import is to upload the XML file to the CloverETL server. After clicking on CloverETL Configuration File button a window is opened where user can select an XML file with the configuration to import. The file is uploaded automatically after the dialog is closed. Once upload is finished the name of the uploaded file is shown in the toolbar along with CloverETL Configuration File button. In case reading of configuration from XML has finished without error, additional controls are displayed in the toolbar:
• Preview Import button to perform "dry run" of the configuration import
• Commit Import button to perform actual import of configuration to server's database
• Import Options section to further configure import process:
• New only option specifies that only new items will be imported leaving existing items on server untouched
• Import Items section to select what item types will be imported to the server
134
Chapter 17. Server
Configuration Migration
Figure 17.3. Server Configuration uploaded
Note
When transfering configuration from one server instance to another, it is important that these instances are of compatible, preferably the same, version. The user is notified when the source and target differ at at least minor version number (e.g. 3.4.1 and 3.5.0). It is also recommended not to transfer configuration between clustered and non-clustered server instances.
Verifying Configuration
Once the configuration is uploaded, the system executes "dry run" of the configuration import automatically. The
dry run performs configuration import, but no data is actually written do the server's database. The outcome of the operation is Import Log with messages related either to the configuration as a whole or to particular imported
grouped into tables according to their types. Each item has an icon indicating result of the item import operation:
• - the item has been added as a new one
• - the item has been updated
• - the item has been updated, but none of its properties has changed
• - the item has been removed
For the updated items, the state of the item before update is shown in the lower of the rows with less contrast text color, the new values of item's properties are shown in upper of the rows with regular text color. Actual changes are highlighted by background color change on respective property and also on both rows. The Imported Items view can be filtered using radio buttons above it:
• Changes only button will display only items that have been either added or actually changed by update
• All updates button will display all of imported items, event those identical to already present ones
Example 17.1. Example of simple configuration defining one new server user.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cloverServerConfiguration xmlns="http://cloveretl.com/server/data" timeZone="Europe/Berlin">
<usersList>
<user disabled="false">
<username>johnsmith</username>
<firstName>John</firstName>
<lastName>Smith</lastName>
<email>[email protected]</email>
<domain>clover</domain>
<password>SITx8e1pjoo4em17As3LNw==</password>
<passwordA1Digest>70151bae7488da4159ac5ccec97d0995</passwordA1Digest>
<userGroups>
<groupCode>all_users</groupCode>
135
Chapter 17. Server
Configuration Migration
<groupCode>job_managers</groupCode>
</userGroups>
</user>
</usersList>
</cloverServerConfiguration>
Figure 17.4. Outcome of the import preview for configuration from Example 17.1 (p. 135)
The Summary in the Import Log says whether the dry run was successful. Should there by any problems with
items imported, the item is displayed along with the cause of the error (see Figure 17.4 (p. 136)) .
136
Chapter 17. Server
Configuration Migration
Figure 17.5. Outcome of import preview for configuration after fixing by removal of broken group reference.
User is expected follow the advices displayed in the Import Log and edit the XML until import preview has finished without errors.
Committing Import
Once the import preview has finished without problems, one can proceed with actual configuration import. This is performed by clicking on the Commit Import button. After confirmation, Import Log will display outcome of the operation.
It is possible that some items will not be initialized properly after they have been imported (e.g. their initialization requires presence of a cluster node that went down in the meantime). User is notified about these problems in Import Log with link to the problematic item. One should check such items in appropriate section of the
CloverETL Server console and change their settings to fix the issue or remove them.
137
Chapter 18. Diagnostics
CloverETL Server allows you to create a thread dump or a heap dump. The thread and heap dumps are useful for investigation of performance and memory issues.
In server GUI, go to Configuration
→
System Info
→
Diagnostics.
Heap Dump
Heap Dump is content of a JVM process memory stored in a binary file.
To download the Heap Dump, click Download button under Heap Dump section. The download of Heap Dump may take some time.
The Dump live objects only checkbox allows you to avoid dumping of objects awaiting garbage collection
You can use jvisualvm or jhat to view and analyze the heap dump.
Important
Heap Dump does not work on WebSphere. On WebSphere, you can create heap dumps using administration console. See IBM Knowledge Center for the instructions.
Thread Dump
Thread Dump is a list of exisitng JVM threads with their callstacks and held locking objects (if supported). It can be viewed in a text editor.
To download the thread dump, click Download button under Thread Dump section.
Required Permissions
To create Thread Dump or Heap Dump, following permissions are required:
• Configuration →
Heap Memory Dump
See also Heap Memory Dump permission (p. 110).
138
Part V. Using Graphs
Chapter 19. Graph/Jobflow Parameters
The CloverETL Server passes a set of parameters to each graph or jobflow execution.
Keep in mind that
${paramName}
placeholders (parameters) are resolved only during the initialization (loading of XML definition file), so if you need the parameters to be resolved for each job execution, you cannot set the job to be pooled. However, current parameter values are always accessible by inline Java code like this:
String runId = getGraph().getGraphProperties().getProperty("RUN_ID");
Properties may be added or replaced like this: getGraph().getGraphProperties().setProperty("new_property", value );
This is set of parameters which are always set by CloverETL Server:
Table 19.1. Defaults for graph execution configuration - see section Graph config properties for details
key
SANDBOX_CODE
JOB_FILE
SANDBOX_ROOT
RUN_ID
PARENT_RUN_ID
ROOT_RUN_ID
CLOVER_USERNAME
NODE_ID
description
An identifier of a sandbox which contains executed graph.
A path to the file (graph, subgraph, jobflow). The path relative to sandbox root path.
An absolute path sandbox root.
ID of the graph execution. In standalone mode or in cluster mode, it is always unique. It may be lower then
0 value, if the run record isn't persistent. See
Services (p. 216) for details.
Run ID of the graph execution which is a parent to the current one. Useful when the execution is subgraph, child-job of some jobflow or worker for distributed transformation in cluster. When the execution doesn't have a parent, the PARENT_RUN_ID is the same as
RUN_ID.
Run ID of the graph execution which is root execution to the current one (the one which doesn't have parent).
Useful when the execution is a subgraph, child-job of some jobflow or worker for distributed transformation in cluster. When the execution doesn't have a parent, the
ROOT_RUN_ID is the same as RUN_ID.
Username of user who launched the graph or jobflow.
Id of node running the graph or jobflow.
140
Chapter 19. Graph/
Jobflow Parameters
Parameters by Execution Type
Additional parameters are passed to the graph depending on how the graph is executed.
Executed from Web GUI
Graphs executed from a web gui have no additional parameters.
Executed by Launch Service Invocation
Service parameters which have Pass to graph attribute enabled are passed to the graph not only as "dictionary" input data, but also as graph parameter.
Executed by HTTP API Run Graph Operation Invocation
Any URL parameter with "param_" prefix is passed to executed graph but without "param_" prefix. i.e.
"param_FILE_NAME" specified in URL is passed to the graph as property named "FILE_NAME".
Executed by RunGraph Component
Since 3.0 only parameters specified by "paramsToPass" attribute are passed from the "parent" graph to the executed graph. However common properties (RUN_ID, PROJECT_DIR, etc.) are overwritten with new values.
Executed by WS API Method executeGraph Invocation
Parameters with values may be passed to the graph with the request for execution.
Executed by Task "graph execution" by Scheduler
Table 19.2. passed parameters
key
EVENT_SCHEDULE_EVENT_TYPE
EVENT_SCHEDULE_LAST_EVENT
EVENT_SCHEDULE_DESCRIPTION
EVENT_USERNAME
EVENT_SCHEDULE_ID
description
Type of a schedule: SCHEDULE_PERIODIC |
SCHEDULE_ONETIME
Date/time of a previous event
Schedule description, which is displayed in web GUI
User who "owns" the event. For schedule it is the user who created the schedule.
ID of schedule which triggered the graph
Executed from JMS Listener
There are many graph parameters and dictionary entries passed, depending on the type of incoming message. See
details in JMS Messages Listeners (p. 187).
Executed by Task "Start a graph" by Graph/Jobflow Event Listener
Since 3.0 only specified properties from a "source" job are passed to executed job by default. There is a
"graph.pass_event_params_to_graph_in_old_style" server config property which can change this behavior so that
141
Chapter 19. Graph/
Jobflow Parameters
ALL parameters from a "source" job are passed to the executed job. This switch is implemented for backwards compatibility. Regarding to the default behaviour: in the editor of graph event listener, you can specify a list of
parameters to pass. Please see Start a Graph (p. 152) for details.
The following parameters with current values are always passed to the target job
Table 19.3. passed parameters
key
EVENT_RUN_SANDBOX
EVENT_JOB_EVENT_TYPE
EVENT_RUN_JOB_FILE
EVENT_RUN_ID
EVENT_TIMEOUT
EVENT_RUN_RESULT
EVENT_USERNAME
description
Sandbox with the graph which is source of the event
GRAPH_STARTED | GRAPH_FINISHED |
GRAPH_ERROR | GRAPH_ABORTED |
GRAPH_TIMEOUT
GRAPH_STATUS_UNKNOWN,
JOBFLOW_* for jobflow event listeners.
analogically
| jobFile of the job which is source of the event
ID of the graph execution which is source of the event.
Number of milliseconds which specifies interval of timeout. Makes sense only for "timeout" graph event.
Result (or current status) of the execution which is source of the event.
User who "owns" the event. For graph events it is the user who created the graph event listener
Executed by Task "graph execution" by File Event Listener
Table 19.4. passed parameters
key
EVENT_FILE_PATH
EVENT_FILE_NAME
EVENT_FILE_URLS
description
Path to the file which is source of the event. Does not contain a file name. Does not end with a file separator.
Is passed only for the local file event listener.
Filename of the file which is source of the event. Is passed only when the "grouping" mode is disabled.
Otherwise there are more file events, not just one.
Contans string, which may be used "as is" in the
"file URL" attribute of various CloverETL components.
It may contain URL to one or more (if grouping is anabled) files. It may contain local path(s) or remote
URL(s) where credentials are replaced by placeholders
(due to security reasons).
EVENT_FILE_AUTH_USERNAME Username/ID to the remote location.
EVENT_FILE_AUTH_USERNAME_URL_ENCODEDThe same as EVENT_FILE_AUTH_USERNAME, but the value is also URL encoded, so it may be used in the
URL.
EVENT_FILE_AUTH_PASSWORD Password/key to the remote location. It's encrypted by the master password. It's passed only when the file listener uses user+password authentication.
EVENT_FILE_AUTH_PASSWORD_URL_ENCODEDThe same as EVENT_FILE_AUTH_PASSWORD, but the value is also URL encoded, so it may be used in the
URL (EVENT_FILE_URLS parameter).
142
key
EVENT_FILE_EVENT_TYPE
EVENT_FILE_PATTERN
EVENT_FILE_LISTENER_ID
EVENT_USERNAME
Chapter 19. Graph/
Jobflow Parameters
description
SIZE | CHANGE_TIME | APPEARANCE |
DISAPPEARANCE
Pattern specified in a file event listener
User who "owns" the event. For file events, it is the user who created the file event listener.
Adding Another Graph Parameters
Additional "Graph Config Parameters"
It is possible to add so-called additional parameters in Web GUI - section Sandboxes for the selected graph or for
all graphs in the selected sandbox. See details in Job Config Properties (p. 119).
Task "execute_graph" Parameters
The "execute graph" task may be triggered by schedule, graph event listener, or file event listener. Task editor allows you to specify key=value pairs which are passed to executed graph.
143
Chapter 20. Tasks
Task is a graph, jobflow, groovy script, etc. that can be started manually, started on scheduled time, or triggered by some event. Task basically specifies WHAT to do.
There are several tasks implemented for schedule and for graph event listener as follows:
•
•
•
•
•
Execute Shell Command (p. 149)
•
•
•
•
Tasks in Cluster Environment
In the Cluster environment, you can specify node where the task runs. The task can run on Any node or on one
of selected nodes. If there is no node ID specified, task may be processed on any cluster node, so in most cases it will be processed on the same node where the event was triggered. If there are some nodeIDs specified, task will be processed on the first node in the list which is connected in cluster and ready.
Tasks are used in
Chapter 22, Scheduling (p. 165)
Chapter 24, Listeners (p. 176)
Chapter 21, Manual Task Execution (p. 164)
144
Chapter 20. Tasks
Send an Email
The "send e-mail" task is useful for notifications about result of graph execution. E.g., you can create a listener with this task type to be notified about each failure in specified sandbox or failure of particular graph.
This task is very useful, but for now only as response for graph events. This feature is very powerful for monitoring.
(see
Graph Event Listeners (p. 177) for description of this task type).
Note: It seems useless to send e-mails periodically, but it may send current server status or daily summary. These features will be implemented in further versions.
Table 20.1. Attributes of "Send e-mail" task
Task type
To
Cc
Bcc
Reply-to (Sender)
Subject
HTML
Text
Log file as attachment
"Send an email"
Recipient's e-mail address. It is possible to specify more addresses separated by a comma. It is also possible to use placeholders. See
Cc stands for 'carbon copy'. Copy of the e-mail will be delivered to these addresses. It is possible to specify more addresses separated by a comma. It
is also possible to use placeholders. See Placeholders
Bcc: stands for 'Blind carbon copy'. It is the same as Cc, but the others recipients aren't aware, that these recipients get copy of the e-mail.
E-mail address of sender. It must be a valid address according to SMTP server. It is also possible to use placeholders. See
for details.
E-mail subject. It is also possible to use placeholders. See
A body of the e-mail in HTML. The e-mail is created as multipart, so
HTML body should have a precedence. A plain text body is only for e-mail clients which do not display HTML. It is also possible to use placeholders.
A body of the e-mail in plain text. The e-mail is created as multipart, so
HTML body should have a precedence. A plain text body is only for e-mail clients which do not display HTML. It is also possible to use placeholders.
If this switch is checked, e-mail will have an attachment with a packed log file of the related graph execution.
145
Chapter 20. Tasks
Figure 20.1. Web GUI - send e-mail
Note: Do not forget to configure connection to SMTP server (See Part III, “
Placeholders
Placeholder may be used in some fields of tasks. They are especially useful for e-mail tasks, where you can generate content of e-mail according to context variables.
Note: In most cases, you can avoid this by using e-mail templates (See E-mail task for details)
These fields are preprocessed by Apache Velocity templating engine. See Velocity project URL for syntax description http://velocity.apache.org/
There are several context variables, which you can use in placeholders and even for creating loops and conditions.
• event
• now
• user
• run
• sandbox
146
Chapter 20. Tasks
Some of them may be empty depending on type of event. E.g., if task is processed because of graph event, then
run and sandbox variables contain related data, otherwise they are empty.
Table 20.2. Placeholders useful in e-mail templates
event now task user
Variable name
run sandbox tracking
Contains
Event that has triggered the task.
Current date-time
The triggered task.
User, who caused this event. It may be an owner of a schedule, or someone who executed a graph. It contains sub-properties, which are accessible using dot notation
(i.e. ${user.email}) e-mail:
• user.email
• user.username
• user.firstName
• user.lastName
• user.groups (list of values)
Data structure describing one single graph execution. It contains sub-properties, which are accessible using dot notation (i.e. ${run.jobFile})
• run.jobFile
• run.status
• run.startTime
• run.stopTime
• run.errNode
• run.errMessage
• run.errException
• run.logLocation
Data structure describing a sandbox containing the executed graph. It contains subproperties, which are accessible using dot notation (i.e. ${sandbox.name})
• sandbox.name
• sandbox.code
• sandbox.rootPath
A data structure describing status of components in graph execution. It contains subproperties, which are accessible using Velocity syntax for loops and conditions.
#if (${tracking})
<table border="1" cellpadding="2" cellspacing="0">
#foreach ($phase in $tracking.trackingPhases)
<tr><td>phase: ${phase.phaseNum}</td>
<td>${phase.executionTime} ms</td>
<td></td><td></td><td></td></tr>
#foreach ($node in $phase.trackingNodes)
<tr><td>${node.nodeName}</td>
<td>${node.result}</td>
<td></td><td></td><td></td></tr>
#foreach ($port in $node.trackingPorts)
<tr><td></td><td></td>
<td>${port.type}:${port.index}</td>
<td>${port.totalBytes} B</td>
<td>${port.totalRows} rows</td></tr>
#end
#end
#end
</table>
#end
}
147
Variable name
schedule parameters
Chapter 20. Tasks
Contains
Data structure describing schedule which triggered this task. It contains subproperties, which are accessible using dot notation (i.e. ${schedule.description})
Available in scheduling.
• schedule.description
• schedule.startTime
• schedule.endTime
• schedule.lastEvent
• schedule.nextEvent
• schedule.fireMisfired
Task parameters - container for String-String key-value pairs passed to this task. In manual task execution.
148
Chapter 20. Tasks
Execute Shell Command
Execute Shell Command executes system command or a shell script.
This task is used is used in Chapter 22, Scheduling
(p. 165), Chapter 24, Listeners
21, Manual Task Execution (p. 164).
Table 20.3. Attributes of "Execute shell command" task
Task type
Start on
Shell script
Working directory
Timeout
"Execute shell command"
Node IDs to process the task
This attribute is accessible only in the cluster environment. If there are nodes specified, the task will be processed on the first node which is online and ready.
Command line for execution of external process.
Working directory for process.
If not set, working directory of application server process is used.
Timeout in milliseconds. After period of time specified by this number, external process is terminated and all results are logged.
Figure 20.2. Web GUI - shell command
149
Chapter 20. Tasks
Execute Shell Command Parameters
Some parameters are available only in particular context: scheduling, event listeners, or manual task execution.
Table 20.4. Parameters of "Execute shell command" task
event now task user
Event that has triggered the task
Current date-time
The triggered task
Object representing user who executed the graph/jobflow. It contains subproperties that are accessible using dot notation (i.e. ${user.email})
• user.email
• user.username
• user.firstName
• user.lastName
• user.groups (list of values)
Table 20.5. Parameters of "Execute shell command" task - available in scheduling
schedule
EVENT_USERNAME
EVENT_USER_ID
EVENT_SCHEDULE_DESCRIPTION
EVENT_SCHEDULE_EVENT_TYPE
EVENT_SCHEDULE_ID
EVENT_SCHEDULE_LAST_EVENT
Object representing the schedule that triggered this task. It contains sub-properties that are accessible using dot notation (i.e.
${schedule.description})
• schedule.description
• schedule.startTime
• schedule.endTime
• schedule.lastEvent
• schedule.nextEvent
• schedule.fireMisfired
Username of the user who caused the event.
Numeric ID of the user who caused the event.
Description of the schedule.
Type of the schedule - SCHEDULE_ONETIME or
SCHEDULE_PERIODIC.
Numeric ID of the schedule
Date-time of the latest schedule triggering (in java.util.Date.toString() format).
Table 20.6. Parameters of "Execute shell command" task - available in listeners
run Object representing single graph/jobflow execution. It contains sub-properties that are accessible using dot notation (i.e. ${run.jobFile}).
• run.jobFile
• run.status
• run.startTime
• run.stopTime
• run.errNode
• run.errMessage
• run.errException
150
Chapter 20. Tasks sandbox Object representing a sandbox containing the executed graph/jobflow.
It contains sub-properties that are accessible using dot notation (i.e.
${sandbox.name}) tracking
EVENT_USERNAME
EVENT_USER_ID
EVENT_RUN_SANDBOX
EVENT_RUN_JOB_FILE
EVENT_RUN_RESULT
• sandbox.name
• sandbox.code
• sandbox.rootPath
Object represeting status of components in a graph execution. It contains subproperties that are accessible using Velocity syntax for loops and conditions.
Username of the user who caused the event.
Numeric ID of the user who caused the event.
Code of the sandbox containing the graph/jobflow.
Sandbox-relative path to the graph/jobflow file.
Current status of the graph/jobflow execution
• N_A
• READY
• RUNNING
• WAITING
• FINISHED_OK
• ERROR
• ABORTED
• TIMEOUT
• UNKNOWN
EVENT_RUN_ID
EVENT_TIMEOUT
Numeric ID of the run record representing graph/jobflow execution
Specified timeout (in milliseconds) for the TIMEOUT event to occur.
EVENT_JOB_EVENT_TYPE Graph event that triggered the task
• GRAPH_STARTED
• GRAPH_PHASE_FINISHED
• GRAPH_FINISHED
• GRAPH_ERROR
• GRAPH_ABORTED
• GRAPH_TIMEOUT
• GRAPH_STATUS_UNKNOWN
Table 20.7. Parameters of "Execute shell command" task - available in manual task execution
parameters Task parameters - container for String-String key-value pairs passed to this task.
151
Chapter 20. Tasks
Start a Graph
Start a Graph starts a specified graph from specified sandbox.
Table 20.8. Attributes of "Graph execution" task
Task type
Start on
Sandbox
Graph
Save run record
Parameters
"Start a graph"
Node(s) to process the task. It is a cluster feature.
This select box contains sandboxes which are readable for logger user.
Select sandbox which contains graph to execute.
The graph to be executed.
This select box is filled with all graphs files accessible in selected sandbox.
Type a graph name or path to filter available items.
Saves run record to database.
If the task runs too often (once in several seconds), you can increase the database performance by disabling this.
List of parameters passed to the graph.
Event parameters like "EVENT_RUN_RESULT", "EVENT_RUN_ID" etc. are passed to the executed job without limitations. Parameters
EVENT_RUN_RESULT and EVENT_RUN_ID are used in context of event listeners. They are not used in context of scheduling.
Figure 20.3. Web GUI - Graph execution task
Please note that behaviour of this task type is almost the same as Start a Jobflow (p. 154).
152
Chapter 20. Tasks
Parameters
You can start a graph with parameters.
To start a graph with parameter choose an existing parameter from a list, set its value, and click the plus sign button at the end of line.
Figure 20.4. Web GUI - Graph execution task
If the graph is started by event listener, it receives some additional parameters from the triggering job.
Parameters passed to graph by Event Listeners
Table 20.9. Additional parameters available in Event Listeners
EVENT_USERNAME
EVENT_USER_ID
EVENT_RUN_SANDBOX
EVENT_RUN_JOB_FILE
EVENT_RUN_RESULT
Username of the user who caused the event
Numeric ID of the user who caused the event.
Code of the sandbox containing the graph/jobflow
Sandbox-relative path to the graph/jobflow file.
Current status of the graph/jobflow execution (N_A, READY,
RUNNING, WAITING, FINISHED_OK, ERROR, ABORTED, TIMEOUT or UNKNOWN).
EVENT_RUN_ID Numeric ID of the run record representing graph/jobflow execution.
EVENT_JOB_EVENT_TYPE Graph/Jobflow event type that triggered the task.
EVENT_TIMEOUT Specified timeout (in milliseconds) for the TIMEOUT event to occur
153
Chapter 20. Tasks
Start a Jobflow
Start a jobflow starts a specified jobflow from a specified sandbox.
Table 20.10. Attributes of "Jobflow execution" task
Task type
Start on
Sandbox
Jobflow
Save run record
Parameters
"Start a jobflow"
Node(s) to process the task
This attribute is accessible only in the cluster environment. If there are nodes specified, the task will be processed on the first node which is online and ready.
This select box contains sandboxes which are readable for logger user.
Select sandbox which contains jobflow to execute.
This select box is filled with all jobflow files accessible in selected sandbox.
Type jobflow name or path to filter available items.
Saves run record to database. If the task runs too often (once in several seconds), you can increase the database performance by disabling this.
Key-value pairs which are passed to the executed job as parameters.
Event parameters like "EVENT_RUN_RESULT", "EVENT_RUN_ID" etc. are passed to the executed job without limitations. Parameters
EVENT_RUN_RESULT and EVENT_RUN_ID are used in context of event listeners. They are not used in context of scheduling.
Figure 20.5. Web GUI - Jobflow execution task
Please note that behaviour of this task type is almost the same as Start a Graph (p. 152).
If the jobflow start is triggered by an event, the same set of parameters as in graph event listener is passed to
154
Chapter 20. Tasks
Start a Profiler Job
Start a profiler job starts a specified profiler job from a specified directory.
You can pass parameters to the profiler job in the same way as in case you
In case of triggering the profiler job by event listener, the same set of additional parameters, as in case of execution of graph, is passed to the profiler job. See
Parameters passed to graph by Event Listeners (p. 153).
155
Chapter 20. Tasks
Abort job
This task kills/aborts specified job (ETL graph or jobflow), if it is currently running.
Table 20.11. Attributes of "Abort job" task
Task type
Start on
Kill source of event
Sandbox
Job
"Abort job"
Node(s) to process the task.
This attribute is accessible only in the cluster environment. If there are nodes specified, the task will be processed on the first node which is online and ready.
If this switch is on, task will kill the job which is source of the event, which activated this task. Attributes sandbox and job are ignored.
This checkbox makes sense only if Abort job is activated by some event.
Select a sandbox which contains the job to kill.
This attribute works only when "Kill source of event" switch is off.
This select box is filled with all jobs accessible in selected sandbox. All instances of selected job that are currently running and will be killed. This attribute works only when "Kill source of event" switch is off.
Figure 20.6. Web GUI - "Abort job"
156
Chapter 20. Tasks
Archive Records
This task can archive (or delete) obsolete records from DB.
Table 20.12. Attributes of "Archivator" task
Task type
Start on
Archivator type
Older than
Output path for archives
Include executions history
Include temp files
Include tasks history
Include profiler runs
Include server instance history
"Archivator"
This attribute specifies cluster node on which may process the task.
This attribute is accessible only in the cluster environment.
If it's empty, it may be any node, if there are nodes specified, the task will be processed on the first node which is online and ready.
There are two possible values: "archive" or "delete".
Delete option removes records without any possibility of UNDO operation.
Archive option removes records from DB, but creates a ZIP package with
CSV files containing deleted data.
Time period (in minutes) - it specifies which records are evaluated as obsolete. Records older than the specified interval are stored in archives.
This attribute makes sense only for "archive" type.
Includes executions history into archived file.
If checked, archivator removes all graph temporary files older than the given timestamp defined in "Older than" attribute. The temporary files are files with graph debug data, dictionary files and files created by graph components.
If checked, archivator will include run records. Log files of graph runs are included as well.
If checked, archivator will include profiler job results.
Includes server instance history into archived file.
157
Chapter 20. Tasks
Figure 20.7. Web GUI - archive records
158
Chapter 20. Tasks
Send a JMS Message
This type of task is useful for notifications about result of graph execution. E.g. you can create a graph event listener with this task type to be notified about each failure in a specific sandbox or failure of a particular graph.
JMS messaging requires JMS API (jms.jar) and third-party libraries. All these libraries must be available on application server classpath. Some application servers contain these libraries by default, some do not, thus the libraries must be added explicitly.
Table 20.13. Attributes of JMS message task
Task type
Initial context
Initial context factory class
Broker URL
Connection factory
Queue/Topic
Username
Password
JMS pattern
Text
"JMS message"
Choose between default and custom initial context.
A full class name of javax.naming.InitialContext implementation. Each
JMS provider has its own implementation. E.g., for Apache MQ it is
"org.apache.activemq.jndi.ActiveMQInitialContextFactory". If it is empty, server uses the default initial context.
URL of a JMS message broker
A JNDI name of a connection factory. It depends on a JMS provider.
JNDI name of a message queue/topic on the server
Username for connection to a JMS message broker
Password for connection to a JMS message broker
This select box is available only when user is creating a new record. It contains all predefined JMS message patterns. If user chooses any of them, text field below is automatically filled with value from pattern.
Body of a JMS message. It is also possible to use placeholders. See
(p. 146) of send e-mail task for details.
159
Chapter 20. Tasks
Figure 20.8. Web GUI - Task JMS message editor
Table 20.14. Parameters of "Send a JMS Message"
event now task user schedule
EVENT_USERNAME
EVENT_USER_ID
EVENT_SCHEDULE_DESCRIPTION
Event that has triggered the task.
Current date-time
The triggered task.
Object representing owner of the schedule. It contains subproperties that are accessible using dot notation (i.e. ${user.email}) e-mail, username, firstName, lastName, groups (list of values).
Object representing the schedule that triggered this task. It contains sub-properties that are accessible using dot notation
(i.e. ${schedule.description}) description, startTime, endTime, lastEvent, nextEvent, fireMisfired.
Username of the user who caused the event
Numeric ID of the user who caused the event.
Description of the schedule
160
Chapter 20. Tasks
EVENT_SCHEDULE_EVENT_TYPE
EVENT_SCHEDULE_ID
EVENT_SCHEDULE_LAST_EVENT
Type of the schedule - SCHEDULE_ONETIME or
SCHEDULE_PERIODIC.
Numeric ID of the schedule.
Date-time of the latest schedule triggering (in java.util.Date.toString() format).
161
Chapter 20. Tasks
Execute Groovy Code
This type of task allows you to execute code written in scripting language Groovy. The script can be defined in place or using a path to external
.groovy
file. It is possible to use some variables.
Basic attribute of this task is source code written in Groovy.
If source codes are provided from both a file and through the input form only the code from the input form will be executed.
In cluster environment there is also one additional attribute "Node IDs to process the task". If it's empty, it may be any node, if there are nodes specified, the task will be processed on the first node which is online and ready.
CloverETL Server contains Groovy version 2.0.0
Table 20.15. List of variables available in Groovy code
variable
event
class description availability
every time task now parameters user com.cloveretl.server.
persistent.Task
java.util.Date
java.util.Properties
com.cloveretl.server.
persistent.User
com.cloveretl.server.
persistent.RunRecord
task.
The triggered task.
current time
Properties of a task
Same as event.getUser() every time every time every time every time run sandbox tracking schedule servletContext com.cloveretl.server.
persistent.Sandbox
com.cloveretl.server.
persistent.TrackingGraph
com.cloveretl.server.
persistent.Schedule
same as run.getTrackingGraph() same as
((ScheduleServerEvent)event).
getSchedule()
When the event is instance of
GraphServerEvent
When the event is instance of
ScheduleServerEvent javax.servlet.ServletContext Servlet context cloverConfiguration com.cloveretl.server.spring.
CloverConfiguration serverFacade com.cloveretl.server.facade.
api.ServerFacade
The run record.
same as run.getSandbox()
Configuration values for
CloverETL Server
Reference to the facade interface. Useful for calling
CloverETL Server core.
When the event is instance of
GraphServerEvent
When the event is instance of
GraphServerEvent every time every time every time sessionToken String
WAR file contains JavaDoc of facade API and it is accessible on URL: http://host:port/ clover/javadoc/index.html
Valid session token of the user who owns the event. It is every time
162
Chapter 20. Tasks
variable class description
useful for authorisation to the facade interface.
availability
Variables run, tracking and sandbox are available only if event is instance of GraphServerEvent class. Variable schedule is only available for ScheduleServerEvent as event variable class.
Example of use Groovy script
This example shows a script which writes text file describing the finished graph. It shows use of 'run' variable.
import com.cloveretl.server.persistent.RunRecord;
String dir = "/tmp/";
RunRecord rr = (RunRecord)run;
String fileName = "report"+rr.getId()+"_finished.txt";
FileWriter fw = new FileWriter(new File(dir+fileName)); fw.write("Run ID :"+rr.getId()+"\n"); fw.write("Graph ID :"+rr.getGraphId()+"\n"); fw.write("Sandbox :"+rr.getSandbox().getName()+"\n"); fw.write("\n"); fw.write("Start time :"+rr.getStartTime()+"\n"); fw.write("Stop time :"+rr.getStopTime()+"\n"); fw.write("Duration :"+rr.getDurationString()+"\n"); fw.write("Status :"+rr.getStatus()+"\n"); fw.close();
163
Chapter 21. Manual Task Execution
Since 3.1
Manual task execution allows you to invoke a task directly with an immediate effect, without defining and triggering an event.
There are a number of task types that are usually associated with a triggering event, such as a file listener or a graph/jobflow listener. You can execute any of these tasks manually.
Additionally, you can specify task parameters to simulate a source event that would normally trigger the task. The following is a figure displaying how a “file event” could be simulated. The parameters for various event sources are listed in the section "Graph parameters".
Figure 21.1. Web GUI - "Manual task execution" form
Using Manual Task Execution
In server GUI, switch to Event Listeners tab. In the New Listener drop-down menu, select the Manual Task
Execution option.
Choose the task type you would like to use. See also documenation on chosen tasks:
Execute Shell Command (p. 149)
To access the Manual Task Execution form, you need
Manual task execution permission (p. 105).
164
Chapter 22. Scheduling
The scheduling module allows you to create a time schedule for operations you need to trigger in a repetitive or timely manner.
Similar to “cron” from Unix systems, each schedule represents a separate time schedule definition and a task to perform.
In the Cluster, you can explicitly specify which node should execute the scheduled task using the Node ID parameter. However, if not set, the node will be selected automatically from all available nodes (but always just one).
Figure 22.1. Web GUI - section "Scheduling" - create new
The tasks you can schedule are described in Chapter 20, Tasks (p. 144).
Execute Shell Command (p. 149)
165
Chapter 22. Scheduling
Timetable Setting
This section should describe how to specify when schedule should be triggered. Please keep in mind, that exact trigger times are not guaranteed. There may be couple of seconds delay. Schedule itself can be specified in different ways.
•
•
Periodical schedule by Interval (p. 168)
•
Periodical schedule by timetable (Cron Expression) (p. 169)
Onetime Schedule
This schedule is triggered just once.
Table 22.1. Onetime schedule attributes
Type
Start date/time
"onetime"
Date and time, specified with minutes precision.
Fire misfired event as soon as possible
If checked and trigger time is missed because of any reason (i.e. server restart), it will be triggered immediately, when it is possible. Otherwise it is ignored and it will be triggered at next scheduled time.
Figure 22.2. Web GUI - onetime schedule form
166
Chapter 22. Scheduling
Figure 22.3. Web GUI - schedule form - calendar
167
Chapter 22. Scheduling
Periodical schedule by Interval
This type of schedule is the simplest periodical type. Trigger times are specified by these attributes:
Table 22.2. Periodical schedule attributes
Type
Periodicity
Not active before date/time
"periodic"
"interval"
Date and time, specified with minutes precision.
Not active after date/time
Interval (minutes)
Date and time, specified with minutes precision.
Specifies interval between two trigger times. Next task is triggered even if previous task is still running.
Fire misfired event as soon as possible
If checked and trigger time is missed because of any reason (i.e. server restart), it will be triggered immediately, when it is possible. Otherwise it is ignored and it will be triggered at next scheduled time.
Figure 22.4. Web GUI - periodical schedule form
168
Chapter 22. Scheduling
Periodical schedule by timetable (Cron Expression)
Timetable is specified by powerful (but a little bit tricky) cron expression.
Table 22.3. Cron periodical schedule attributes
Type
Periodicity
Not active before date/time
Not active after date/time
"periodic"
"by timetable"
Date and time, specified with minutes precision.
Date and time, specified with minutes precision.
Cron expression Cron is powerful tool, which uses its own format for scheduling. This format is well known among UNIX administrators. i.e. "0 0/2 4-23 * * ?" means "every 2 minutes between 4:00am and 11:59pm".
Fire misfired event as soon as possible
If checked and trigger time is missed because of any reason (i.e. server restart), it will be triggered immediately when it is possible. Otherwise it is ignored and it will be triggered at next scheduled time.
Figure 22.5. Cron periodical schedule form
The Edit button helps you to set up cron expression even without knowledge of the exact cron expression format.
Figure 22.6. Editing the cron expression - minutes
169
Chapter 22. Scheduling
Figure 22.7. Editing the cron expression - days of week
170
Chapter 22. Scheduling
Allocations of Scheduled Task on Nodes
In cluster environment, you can set node on which the scheduled task will be launched.
The task can be scheduled on arbitrary node or on one or more specified nodes.
Allocation on Any Arbitrary Node
Figure 22.8. Schedule allocation - Any node
Allocation on One or More Chosen Nodes
Figure 22.9. Schedule allocation - One ore more specific nodes
171
Chapter 22. Scheduling
Scheduling the Tasks - Examples
Start a graph at specific time
This example shows scheduling the start of a graph at the specific time.
1. In server GUI, in Scheluling section, click New schedule.
2. Enter the description that allows you to successfully identify the task between other existing tasks, e.g. My
one-time processing example.
3. Choose onetime to start the graph just once.
4. Enter start date and time. The calendar accessible under calendar icon might help you to enter the required date and time in correct format.
5. Choose Task Start a graph.
6. Select the sandbox and graph within the sandbox.
Start a Jobflow once an hour
This example show scheduling the repetitive run.
Create a new schedule that runs UserStats.jbf jobflow from reports sandbox once an hour.
1. Enter description, e.g. Hourly user stats.
2. Choose periodic type and periodicity by interval.
3. The task will be started once an hour within some time period. Enter the beginning of this period (not active
before) and end of the period (not active after).
4. Enter interval between two jobflow starts.
5. Select the sandbox and graph within the sandbox.
Complex Scheduling
This example shows complex scheduling using cron expression.
Start a graph WeekendGraph.grf every Saturday and Sunday at 22:15.
1. Enter the description of the schedule, e.g. The Weekend Graph
2. Select periodic type and periodicity by timetable.
3. Click Edit on line starting with Cron expression.
On Minutes tab, select Every selected minute and select 15.
On Hours tab, select Every selected hour and select 22.
On Days of Week tab, select Every selected day of week and click Saturday and Sunday.
4. The Task is Start a graph
5. Select the sandbox and graph.
172
Chapter 23. Viewing Job Runs - Executions History
Executions History shows the history of all jobs that the Server has executed – transformation graphs, jobflows, and Data Profiler jobs. You can use it to find out why a job failed, see the parameters that were used for a specific run, and much more.
The table shows basic information about the job: Run ID, Job file, current status, and time of execution, as well as some useful links. You will also find additional details after clicking on the job name in the list – details such as associated log files, parameter values, tracking, and more.
Please note that some jobs might not appear in the Executions History list. These are jobs that have disabled persistency for increased performance – e.g. some Launch Services disable storing the run information in order to increase service responsiveness.
Filtering and ordering
Use the Filter panel to filter the view. By default, only parent tasks are shown (Show executions children) – e.g.
master nodes in the Cluster and their workers are hidden by default.
Use the up and down arrows in the table header to sort the list. By default, the latest job is listed first.
Figure 23.1. Executions History - executions table
When some job execution is selected in the table, the detail info is shown on the right side.
173
Chapter 23. Viewing Job
Runs - Executions History
Table 23.1. Persistent run record attributes
Run ID
Attribute
Execution type
Parent run ID
Root run ID
Execution group
Description
A unique number identifying the run of the job. Server APIs usually return this number as a simple response to the execution request. It's useful as a parameter of subsequent calls for specification of the job execution.
Type of a job as recognized by the server. STANDALONE for ETL graph,
JOBFLOW for Jobflow, PROFILER_JOB for profiler, MASTER for main record of partitioned execution in cluster, PARTITIONED_WORKER for worker record of partitioned execution in cluster
Run ID of the parent job. Typically Jobflow which executed this job, or master execution which encapsulates this worker execution.
Run ID of the root parent job. Job execution which wasn't executed by another parent job.
Jobflow components may group sub-jobs using this attribute. See a description of
Jobflow components for details.
Indication that this job execution has or has not any child execution.
In cluster mode shows ID of the cluster node which this execution was running on.
Nested jobs
Node
Executed by
Sandbox
Job file
Job version
User which executed the job. Either directly using some API/GUI or indirectly using the scheduling or event listeners.
Sandbox containing a job file. For jobs which are sent together with an execution request, so the job file doesn't exist on the server site, it's set to "default" sandbox.
Path to a job file, relative to the sandbox root. For jobs which are sent together with an execution request, so the job file doesn't exist on the server site, it's set to generated string.
Revision of the job file. It's a string generated by CloverETL Designer and stored in the job file.
Status
Error message
Exception
Input parameters
Status of the job execution. READY - waiting for execution start, RUNNING processing job, FINISHED OK - job finished without any error, ABORTED - job was aborted directly using some API/GUI or by parent Jobflow, ERROR - job failed,
N/A (not available) - server process died suddenly, so it couldn't properly abort the jobs, so after restart the jobs with unknown status are set as N/A
Server date-time (and timezone) of the execution start.
Started
Finished
Duration
Server date-time (and timezone) of the execution finish.
Execution duration
Error in component ID If the job failed due the error in a component, this field contains ID of the component.
Error in component type If the job failed due the error in a component, this field contains type of the component.
If the job failed, this field contains error description.
If the job failed, this field contains error stack trace.
Input dictionary
List of input parameters passed to the job. Job file can't be cached, since the parameters are applied during loading from the job file. Job file isn't cached by default.
List of dictionary elements passed to the job. Dictionary is used independently of job file caching.
Output dictionary List of dictionary elements at the moment the job ends.
For jobs which have some children executions, e.g. partitioned or jobflows also an executions hierarchy tree is shown.
174
Chapter 23. Viewing Job
Runs - Executions History
Figure 23.2. Executions History - overall perspective
Since the detail panel and expecially job logs may be wide, it may be useful to hide a table on the left, so the detail panel spreads. Click on the minimize icon on the top of the list panel to hide the panel. Then to show list panel again, click to the "Expand panel" icon on the left.
Figure 23.3. Executions Hierarchy with docked list of jobs
Executions hierarchy may be rather complex, so it's possible to filter the content of the tree by a fulltext filter.
However when the filter is used, the selected executions aren't hierarchically structured.
175
Chapter 24. Listeners
Listeners can be seen as hooks. They wait for a specific event and take a user-defined action if the event occurs.
The event is specific to the particular listener
Figure 24.1. Listeners
Graph Event Listeners (p. 177)
Jobflow Event Listeners (p. 184)
JMS Messages Listeners (p. 187)
Universal Event Listeners (p. 192)
File Event Listeners (remote and local) (p. 194)
Task Failure Listeners (p. 200)
The available actions taken by the listeners are common for all listeners. The actions that can be taken are:
• Send an e-mail - see Send an Email (p. 145)
• Execute a shell command - see Execute Shell Command (p. 149)
• Start a graph - see Start a Graph (p. 152)
• Start a jobflow - see
• Start a profiler job
• Abort a job - see
• Archivator - see Archive Records (p. 157)
• Send a JMS Message - see Send a JMS Message (p. 159)
• Execute a Groovy code - see
176
Chapter 24. Listeners
Graph Event Listeners
Graph Event Listeners allow you to define a task that the Server will execute as a reaction to the success, failure or other event of a specific job (a transformation graph).
Each listener is bound to a specific graph and is evaluated no matter whether the graph was executed manually, scheduled, or via an API call, etc.
You can use listeners to chain multiple jobs (creating a success listener that starts the next job in a row). However, we recommend using Jobflows to automate complex processes because of its better development and monitoring capabilities.
Graph Event Listeners are similar to Jobflow Event Listeners (
Jobflow Event Listeners (p. 184)) – for
CloverETL Server both are simply “jobs”.
In the Cluster, the event and the associated task are executed on the same node the job was executed on by default.
If the graph is distributed, the task will be executed on the master worker node. However, you can override where the task will be executed by explicitly specifying a Node IDs in the task definition.
Graph Events
Each event carries properties of a graph, which is source of the event. If there is an event listener specified, task may use these properties. E.g. next graphs in the chain may use "EVENT_FILE_NAME" placeholder which was activated by the first graph in the chain. Graph properties, which are set specifically for each graph run (i.e.
RUN_ID), are overridden by the last graph.
Types of graph events
•
•
•
•
•
•
•
Graph started
Graph started event is created, when ETL graph execution successfully started.
Graph phase finished
Graph phase finished event is created, everytime when graph phase is finished and all its nodes are finished with status
FINISHED_OK
.
Graph finished
Graph finished event is created, when all phases and nodes of graph are finished with
FINISHED_OK
status.
Graph error
Graph error event is created, when graph cannot be executed for any reason, or when any node of graph fails.
177
Chapter 24. Listeners
Graph aborted
Graph aborted event is created, when graph is explicitly aborted.
Graph timeout
Graph timeout event is created, when graph runs longer than for a specified interval. Thus you should specify a
"Job timeout interval" attribute for each listener of a graph timeout event. You can specify this interval in seconds or in minutes or in hours.
Figure 24.2. Web GUI - graph timeout event
Graph unknown status
Graph unknown status event is created, when the server, during the startup, detects run records with undefined status in the executions history. Undefined status means, that server has been killed during the graph run. Server automatically changes state of a graph to Not Available and sends a graph unknown status event.
Please note, that this works just for executions, which have a persistent record in executions history. It is possible to execute a transformation without persistent record in executions history, typically for better performance of fast running transformations (i.e. using Launch Services).
Listener
User may create a listener for a specific event type and graph (or all graphs in sandbox). The listener is actually connection between graph event and the task, where graph event specifies when and task specifies what to do.
Event handling consist of the following course of actions:
• event is created
178
Chapter 24. Listeners
• listeners for this event are notified
• each listener performs related task
Tasks
In the Cluster environment, all tasks have an additional attribute "Node IDs to process the task". If there is no node
ID specified, the task may be processed on any cluster node. In most cases it will be processed on the same node where the event was triggered. If there are some nodeIDs specified, the task will be processed on the first node in the list which is connected in cluster and ready.
Execute Shell Command (p. 149)
Use Cases
Possible use cases are the following:
•
Execute graphs in chain (p. 179)
•
Email notification about graph failure (p. 181)
•
Email notification about graph success (p. 182)
•
Backup of data processed by graph (p. 183)
Execute graphs in chain
For example, we have to execute graph B, only if another graph A finished without any error. So there is some kind of relation between these graphs. We can achieve this behaviour by creating a graph event listener. We create a listener for graph finished
event of graph A and choose an start a graph
task type with graph
B specified for execution. If we create another listener for graph B with execute graph
task with graph C specified, it will work as a chain of graphs.
179
Chapter 24. Listeners
Figure 24.3. Event source graph isn't specified, thus listener works for all graphs in specified sandbox
180
Chapter 24. Listeners
Email notification about graph failure
Figure 24.4. Web GUI - e-mail notification about graph failure
181
Chapter 24. Listeners
Email notification about graph success
Figure 24.5. Web GUI - email notification about graph success
182
Chapter 24. Listeners
Backup of data processed by graph
Figure 24.6. Web GUI - backup of data processed by graph
183
Chapter 24. Listeners
Jobflow Event Listeners
Jobflow Event Listeners allow you to define a task that the Server will execute as a reaction to the success or failure of executing a specific job (a jobflow).
Each listener is bound to a specific jobflow and is evaluated every time the jobflow is executed (no matter whether manually, through another jobflow, scheduled, via an API call, etc.).
ways, since ETL Graphs and Jobflows are both "jobs" from the point of view of the CloverETL Server.
In the Cluster, the event and the associated task are executed on the same node the job was executed on. If the jobflow is distributed, the task will be executed on the master worker node. However, you can override where the task will be executed by explicitly specifying a Node ID in the task definition.
Jobflow Events
Each event carries properties of the event source job. If there is an event listener specified, task may use these properties. E.g. next job in the chain may use "EVENT_FILE_NAME" placeholder which activated the first job in the chain. Job properties, which are set specifically for each run (e.g. RUN_ID), are overridden by the last job.
Types of jobflow events
•
•
Jobflow phase finished (p. 184)
•
•
•
•
•
Jobflow unknown status (p. 185)
Jobflow started
A Jobflow started event is created, when jobflow execution successfully started.
Jobflow phase finished
A Jobflow phase finished event is created, everytime when jobflow phase is finished and all its nodes are finished with status
FINISHED_OK
.
Jobflow finished
A Jobflow finished event is created, when all phases and nodes of jobflow are finished with status
FINISHED_OK
.
Jobflow error
A Jobflow error event is created, when jobflow cannot be executed for any reason, or when any node of the jobflow fails.
Jobflow aborted
A Jobflow aborted event is created, when jobflow is explicitly aborted.
Jobflow timeout
A Jobflow timeout event is created, when jobflow runs longer then specified interval. Thus you have to specify
"Job timeout interval" attribute for each listener of jobflow timeout event. You can specify this interval in seconds or in minutes or in hours.
184
Chapter 24. Listeners
Figure 24.7. Web GUI - jobflow timeout event
Jobflow unknown status
A Jobflow unknown status event is created, when the server, during the startup, detects run records with undefined status in the executions history. Undefined status means, that server has been killed during jobflow run.
Server automatically changes state of jobflow to Not Available and sends jobflow status unknown event.
Please note, that this works just for executions, which have persistent record in executions history. It is possible to execute transformation without persistent record in executions history, typically for better performance of fast running transformations (e.g. using Launch Services).
Listener
User may create a listener for the specified event type and jobflow (or all jobflows in sandbox). The listener is actually connection between jobflow event and task, where jobflow event specifies when and task specifies what to do.
Event handling consist of the following course of actions:
• event is created
• listeners for this event are notified
• each listener performs the related task
Tasks
Task specifies operation which should be performed as the reaction to the triggered event.
Task types are described in Chapter 20, Tasks (p. 144).
Note: You can use a task of any type for a jobflow event listener. Description of task types is divided into two sections just to show the most obvious use cases.
185
Execute Shell Command (p. 149)
Chapter 24. Listeners
186
Chapter 24. Listeners
JMS Messages Listeners
JMS Message Listeners allow you to listen for incoming JMS messages. You specify the source of the messages
(JMS Topic or JMS Queue) and a task that will be executed for each incoming message.
JMS messaging requires a JMS API (jms.jar) and specific third-party libraries. Every one of these libraries must be available on an application server classpath. Some application servers contain these libraries by default; however, some do not. In such a case, libraries must be added explicitly before starting the CloverETL Server.
JMS is a complex topic that goes beyond the scope of this document. For more detailed information about JMS, refer to the Oracle website: http://docs.oracle.com/javaee/6/tutorial/doc/bncdq.html
Note that the JMS implementation is dependent on the application server that the CloverETL Server is running in.
In Cluster, you can either explicitly specify which node will listen to JMS or not. If unspecified, all nodes will register as listeners. In the case of JMS Topic, all nodes will get the message and will trigger the task (multiple instances) or, in the case of JMS Queue, a random node will consume the message and will run the task (just one instance).
Table 24.1. Attributes of JMS message task
Attribute
Initialize by
Description
This attribute makes sense only in cluster environment. It is node ID where the listener should be initialized. If it is not set, listener is initialized on all nodes in the cluster.
In the Cluster environment, each JMS event listener has a "Node IDs" attribute which may be used for specification which cluster node will consume messages from the queue/topic. There are following possibilities:
• No failover: Just one node ID specified - Only specified node may consume messages, however node status must be "ready". When the node isn't ready, messages aren't consumed by any cluster node.
• Failover with node concurrency: No node ID specified (empty input) - All cluster nodes with status "ready" consume messages concurrently.
Broker URL
• Failover with node reservation: More node IDs specified (separated by a comma) -
Just one of specified nodes consumes messages at a time. If the node fails from any reason (or its status isn't "ready"), any other "ready" node from the list continues with consuming messages.
In a standalone environment, the "Node IDs" attribute is ignored.
JNDI Access
Initial context
These items are available only in custom initial context.
Default or custom
Initial context factory class A full class name of javax.naming.InitialContext implementation. Each
JMS provider has its own implementation. E.g. Apache MQ has
"org.apache.activemq.jndi.ActiveMQInitialContextFactory". If it is empty, server uses default initial context.
Specified class must be on web-app classpath or application-server classpath. It is usually included in one library with a JMS API implementation for each specific
JMS broker provider.
URL of a JMS message broker
187
Chapter 24. Listeners
Attribute
Listen To
Connection factory
Username
Password
Queue/Topic
Durable subscriber
Description
JNDI name of a connection factory. It depends on a JMS provider.
Username for connection to a JMS message broker
Password for connection to JMS message broker
JNDI name of a message queue/topic on the server
If it is false, message consumer is connected to the broker as "non-durable", so it receives only messages which are sent while the connection is active. Other messages are lost.
If the attribute is true, the consumer is subscribed as "durable" so it receives even messages which are sent while the connection is inactive. The broker stores such messages until they can be delivered or until the expiration is reached.
This switch makes sense only for Topics destinations, because Queue destinations always store messages until they can be delivered or the expiration is reached.
Message selector
Please note, that consumer is inactive i.e. during server restart and during short moment when user updates the "JMS message listener" ant it must be re-initialized.
So during these intervals the message in the Topic may get lost if the consumer does not have durable subscription.
If the subscription is durable, client must have "ClientId" specified. This attribute can be set in different ways in dependence on JMS provider. E.g. for ActiveMQ, it is set as a URL parameter tcp://localhost:1244?jms.clientID=TestClientID
This "query string" can be used as specification of conditions for filtering incoming messages. Syntax is well described on Java EE API web site: http://java.sun.com/ j2ee/1.4/docs/api/javax/jms/Message.html
It has different behaviour depending on type of consumer (queue/topic)
Queue: If a its a queue the messages that are filtered out remain on the queue.
Topic: Messages filtered out by a Topic subscriber's message selector will never be delivered to the subscriber. From the subscriber's perspective, they do not exist.
Message Processing
Number of consumers E.g. 1
Trigger new task for every message
Triggers new task for every JMS message
Groovy code Groovy code may be used for additional message processing and/or for refusing message. Both features are described below.
Optional Groovy code
Groovy code may be used for additional message processing or for refusing a message.
• Additional message processing Groovy code may modify/add/remove values stored in the containers
"properties" and "data".
• Refuse/acknowledge the message If the Groovy code returns Boolean.FALSE, the message is refused.
Otherwise, the message is acknowledged. A refused message may be redelivered, however the JMS broker should configure a limit for redelivering messages. If the groovy code throws an exception, it’s considered a coding error and the JMS message is NOT refused because of it. So, if the message refusal is to be directed by some exception, it must be handled in groovy.
188
Chapter 24. Listeners
Table 24.2. Variables accessible in groovy code
javax.jms.Message
java.util.Properties
type
java.util.Map<String, Object> javax.servlet.ServletContext
com.cloveretl.server.api.ServerFacade
java.lang.String
msg
key
properties
description
instance of a JMS message
See below for details. It contains values (String or converted to String) read from a message and it is passed to the task which may use them somehow. E.g. "execute graph" task passes these parameters to the executed graph.
data See below for details. Contains values (Object,
Stream, ..) read or proxied from the message instance and it is passed to the task which may use them somehow. E.g. "execute graph" task passes it to the executed graph as "dictionary entries".
servletContext instance of ServletContext serverFacade instance of serverFacade usable for calling
CloverETL Server core features.
sessionToken sessionToken, needed for calling serverFacade methods
Message data available for further processing
A JMS message is processed and the data it contains is stored into two data structures: Properties and Data.
189
Chapter 24. Listeners
Table 24.3. Properties Elements
key
JMS_PROP_[property key]
JMS_MAP_[map entry key]
JMS_TEXT
description
For each message property is created one entry, where "key" is made of a
"JMS_PROP_" prefix and property key.
If the message is instance of MapMessage, for each map entry is created one entry, where "key" is made of "JMS_MAP_" prefix and map entry key. Values are converted to String.
If the message is instanceof TextMessage, this property contains content of the message.
JMS_MSG_CLASS Class name of message implementation
JMS_MSG_CORRELATIONID Correlation ID is either a provider-specific message ID or an applicationspecific String value
JMS_MSG_DESTINATION The JMSDestination header field contains the destination to which the message is being sent.
JMS_MSG_MESSAGEID A JMSMessageID is a String value that should function as a unique key for identifying messages in a historical repository. The exact scope of uniqueness is provider-defined. It should at least cover all messages for a specific installation of a provider, where an installation is some connected set of message routers.
JMS_MSG_REPLYTO
JMS_MSG_TYPE
Destination to which a reply to this message should be sent.
Message type identifier supplied by the client when the message was sent.
JMS_MSG_DELIVERYMODE The DeliveryMode value specified for this message.
JMS_MSG_EXPIRATION The time the message expires, which is the sum of the time-to-live value specified by the client and the GMT at the time of the send.
JMS_MSG_PRIORITY The JMS API defines ten levels of priority value, with 0 as the lowest priority and 9 as the highest. In addition, clients should consider priorities 0-4 as gradations of normal priority and priorities 5-9 as gradations of expedited priority.
JMS_MSG_REDELIVERED "true" if this message is being redelivered.
JMS_MSG_TIMESTAMP The time a message was handed off to a provider to be sent. It is not the time the message was actually transmitted, because the actual send may occur later due to transactions or other client-side queueing of messages.
Note that all values in the “Properties” structure are stored as String type – however they are numbers or text.
For backwards compatibility, all listed properties can also be accessed using lower-case keys; it is, however, a deprecated approach.
Table 24.4. "data" elements
key description
JMS_MSG instance of javax.jms.Message
JMS_DATA_STREAM Instance of java.io.InputStream. Accessible only for TextMessage, BytesMessage,
StreamMessage, ObjectMessage (only if payload object is instance of String).
Strings are encoded in UTF-8.
JMS_DATA_TEXT
JMS_DATA_OBJECT
Instance of String. Only for TextMessage and ObjectMessage, where payload object is instance of String.
Instance of java.lang.Object - message payload. Only for ObjectMessage.
190
Chapter 24. Listeners
The “Data” container is passed to a task that can use it, depending on its implementation. For example, the task
"execute graph" passes it to the executed graph as “dictionary entries.”
In the Cluster environment, you can specify explicitly node IDs, which can execute the task. However, if the “data” payload is not serializable and the receiving and executing node differ, an error will be thrown as the Cluster cannot pass the “data” to the executing node.
Inside a graph or a jobflow, data passed as dictionary entries can be used in some component attributes. For example, a File URL attribute would look like: "dict:JMS_DATA_STREAM:discrete" for reading the data directly from the incoming JMS message using a proxy stream.
For backwards compatibility, all listed dictionary entries can also be accessed using lower-case keys; it is, however, a deprecated approach.
191
Chapter 24. Listeners
Universal Event Listeners
Since 2.10
Universal Event Listeners allow you to write a piece of Groovy code that controls when an event is triggered, subsequently executing a predefined task. The Groovy code is periodically executed and when it returns TRUE, the task is executed.
Table 24.5. Attributes of Universal message task
Attribute Description
Node IDs to handle the event
In the Cluster environment, each universal event listener has a "Node IDs" attribute which may be used for specification which cluster node will perform the Groovy code. There are following possibilities:
• No failover: Just one node ID specified - Only the specified node performs the
Groovy code, however node status must be "ready". When the node isn't ready, code isn't performed at all.
• Failover with node concurrency: No node ID specified (empty input) - All cluster nodes with status "ready" concurrently perform Groovy code. So the code is executed on each node in the specified interval.
• Failover with node reservation: More node IDs specified (separated by comma)
- Just one of specified nodes performs groovy code. If the node fails from any reason (or its status isn't "ready"), any other "ready" node from the list continues with periodical groovy code processing.
In standalone environment, the "Node IDs" attribute is ignored.
Interval of check in seconds
Periodicity of Groovy code execution.
Groovy code Groovy code that evaluates either to TRUE (execute the task) or FALSE (no action).
See below for more details.
Groovy code
A piece of Groovy is repeatedly executed and evaluated; based on the result, the event is either triggered and the task executed or no action is taken.
For example, you can continually check for essential data sources before starting a graph. Or, you can do complex checks of a running graph and, for example, decide to kill it if necessary. You can even call the CloverETL Server core functions using the ServerFacade interface, see Javadoc: http://host:port/clover/javadoc/index.html
Evaluation Criteria
If the Groovy code returns Boolean.TRUE, the event is triggered and the associated task is executed. Otherwise, nothing happens.
If the Groovy code throws an exception, it is considered a coding error and the event is NOT triggered. Thus, exceptions should be properly handled in the Groovy code.
192
Chapter 24. Listeners
Table 24.6. Variables accessible in Groovy code
java.util.Properties
type
java.util.Map<String, Object> javax.servlet.ServletContext
com.cloveretl.server.api.ServerFacade
java.lang.String
key
properties data
description
An empty container which may be filled with
String-String key-value pairs in your Groovy code. It is passed to the task which may use them somehow. I.e. task "execute graph" passes these parameters to the executed graph.
An empty container which may be filled with
String-Object key-value pairs in your Groovy code. It is passed to the task which may use them somehow according to its implementation - i.e.
task "execute graph" passes it to the executed graph as "dictionary entries". Note that it is not serializable, thus if the task is relying on it, it can be processed properly only on the same cluster node.
servletContext instance of ServletContext in which CloverETL
Server is running serverFacade instance of serverFacade usable for calling
CloverETL Server core features.
sessionToken sessionToken, needed for calling methods on the serverFacade
193
Chapter 24. Listeners
File Event Listeners (remote and local)
Local file-system changes: Since 1.3
Remote file-system changes: Since 4.2
File Event Listeners allow you to monitor changes on a specific local file system path or remote URL – for example, new files appearing in a folder – and react to such an event with a predefined task.
You can either specify an exact file name or use a wildcard or regexp, then set a checking interval in seconds, and finally, define a task to process the event.
There is a global minimum check interval that you can change if necessary in the configuration
("clover.event.fileCheckMinInterval" property). See Chapter 9, List of Properties (p. 70).
Figure 24.8. Web GUI - creating a File Event listener
Cluster environment
In the Cluster environment, each file event listener has a "Node IDs" attribute which may be used for specification which cluster node will perform the checks on its local file system. There are following possibilities:
194
Chapter 24. Listeners
• No failover: Just one node ID specified - Only specified node observes the local/remote filesystem, however node status must be "ready". When the node isn't ready, file system isn't checked at all.
To create a file event listener with no failover, select One of selected nodes in Initialize by and select one node from the table below.
• Failover with node concurrency: No node ID specified (empty input) - All cluster nodes with status "ready" concurrently check local/remote filesystem according to file event listener attributes settings. In this mode, when the listener is configured to observe local filesystem, each cluster node observes its own local file system. So it's useful only when the observed path is properly shared among the cluster nodes. It may behave unpredictably otherwise. On the other hand, when the listener is configured to observe remote filesystem, listeners running on different cluster nodes may connect to the same remote resource. The nodes use locking mechanism when accessing the local or remote filesystem, so the listeners running concurrently on different nodes can't get to the conflict.
To create file event listener with node cuncurrency, select Any node in Initialize by.
• Failover with node reservation: More node IDs specified (separated by comma) - Just one of specified nodes checks its filesystem. If the node fails from any reason (or its status isn't "ready"), any other "ready" node from the list continues with checking. Please note, that when file event listener is re-initialized on another cluster node, it compares last directory content detected by the failed node with the current directory content.
To create a file event listener with node reservation, select One of selected nodes in Initialize by and select more nodes.
In standalone environment, the "Node IDs" attribute is ignored.
Supported filesystems and protocols
Local filesystem
The user may specify path to the directory which the listener shall observe. The listener doesn't read the directory content recursivelly. The directory must exist.
In cluster environment the directory must exist on each cluster node where the listener may run. If the listener can run concurrently on more nodes, the directory must be shared among all these nodes and the directory must exist on all these nodes.
It's recommended to use placeholders to unify configuration on all nodes. These are recommended placeholders:
CloverETL Server config property ${sandboxes.home} and JVM system property ${java.io.tmpdir} .
It's possible to use any JVM system property or Environment variable.
Remote filesystem
The user may specify URL to the directory which the listener shall observe. Currently these protocols are supported: FTP, S3, SFTP and SMB. Different protocols may use different authentication methods: none, username+password and keystore. The listener doesn't read the directory content recursivelly. The directory must exist.
Currently the subset of the protocols allowed by file-operations is supported:
• FTP - File Transfer Protocol (no authentication or username+password authentication) URL example:
ftp://host:23/observed/path/
• SFTP (SSH/FTP) - SSH File Transfer Protocol (username+private key authentication) URL example:
195
Chapter 24. Listeners
sftp://host:23/observed/path/
It's recommended to use placeholders to unify path configuration on all nodes. These are recommended placeholders: CloverETL Server config property ${sandboxes.home} , JVM system property
${user.home} . It's possible to use any JVM system property or Environment variable.
• S3 - Amazon S3 Storage (AWSAccessKeyId+Signature authentication) URL example:
s3://s3.amazonaws.com/bucketname/path/
Please specify the AWSAccessKeyId as username and Signature as password.
• SMB - Microsoft SMB Protocol (username+password authentication) URL example:
smb://host/path/
Observed file
Local observed file is specified by directory path and file name pattern.
Remote observed file is specified by URL, credentials and file name pattern.
User may specify just one exact file name or file name pattern for observing more matching files in specified directory. If there are more changed files matching the pattern, separated event is triggered for each of these files.
There are three ways how to specify file name pattern of observed file(s)
•
•
•
Exact match
You specify the exact name of the observed file.
Wildcards
You can use wildcards common in most operating systems (*, ?, etc.)
•
*
- Matches zero or more instances of any character
•
?
- Matches one instance of any character
•
[...]
- Matches any of characters enclosed by the brackets
•
\
- Escape character
Examples
•
*.csv
- Matches all CSV files
• input_*.csv
- Matches i.e. input_001.csv, input_9.csv
• input_???.csv
- Matches i.e. input_001.csv, but does not match input_9.csv
196
Chapter 24. Listeners
Regular expression
Examples
•
(.*?)\.(jpg|jpeg|png|gif)$
- Matches image files
Notes
• It is strongly recommended to use absolute paths with placeholders. It is possible to use relative path, but working directory depends on an application server.
• Use forward slashes as file separators, even on MS Windows OS. Backslashes might be evaluated as escape sequences.
File Events
For each listener you have to specify event type, which you are interested in.
Please note that since CloverETL 4.2, the grouping mode may be enabled for the file listener, so all file changes detected by single check produce just one "grouped" file event. Otherwise each single file produces its own event.
There are four types of file events:
•
•
•
•
File timestamp changed (p. 197)
File added
Event of this type occurs, when the observed file is created or copied from another location between two checks.
Please keep in mind, that event of this type occurs immediately when a new file is detected, regardless it is complete or not. Thus task which may need a complete file is executed when file is still incomplete. Recommended approach is to save the file to a different location and when it is complete, rename it or move it to an observed location where CloverETL Server may detect it. File moving/renaming should be atomic operation.
Event of this type does not occur when the file has been updated (change of timestamp or size) between two checks.
Appearance means that the file didn't exist during the previous check and it exists now, during the current check.
File removed
Event of this type occurs, when observed file is deleted or moved to another location between two checks.
File size changed
Event of this type occurs when the size of the observed file has changed between two checks. Event of this type is never produced when file is created or removed. The file must exist during both checks.
File timestamp changed
Event of this type occurs, when change time of the observed file has changed between two checks. Event of this type is never produced when the file is created or removed. The file must exist during both checks.
Check Interval, Task and Use Cases
• User may specify the minimum time interval between two checks. The interval is specified in seconds.
• Each listener defines a task, which will be processed as a reaction for the file event. All task types and theirs attributes are described in Scheduling and GraphEventListeners sections.
197
Chapter 24. Listeners
• Graph Execution, when a file with input data is accessible
• Graph Execution, when a file with input data is updated
• Graph Execution, when a file with generated data is removed and must be recreated
How to use source of event during task processing
A file(s), which caused event (considered as source of the event) may be used during task processing. CloverETL graph/jobflow components with "File URL" attribute (e.g. reader or writer components) may directly use event source by parameter placeholder:
${EVENT_FILE_URLS}
. Please see Executed by Task "graph execution" by
File Event Listener (p. 142) to see another parameters.
Please note that previous versions used lower-case placeholders. Since version 3.3, placeholders are upper-case, however lower-case still work for backward compatibility.
For "graph execution" task this works only if the graph is not pooled. Thus "keep in pool interval" must be set to 0 (default value).
Delayed triggering for incomplete files
It is possible to delay task execution for incomplete files. This is useful in cases, when the condition to execute the listener's task has been met, but there is still some work that needs to be done on the file, e.g. the whole file needs to be uploaded.
Ignore empty files
If the process creating the file creates an empty file and does something else for several minutes or even hours, and finally writes the content, tick Ignore empty files checkbox. The task will be triggered only if a non-empty file appears.
Trigger task when file has not changed for n checks
If the file size slowly rises till the file is complete, tick the checkbox Trigger task when file has not changed.
Then specify the number of additional file size checks that are to be performed on the file. The listener's task will not be triggered until the checks are performed and the file's size stays the same between these checks.
Combination
If you use Ignore empty files and Trigger task when file has not changed for n checks together, the first one filters out empty files and the later one the files that are being changed. The task will be triggered only on files that are not empty and that have not changed for the specified number of checks.
Howtos
Create a file event listener listening to changes on local file system (p. 198)
Observe file from one cluster node (p. 199)
Quickly setup failure notification (p. 199)
Quickly enable or disable file event listener (p. 199)
Create a file event listener listening to changes on local file system
This howto shows way to create a new listener checking appearance of a file ( new_invoices.txt
) on local file system (
/mnt/sdb2/
). The appearance will trigger a graph ( graph/checkInvoices.grf
) from
InvoicesProcessing sandbox.
In Event Listeners click New Listener
→
File Event Listener.
198
Chapter 24. Listeners
Enter the Name of the listener, e.g. Invoices.
Enter the Path to the directory where files will appear:
/mnt/sdb2
. You can check that Clover can access this directory (the directory exists and permissions are set up properly) with Validate Accesibility button.
If the observed directory becomes inaccessible, CloverETL Server can send you an email. To do so, tick Send
email on check failure and enter recipient(s).
The event should be triggered on file appearance - set Type of check to File added.
Enter the file name new_invoices.txt
to Filename pattern.
If the file is created empty but the content is written after some time, tick Ignore empty files. Doing so, the task will be executed after the file contains some data.
If it takes a long time to copy the whole file to the observed position, the clover server can perform several check to ensure that the file to process is not to be changed. Tick Trigger task when file has not changed for and enter the number of checks. If you tick Ignore empty files, this checks will be performed after the file is not empty.
Choose Sandbox with the graph (InvoicesProcessing) and the graph (graph/checkInvoices.grf).
To save the changes click Create.
Observe file from one cluster node
Create the listener in the same way as on Server.
Switch Initialize by to One of selected nodes.
Add the particular node(s) from Available nodes to Selected nodes.
Quickly setup failure notification
To create notification when the file event listener fails, click Create notification button. Pressing the button opens up a popup dialog where e-mail addresses can be entered separated by commas.
The entered email addresses are remembered and pre-filled the next time the button is pressed. If the popup is closed with invalid e-mail addresses entered, then the field is cleared.
When creating the notification a Task Failure Listener is created with an e-mail task listening to the selected File
Event Listener. The first entered e-mail address will be used as the Reply-to(Sender) address. The subject and body of the e-mail is as predefined by the Task Failure template. The trigger limit is set to 5.
Editing failure notification
If there is a Task Failure Listener listening to given File Event Listener then instead of Create Notification button a Notification Detail button is displayed. This button redirects to the Task Failure Listener page and shows the details of the Task Failure Listener listening to the File Event Listener. If more than one Task Failure Listeners are listening to the File Event Listener, then the details of the first one is shown.
Quickly enable or disable file event listener
In Event Listeners
→
File Event Listeners, there is a table with event listeners. In this table, click the icon in
Enabled column.
199
Chapter 24. Listeners
Task Failure Listeners
Since 4.4
Task Failure Listeners allow you to detect and react to failures in your server when a task you set up in a listener fails to execute, e.g. a File Listener is set up to detect changes on an FTP server, but it fails to connect to the
FTP server.
Task Failure Listeners do not detect failures of the task itself, e.g. a File Listener is set up to detect changes on an FTP server and send an e-mail if the change is detected. If the File Listener fails to send the e-mail for some reason, the Task Failure Listener won't detect it.
The same tasks to be executed are available as with all the other listeners, with the difference being that when creating a new Task Failure Listener the pre-selected task is Sending an e-mail if the e-mail service is configured in Configuration.
Figure 24.9. Web GUI - creating a Task Failure listener
Task Choice
There are three options to choose from: Listening to any task failure, listening to failures from a group (such as
File Event Listeners), or listening to a failure of a chosen listener.
Selecting an option from the 'Listen to type' menu restricts the 'Listen to' combobox to event sources of the chosen category. If there are no event sources in the category, the Failure Listener still can be created, it will react to failures of tasks that will be created in that category.
When selecting an event source you can type into the text field to filter the dropdown menu. After selecting an event source some information is presented about the listener.
When sending an e-mail you can use the 'task failed' template by selecting it from the 'E-mail template' dropdown menu.
Task Failed E-mail Template
in Table 24.7, “ Parameters usable in task failure e-mail template
200
Chapter 24. Listeners
Table 24.7. Parameters usable in task failure e-mail template
Parameter Description
TASK_ERROR_MESSAGEError messages and Exceptions from the failed listener.
TASK_LISTENER_ID ID of the failed listener.
TASK_LISTENER_NAMEName of the failed listener.
TASK_LISTENER_TYPE Type of the failed listener.
Table 24.8. File Event Listener specific parameters usable in task failure e-mail template
Parameter Description
201
Chapter 25. API
Simple HTTP API
The Simple HTTP API is a basic Server automation tool that lets you control the Server from external applications using simple HTTP calls.
Most of operations is accessible using the HTTP GET method and return plain text. Thus, both “request” and
“response” can be conveniently sent and parsed using very simple tools (wget, grep, etc.).
If global security is “on” (on by default), Basic HTTP authentication is used. Authenticated operations will require valid user credentials with corresponding permissions.
Note that the ETL graph-related operations "graph_run", "graph_status" and "graph_kill" also work for jobflows and Data Profiler jobs.
The generic pattern for a request URL: http://[domain]:[port]/[context]/[servlet]/[operation]?[param1]=[value1]&[param2]=[value2]...
For a wget client, you can use following command line: wget --user=$USER --password=$PASS -O ./$OUTPUT_FILE $REQUEST_URL
•
•
•
Operation graph_status (p. 203)
•
•
Operation server_jobs (p. 205)
•
Operation sandbox_list (p. 205)
•
Operation sandbox_content (p. 205)
•
Operation executions_history (p. 205)
•
•
•
Operation sandbox_create (p. 208)
•
Operation sandbox_add_location (p. 208)
•
Operation sandbox_remove_location (p. 208)
•
Operation download_sandbox_zip (p. 209)
•
Operation upload_sandbox_zip (p. 209)
•
Operation cluster_status (p. 210)
•
Operation export_server_config (p. 210)
•
Operation import_server_config (p. 211)
Operation help
parameters
no
returns
list of possible operations and parameters with its descriptions
example
http://localhost:8080/clover/request_processor/help
202
Chapter 25. API
Operation graph_run
Call this operation to start execution of the specified job. The operation is called graph_run for backward compatibility, however it may execute ETL graph, jobflow or profiler job.
parameters
Table 25.1. Parameters of graph_run
parameter name
graphID sandbox additional job parameters additional config parameters
mandatory
yes yes no no
default
-
-
description
A file path to the job file, relative to the sandbox root.
Text ID of sandbox.
Any URL parameter with "param_" prefix is passed to executed job and may be used in transformation XML as a placeholder, but without the "param_" prefix. e.g.
"param_FILE_NAME" specified in URL may be used in the
XML as ${FILE_NAME}. These parameters are resolved only during loading of XML, so it cannot be pooled.
URL Parameters prefixed with "config_" can set some of the execution parameters. For graphs, the following parameters are supported: nodeID verbose no no
• config_skipCheckConfig
- when set to "false", graph configuration will be checked before the execution.
• config_logLevel
- log level of the executed graph, one of OFF, FATAL, ERROR, WARN, INFO, DEBUG,
TRACE, ALL.
• config_clearObsoleteTempFiles
- when set to
"true", temp files of previous runs of this graph will be deleted before the execution.
-
• config_debugMode
- when set to "true", debug mode for given graph will be enabled. See
Properties (p. 119) for more info.
In cluster mode it's ID of a node which should execute the job. However it's not final. If the graph is distributed, or the node is disconnected, the graph may be executed on some another node.
MESSAGE MESSAGE | FULL - how verbose should possible error message be.
returns
run ID: incremental number, which identifies each execution request
example
http://localhost:8080/clover/request_processor/graph_run?graphID=graph/graphDBExecute.grf&sandbox=mva
Operation graph_status
Call this operation to obtain status of specified job execution. The operation is called graph_status for backward compatibility, however it may return status of an ETL graph or jobflow.
203
Chapter 25. API
parameters
Table 25.2. Parameters of graph_status
parameter name
runID returnType waitForStatus waitTimeout verbose
mandatory
yes no no no no
default
-
description
Id of each graph execution
STATUS STATUS | STATUS_TEXT | DESCRIPTION |
DESCRIPTION_XML
Status code which we want to wait for. If it is specified, this operation will wait until the graph is in the required status.
0 If waitForStatus is specified, it will wait only the specified amount of milliseconds. Default 0 means forever, but it depends on an application server configuration. When the specified timeout expires and graph run still isn't in required status, the server returns code 408 (Request Timeout). 408 code may be also returned by an application server if its
HTTP request timeout expires before.
MESSAGE MESSAGE | FULL - how verbose should possible error message be.
returns
Status of a specified graph. It may be number code, text code or a complex description in dependence on optional parameter returnType. Description is returned as plain text with a pipe as a separator, or as XML. A schema describing XML format of the XML response is accessible on CloverETL Server URL: http://[host]:[port]/clover/ schemas/executions.xsd In dependence on waitForStatus parameter it may return result immediately or wait for a specified status.
example
http://localhost:8080/clover/request_processor/graph_status ->
-> ?runID=123456&returnType=DESCRIPTION&waitForStatus=FINISHED&waitTimeout=60000
Operation graph_kill
Call this operation to abort/kill job execution. The operation is called graph_kill for backward compatibility, however it may abort/kill ETL graph, jobflow or profiler job.
parameters
Table 25.3. Parameters of graph_kill
parameter name mandatory
runID yes returnType no verbose no
default
-
description
Id of each graph execution
STATUS STATUS | STATUS_TEXT | DESCRIPTION
MESSAGE
MESSAGE | FULL - how verbose should possible error message be.
returns
Status of the specified graph after an attempt to kill it. It may be number code, text code or a complex description in dependence on optional parameter.
example
204
Chapter 25. API http://localhost:8080/clover/request_processor/graph_kill?runID=123456&returnType=DESCRIPTION
Operation server_jobs
parameters
no
returns
List of runIDs of currently running jobs.
example
http://localhost:8080/clover/request_processor/server_jobs
Operation sandbox_list
parameters
no
returns
List of all sandbox text IDs. In next versions will return only accessible ones.
example
http://localhost:8080/clover/request_processor/sandbox_list
Operation sandbox_content
parameters
Table 25.4. Parameters of sandbox_content
parameter name mandatory
sandbox yes verbose no
default
-
MESSAGE
description
text ID of sandbox
MESSAGE | FULL - how verbose should possible error message be.
returns
A list of all elements in the specified sandbox. Each element may be specified as a file path relative to the sandbox root.
example
http://localhost:8080/clover/request_processor/sandbox_content?sandbox=mva
Operation executions_history
parameters
205
Chapter 25. API
Table 25.5. Parameters of executions_history
parameter name mandatory
sandbox yes from no to stopFrom stopTo status sandbox graphId orderBy orderDescend returnType index records verbose no no no no no no no no no no no no
default
-
description
text ID of sandbox
Lower datetime limit of start of execution. The operation will return only records after (and equal) this datetime.
Format: "yyyy-MM-dd HH:mm" (must be URL encoded).
Upper datetime limit of start of execution. The operation will return only records before (and equal) this datetime. Format:
"yyyy-MM-dd HH:mm" (must be URL encoded).
Lower datetime limit of stop of execution. The operation will return only records after (and equal) this datetime.
Format: "yyyy-MM-dd HH:mm" (must be URL encoded).
Upper datetime limit of stop of execution. The operation will return only records before (and equal) this datetime. Format:
"yyyy-MM-dd HH:mm" (must be URL encoded).
Current execution status. The operation will return only records with specified STATUS. Meaningful values are
RUNNING | ABORTED | FINISHED_OK | ERROR
Sandbox code. The operation will return only records for graphs from the specified sandbox.
true
IDs
Text Id, which is unique in a specified sandbox. The file path is relative to the sandbox root.
Attribute for list ordering. Possible values: id | graphId | status | startTime | stopTime. By default, there is no ordering.
A switch which specifies ascending or descending ordering.
If it is true (which is default), ordering is descending.
Possible values are: IDs | DESCRIPTION |
DESCRIPTION_XML
0 Index of the first returned records in whole record set.
(starting from infinite Max amount of returned records.
MESSAGE MESSAGE | FULL - how verbose should possible error message be.
returns
List of executions according to filter criteria.
For returnType==IDs
returns a simple list of runIDs (with new line delimiter).
For returnType==DESCRIPTION
returns complex response which describes current status of selected executions, their phases, nodes and ports.
execution|[runID]|[status]|[username]|[sandbox]|[graphID]|[startedDatetime]|[finishedDatetime]|[clusterNode]|[graphVersion] phase|[index]|[execTimeInMilis] node|[nodeID]|[status]|[totalCpuTime]|[totalUserTime]|[cpuUsage]|[peakCpuUsage]|[userUsage]|[peakUserUsage] port|[portType]|[index]|[avgBytes]|[avgRows]|[peakBytes]|[peakRows]|[totalBytes]|[totalRows]
example of request
http://localhost:8080/clover/request_processor/executions_history ->
206
Chapter 25. API
-> ?from=&to=2008-09-16+16%3A40&status=&sandbox=def&graphID=&index=&records=&returnType=DESCRIPTION
example of DESCRIPTION (plain text) response
execution|13108|FINISHED_OK|clover|def|test.grf|2008-09-16 11:11:19|2008-09-16 11:11:58|nodeA|2.4
phase|0|38733 node|DATA_GENERATOR1|FINISHED_OK|0|0|0.0|0.0|0.0|0.0
port|Output|0|0|0|0|0|130|10 node|TRASH0|FINISHED_OK|0|0|0.0|0.0|0.0|0.0
port|Input|0|0|0|5|0|130|10 node|SPEED_LIMITER0|FINISHED_OK|0|0|0.0|0.0|0.0|0.0
port|Input|0|0|0|0|0|130|10 port|Output|0|0|0|5|0|130|10 execution|13107|ABORTED|clover|def|test.grf|2008-09-16 11:11:19|2008-09-16 11:11:30 phase|0|11133 node|DATA_GENERATOR1|FINISHED_OK|0|0|0.0|0.0|0.0|0.0
port|Output|0|0|0|0|0|130|10 node|TRASH0|RUNNING|0|0|0.0|0.0|0.0|0.0
port|Input|0|5|0|5|0|52|4 node|SPEED_LIMITER0|RUNNING|0|0|0.0|0.0|0.0|0.0
port|Input|0|0|0|0|0|130|10 port|Output|0|5|0|5|0|52|4
For returnType==DESCRIPTION_XML
returns complex data structure describing one or more selected executions in XML format. A schema describing XML format of the XML response is accessible on CloverETL
Server URL: http://[host]:[port]/clover/schemas/executions.xsd
Operation suspend
Suspends server or sandbox (if specified). Suspension means, that no graphs may me executed on suspended server/sandbox.
parameters
Table 25.6. Parameters of suspend
parameter name mandatory
sandbox no atonce no
default
-
description
Text ID of a sandbox to suspend. If not specified, it suspends the whole server.
If this param is set to true, running graphs from suspended server (or just from sandbox) are aborted. Otherwise it can run until it is finished in common way.
returns
Result message
Operation resume
parameters
Table 25.7. Parameters of resume
parameter name mandatory
sandbox no verbose no
default description
Text Id of a sandbox to resume. If not specified, the server will be resumed.
MESSAGE MESSAGE | FULL - how verbose should the possible error message be.
returns
207
Chapter 25. API
Result message
Operation sandbox_create
This operation creates a specified sandbox. If it is sandbox of "partitioned" or "local" type, it also creates locations by "sandbox_add_location" operation.
parameters
Table 25.8. Parameters of sandbox create
parameter name mandatory
sandbox yes path no type createDirs verbose no no no
default
-
description
Text Id of sandbox to be created.
Path to the sandbox root if server is running in standalone mode.
shared Sandbox type: shared | partitioned | local. For standalone server may be left empty, since the default "shared" is used.
true Switch whether to create directory structure of the sandbox
(only for standalone server or "shared" sandboxes in cluster environment).
MESSAGE MESSAGE | FULL - how verbose should possible error message be.
returns
Result message
Operation sandbox_add_location
This operation adds a location to the specified sandbox. Can be only used with partitioned or local sandboxes.
parameters
Table 25.9. Parameters of sandbox add location
parameter name mandatory
sandbox nodeId yes yes path location verbose yes no no
default
-
-
description
Sandbox which we want to add location to.
Location attribute - node which has direct access to the location.
-
Location attribute - path to the location root on the specified node.
Location attribute - location storage ID. If it's not specified, new one will be generated.
MESSAGE MESSAGE | FULL - how verbose should possible error message be.
returns
Result message
Operation sandbox_remove_location
This operation removes a location from the specified sandbox. Only sandboxes of type partitioned or local can have locations asociated.
208
Chapter 25. API
parameters
Table 25.10. Parameters of sandbox add location
parameter name mandatory
sandbox yes location yes verbose no
default
-
description
Removes specified location from its sandbox.
Location storage ID. If the specified location isn't attached to the specified sandbox, sandbox won't be changed.
MESSAGE MESSAGE | FULL - how verbose should possible error message be.
returns
Result message
Operation download_sandbox_zip
This operation downloads content of a specified sandbox as a ZIP archive.
parameters
Table 25.11. Parameters
parameter name mandatory
sandbox yes
default
-
returns
Content of the specified sandbox as a ZIP archive
example description
Code of the sandbox to be downloaded.
wget --http-user=username --http-password=password http://localhost:8080/clover/simpleHttpApi/download_sandbox_zip?sandbox=my-sandbox
Operation upload_sandbox_zip
This operation uploads content of a ZIP archive into a specified sandbox.
parameters
Table 25.12. Parameters
parameter name mandatory
sandbox yes zipFile overwriteExisting yes no deleteMissing fileNameEncoding no no
default
-
false
description
Code of the sandbox the ZIP file will be expanded to.
The ZIP archive file.
If true
, the files already present in the sandbox will be overwritten.
false If true
, the files not present in the ZIP file will be deleted from the sandbox.
UTF-8 The encoding that was used to store file names in the ZIP archive.
209
Chapter 25. API
returns
Result message
example of request (with using curl CLI tool (http://curl.haxx.se/))
curl -u username:password -F "overwriteExisting=true"
-F "zipFile=@/tmp/my-sandbox.zip"
http://localhost:8080/clover/simpleHttpApi/upload_sandbox_zip
Operation cluster_status
This operation displays cluster's nodes list.
parameters
no
returns
Cluster's nodes list.
Operation export_server_config
This operation exports a current server configuration in XML format.
parameters
Table 25.13. Parameters of server configuration export
parameter name mandatory
include no
default
all
description
Selection which items will be included in the exported XML file; the parameter may be specified multiple times. Possible values are:
• all - include items of all types
• users - include list of users
• userGroups - include list of user groups
• sandboxes - include list of sandboxes
• jobConfigs - include list of job configuration parameters
• schedules - include list of schedules
• eventListeners - include list of event listeners
• launchServices - include list of launch services
• tempSpaces - include list of temporary spaces
returns
Current server configuration as an XML file.
example
210
Chapter 25. API wget http://localhost:8080/clover/simpleHttpApi/export_server_config
Operation import_server_config
This operation imports server configuration.
parameters
Table 25.14. Parameters of server configuration import
parameter name mandatory
xmlFile dryRun yes no verbose newOnly include no no no
default
true
description
An XML file with server's configuration.
If true
, a dry run is performed with no actual changes written.
MESSAGE MESSAGE | FULL - how verbose should the response be:
MESSAGE for a simple message, FULL for a full XML report.
false If true
only new items will imported to the server; the items already present on the server will be left untouched.
all Selection which items will be imported from the XML; the parameter may be specified multiple times. Possible values are:
• all
- import items of all types
• users
- import users
• userGroups
- import user groups
• sandboxes
- import sandboxes
• jobConfigs
- import job configuration parameters
• schedules
- import schedules
• eventListeners
- import listeners
• launchServices
- import launch services
• tempSpaces
- import temporary spaces
returns
Result message or XML report
example of request (with using curl CLI tool (http://curl.haxx.se/))
curl -u username:password -F "dryRun=true" -F "verbose=FULL"
-F "xmlFile=@/tmp/clover_configuration_2013-07-10_14-03-23+0200.xml"
http://localhost:8080/clover/simpleHttpApi/import_server_config
211
Chapter 25. API
.
JMX mBean
The CloverETL Server JMX mBean is an API that you can use for monitoring the internal status of the Server.
MBean is registered with the name: com.cloveretl.server.api.jmx:name=cloverServerJmxMBean
JMX Configuration
Application's JMX MBeans aren't accessible outside of JVM by default. It needs some changes in an application server configuration to make JMX Beans accessible.
This section describes how to configure a JMX Connector for development and testing. Thus authentication may be disabled. For production deployment authentication should be enabled. Please refer further documentation to see how to achieve this. i.e. http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#auth
Configurations and possible problems:
•
How to configure JMX on Apache Tomcat (p. 212)
•
How to Configure JMX on Glassfish (p. 213)
•
How to Configure JMX on WebSphere (p. 213)
•
How to configure JMX on Apache Tomcat
Tomcat's JVM must be executed with these self-explanatory parameters:
1.
-Dcom.sun.management.jmxremote=true
2.
-Dcom.sun.management.jmxremote.port=8686
3.
-Dcom.sun.management.jmxremote.ssl=false
4.
-Dcom.sun.management.jmxremote.authenticate=false
5.
-Djava.rmi.server.hostname=your.server.domain (necessary only for remote
JMX connections)
On UNIX like OS set environment variable CATALINA_OPTS i.e. like this: export CATALINA_OPTS="-Dcom.sun.management.jmxremote=true
-Dcom.sun.management.jmxremote.port=8686
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=your.server.domain.com"
File TOMCAT_HOME/bin/setenv.sh (if it does not exist, you may create it) or TOMCAT_HOME/bin/catalina.sh
On Windows it might be tricky, that each parameter must be set separately: set CATALINA_OPTS=-Dcom.sun.management.jmxremote=true set CATALINA_OPTS=%CATALINA_OPTS% -Dcom.sun.management.jmxremote.port=8686 set CATALINA_OPTS=%CATALINA_OPTS% -Dcom.sun.management.jmxremote.authenticate=false set CATALINA_OPTS=%CATALINA_OPTS% -Dcom.sun.management.jmxremote.ssl=false
212
Chapter 25. API set CATALINA_OPTS=%CATALINA_OPTS% -Djava.rmi.server.hostname=your.server.domain
File TOMCAT_HOME/bin/setenv.bat (if it does not exist, you may create it) or TOMCAT_HOME/bin/ catalina.bat
With these values, you can use URL service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi for connection to JMX server of JVM. No user/password is needed
How to Configure JMX on Glassfish
Go to Glassfish admin console (by default accessible on http://localhost:4848 with admin/adminadmin as user/ password)
Go to section "Configuration" > "Admin Service" > "system" and set attributes like this:
Figure 25.1. Glassfish JMX connector
With these values, you can use URL service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi for connection to JMX server of JVM.
Use admin/adminadmin as user/password. (admin/adminadmin are default glassfish values)
How to Configure JMX on WebSphere
WebSphere does not require any special configuration, but the clover MBean is registered with the name that depends on application server configuration: com.cloveretl.server.api.jmx:cell=[cellName],name=cloverServerJmxMBean,node=[nodeName],
process=[instanceName]
213
Chapter 25. API
Figure 25.2. WebSphere configuration
URL for connecting to JMX server is: service:jmx:iiop://[host]:[port]/jndi/JMXConnector where host is the host name you are connecting to and port is RMI port number. If you have a default WebSphere installation, the JNDI port number will likely be 9100, depending on how many servers there are installed on one system and the specific one you want to connect to. To be sure, when starting WebSphere, check the logs, as it will dump a line like
0000000a RMIConnectorC A ADMC0026I: The RMI Connector is available at port 9100
You will also need to set on the classpath following jar files from WebSphere home directory: runtimes/com.ibm.ws.admin.client_8.5.0.jar
runtimes/com.ibm.ws.ejb.thinclient_8.5.0.jar
runtimes/com.ibm.ws.orb_8.5.0.jar
Possible Problems
• Default JMX mBean server uses RMI as a transport protocol. Sometimes RMI cannot connect remotely when one of peers uses Java version 1.6. Solution is quite easy, just set these two system properties:
-Djava.rmi.server.hostname=[hostname or IP address] -
Djava.net.preferIPv4Stack=true
Operations
For details about operations please see the JavaDoc of the MBean interface:
JMX API MBean JavaDoc is accessible in the running CloverETL Server instance on URL: http://[host]:[port]/
[contextPath]/javadoc-jmx/index.html
214
Chapter 25. API
SOAP WebService API
The CloverETL Server SOAP Web Service is an advanced API that provides an automation alternative to the
Simple HTTP API. While most of the HTTP API operations are available in the SOAP interface too (though not all of them), the SOAP API provides additional operations for manipulating sandboxes, monitoring, etc.
The SOAP API service is accessible on the following URL: http://[host]:[port]/clover/webservice
The SOAP API service descriptor is accessible on URL: http://[host]:[port]/clover/webservice?wsdl
Protocol HTTP can be changed to secured HTTPS based on the web server configuration.
SOAP WS Client
Exposed service is implemented with the most common binding style "document/literal", which is widely supported by libraries in various programming languages.
To create client for this API, only WSDL document (see the URL above) is needed together with some development tools according to your programming language and development environments.
JavaDoc of WebService interface with all related classes is accessible in the running CloverETL Server instance on URL http://[host]:[port]/[contextPath]/javadoc-ws/index.html
If the web server has HTTPS connector configured, also the client must meet the security requirements according to web server configuration. i.e. client trust + key stores configured properly
SOAP WS API Authentication/Authorization
Since exposed service is stateless, authentication "sessionToken" has to be passed as a parameter to each operation.
Client can obtain authentication sessionToken by calling "login" operation.
215
Chapter 25. API
Launch Services
Launch Services allow you to publish a transformation graph or a jobflow as a Web Service. With Launch Services,
CloverETL transformations can be exposed to provide request-response based data interface (e.g. searches, complex lookups, etc.) for other application or directly to users.
Launch Services Overview
The architecture of a Launch Service is layered. It follows the basic design of multi-tiered applications utilizing a web browser.
Launch services let you build a user-friendly form that the user fills in and sends to the CloverETL Server for processing.
Figure 25.3. Launch Services and CloverETL Server as web application back-end
Deploying Graph in Launch Service
To prepare a graph for publishing as a Launch Service, keep this in mind during the design process:
1. You can define a graph/jobflow listeners to create parameterized calls. Parameters are passed to the graph as
Dictionary entries – design the graph so that it uses the Dictionary as input/output for parameters (e.g. file names, search terms, etc.)
2. The graph will need to be published in the Launch Services section, where you provide the configuration and binding for parameters to dictionary entries.
Using Dictionary in ETL Graph/Jobflow for a Launch Services
A graph or a jobflow published as a service usually means that the caller sends request data (parameters or data) and the transformation processes it and returns back the results.
216
Chapter 25. API
In a Launch Service definition, you can bind service’s parameters to Dictionary entries. These need to be predefined in the transformation.
Dictionary is a key-value temporary data interface between the running transformation and the caller. Usually, although not restricted to, Dictionary is used to pass parameters in and out the executed transformation.
For more information about Dictionary, read the “Dictionary” section in the CloverETL Designer User’s Guide.
Passing Files to Launch Sevices
If Launch service is designed to pass an input file to a graph or jobflow, the input dictionary entry has to be of type readable.channel
.
Configuring the Job in CloverETL Server Web GUI
Each Launch Service configuration is identified by its name, user, and group restriction. You can create several configurations with the same name, which is valid as long as they differ in their user or group restrictions.
User restrictions can then be used to launch different jobs for different users, even though they use the same launch configuration (i.e. name). For example, developers may want to use a debug version of the job, while the end customers will want to use a production job. The user restriction can also be used to prohibit certain users from executing the launch configuration completely.
Similarly, a group restriction can be used to differentiate jobs based on the user’s group membership.
If multiple configurations match the current user/group and configuration name, the most specific one is picked.
(The user name has higher priority than the group name.)
Adding New Launch Configuration
Use the “New launch configuration” button on the Launch Services tab to create a new Launch Service.
Figure 25.4. Launch Services section
The name is the identifier for the service and will be used in the service URL. Then, select a sandbox and either a transformation graph or a jobflow that you want to publish.
217
Chapter 25. API
Figure 25.5. Creating a new launch configuration
Once you create the new Launch Service, you can set additional attributes like:
1. User and group access restrictions and additional configuration options (Edit Configuration)
2. Bind Launch Service parameters to Dictionary entries (Edit Parameters)
Figure 25.6. Overview tab
The Overview tab shows the basic details about the launch configuration. These can be modified in the Edit
Configuration tab:
218
Edit Configuration
Chapter 25. API
Figure 25.7. Edit Configuration tab
Editing configurations:
• Name - The name (identifier) under which the configuration will be accessible from the web.
• Description - The description of the configuration.
• Group - Restricts the configuration to a specific group of users.
• User - Restricts the configuration to a specified user.
• Sandbox - The CloverETL Sandbox where the configuration will be launched.
• Job file - Selects the job to run.
• Save run record - If checked, the details about the launch configuration will be stored in the Execution History.
Uncheck this if you need to increase performance – storing a run record decreases response times for high frequency calls.
• Display error message detail - Check this if you want to get a verbose message in case the launch fails.
Edit Parameters
The “Edit parameters” tab can be used to configure parameter mappings for the launch configuration. The mappings are required for the Launch Service to be able to correctly assign parameters values based on the values sent in the launch request.
219
Chapter 25. API
Figure 25.8. Creating new parameter
To add a new parameter binding, click on the “Add parameter” button. Every required a graph/jobflow listenerproperty defined by the job needs to be created here.
Figure 25.9. Edit Parameters tab
You can set the following fields for each property:
• Dictionary entry name - The name of the Dictionary entry defined in the graph/jobflow that you want to bind.
220
Chapter 25. API
• HTTP request parameter name - The name of this property as it will be visible in the published service. This name can be different from Name.
• HTTP request parameter required - If checked, the parameter is mandatory and an error will be reported if it’s omitted.
• Pass HTTP request body - If checked, the request body is set to dictionary entry as readable channel.
• Pass value as graph parameter - If checked, the property value will be passed to the job also as a parameter
(${ParameterName}, where ParameterName is equal to Name). This lets you use the parameter anywhere in the job definition (not just places that support Dictionary). However, parameters are evaluated during job initialization. Thus, such a job cannot be pooled which decreases performance for high frequency repetitive calls to the service. In this case, consider redesigning the transformation to use Dictionary instead, allowing for pooling.
• Default parameter value - The default value applied in case the parameter is omitted in the launch request.
Launch Services Authentication
If you are using launch services, you have two ways how to be logged in: using form-based authentication of
Server console or HTTP basic authentication of Launch services.
The form-based authentication of Server console enables user to create or modify Launch services. If you are logged in this way, you act as an administrator of Launch services.
To insert data into the Launch service form you should be logged in using HTTP basic authentication. Follow the link to the Launch service form and web browser will request your credentials. If you are logged in using HTTPbasic authentication you act as an user of Launch services forms.
Sending the Data to Launch Service
A launch request can be sent via HTTP GET or POST methods. A launch request is simply a URL which contains the values of all parameters that should be passed to the job. The request URL is composed of several parts:
(You can use a Launch Services test page, accessible from the login screen, to test drive Launch Services.)
[Clover Context]/launch/[Configuration name]?[Parameters]
•
[Clover Context]
is the URL to the context in which the CloverETL Server is running. Usually this is the full URL to the CloverETL Server (for example, for CloverETL Demo Server this would be http://serverdemo.cloveretl.com:8080/clover).
•
[Configuration name]
is the name of the launch configuration specified when the configuration was created. In our example, this would be set to “mountains” (case-sensitive).
•
[Parameters]
is the list of parameters the configuration requires as a query string. It’s a URL-encoded [RFC
1738] list of name=value pairs separated by the "&" character.
Based on the above, the full URL of a launch request for our example with mountains may look like this: http:// server-demo.cloveretl.com:8080/clover/launch/NewMountains?heightMin=4000. In the request above, the value of heightMin property is set to 4000.
Results of the Graph Execution
After the job terminates, the results are sent back to the HTTP client as content of an HTTP response.
Output parameters are defined in the job’s Dictionary. Every Dictionary entry marked as “Output” is sent back as a part of the response.
221
Chapter 25. API
Depending on the number of output parameters, the following output is sent to the HTTP client:
• No output parameters - Only a summary page is returned. The page contains: when the job was started, when it finished, the user name, and so on. The format of the summary page cannot be customized.
• One output parameter - In this case, the output is sent to the client as in the body of the HTTP response with its MIME content type defined by the property type in Dictionary.
• Multiple output parameters - In this case, each output parameter is sent to the HTTP client as part of the multipart HTTP response. The content type of the response is either multipart/related or multipart/x-mixedreplace, depending on the HTTP client (the client detection is fully automatic). The multipart/related type is used for browsers based on Microsoft Internet Explorer and the multipart/x-mixed-replace is sent to browsers based on Gecko or Webkit.
Launch requests are recorded in the log files in the directory specified by the launch.log.dir
property in the CloverETL Server configuration. For each launch configuration, one log file named [Configuration name]#[Launch ID].log is created. For each launch request, this file will contain only one line with following tabdelimited fields:
(If the property launch.log.dir
is not specified, log files are created in the temp directory
[java.io.tmpdir]/cloverlog/launch
where "java.io.tmpdir" is system property)
• Launch start time
• Launch end time
• Logged-in user name
• Run ID
• Execution status FINISHED_OK, ERROR or ABORTED
• IP Address of the client
• User agent of the HTTP client
• Query string passed to the Launch Service (full list of parameters of the current launch)
In the case that the configuration is not valid, the same launch details are saved into the
_no_launch_config.log
file in the same directory. All unauthenticated requests are saved to the same file as well.
222
Chapter 25. API
CloverETL Server API Extensibility
The CloverETL Server implements extensibility of its APIs, so the Server may expose additional features with a custom API.
Groovy Code API
Since 3.3
The CloverETL Server Groovy Code API allows clients to execute Groovy code stored on the Server by an HTTP request. Executed code has access to the ServerFacade, instance HTTP request and HTTP response, so it's possible to implement a custom CloverETL Server API in the Groovy code.
To execute the code, call URL: http://[host]:[port]/clover/groovy/[sandboxCode]/[pathToGroovyCodeFile]
The HTTP protocol can be changed to secured HTTPS according to the web server configuration.
The Server uses Basic or Digest authentication according to the configuration. So, the user must be authorized and must have permission to execute in the specified sandbox and permission to call "Groovy Code API".
Important
Note that permission to call "Groovy Code API" (and edit them) is a very strong permission, since the Groovy Code can basically do the same as Java code and it runs as the same system process as a whole application container.
See also Groovy Code API permission (p. 110).
Variables Accessible in the Groovy Code
By default, these variables are accessible to the Groovy code
Table 25.15. Variables accessible in groovy code
type key description
com.cloveretl.server.config.CloverConfiguration
configuration javax.servlet.ServletContext
Provides configuration values for CloverETL
Server.
servletContext Instance of ServletContext. Defines a set of methods that a servlet uses to communicate with its servlet container.
com.cloveretl.server.api.ServerFacade
serverFacade Instance of serverFacade usable for calling
CloverETL Server core features.
String
WAR file contains JavaDoc of facade API and it is accessible on URL: http://host:port/clover/ javadoc/index.html
sessionToken sessionToken, needed for calling serverFacade methods
Code Examples
The following script returns String, so the underlying servlet puts the string to the output. The advantage of this approach is that in case of any error during code processing, the servlet returns a full stacktrace, so the script may be fixed. However, the constructed output may consume some memory.
223
Chapter 25. API
String output = "write anything to the output"; return output;
The following script is little more complex. It returns XML with a list of all configured schedules. You need to have permission to list the schedules.
// uses variables: sessionToken, serverFacade import java.io.*; import java.util.*; import javax.xml.bind.*; import com.cloveretl.server.facade.api.*; import com.cloveretl.server.persistent.*; import com.cloveretl.server.persistent.jaxb.*;
Response<List<Schedule>> list = serverFacade.findScheduleList(sessionToken, null);
JAXBContext jc = JAXBContext.newInstance( "com.cloveretl.server.persistent:com.cloveretl.server.persistent.jaxb" );
Marshaller m = jc.createMarshaller(); m.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); m.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "/clover/schemas/cs.xsd");
SchedulesList xmlList = new SchedulesList(); xmlList.setSchedulesList(list.getBean());
StringWriter writer = new StringWriter(); m.marshal(xmlList, writer); return writer.toString();
224
Chapter 26. Recommendations for Transformations
Developers
Add external libraries to app-server classpath
Connections (JDBC/JMS) may require third-party libraries. We strongly recommended adding these libraries to the app-server classpath.
CloverETL allows you to specify these libraries directly in a graph definition so that CloverETL can load these libraries dynamically. However, external libraries may cause memory leak, resulting in
"java.lang.OutOfMemoryError: PermGen space" in this case.
In addition, app-servers should have the JMS API on their classpath – and the third-party libraries often bundle this API as well. So it may result in classloading conflicts if these libraries are not loaded by the same classloader.
Another graphs executed by RunGraph component may be executed only in the same JVM instance
In the server environment, all graphs are executed in the same VM instance. The attribute "same instance" of the
RunGraph component cannot be set to false.
225
Chapter 27. Extensibility - CloverETL Engine Plugins
Since 3.1.2
The CloverETL Server can use external engine plugins loaded from a specified source. The source is specified by engine.plugins.additional.src
config property.
See details about the possibilities with CloverETL configuration in Part III, “ Configuration
This property must be the absolute path to the directory or zip file with additional CloverETL engine plugins. Both the directory and zip must contain a subdirectory for each plugin. These plugins are not a substitute for plugins packed in a WAR file. Changes in the directory or the ZIP file apply only when the server is restarted.
Each plugin has its own class-loader that uses a parent-first strategy by default. The parent of plugins' classloaders is web-app classloader (content of [WAR]/WEB-INF/lib). If the plugin uses any third-party libraries, there may be some conflict with libraries on parent-classloaders classpath. These are common exceptions/errors suggesting that there is something wrong with classloading:
• java.lang.ClassCastException
• java.lang.ClassNotFoundException
• java.lang.NoClassDefFoundError
• java.lang.LinkageError
There are a couple of ways you can get rid of such conflicts:
• Remove your conflicting third-party libraries and use libraries on parent classloaders (web-app or app-server classloaders)
• Use a different class-loading strategy for your plugin.
• In the plugin descriptor plugin.xml, set attribute greedyClassLoader="true" in the element "plugin"
• It means that the plugin classloader will use a self-first strategy
• Set an inverse class-loading strategy for selected Java packages.
• In the plugin descriptor plugin.xml, set attribute "excludedPackages" in the element "plugin".
• It's a comma-separated list of package prefixes – like this, for example: excludedPackages="some.java.package,some.another.package"
• In the previous example, all classes from "some.java.package", "some.another.package" and all their subpackages would be loaded with the inverse loading strategy, then the rest of classes on the plugins classpath.
The suggestions above may be combined. It's not easy to find the best solution for these conflicts and it may depend on the libraries on app-server classpath.
For more convenient debugging, it’s useful to set TRACE log level for related class-loaders.
<logger name="org.jetel.util.classloader.GreedyURLClassLoader">
<level value="trace"/>
</logger>
<logger name="org.jetel.plugin.PluginClassLoader">
<level value="trace"/>
</logger>
See Chapter 11, Logging (p. 80) for details about overriding a server log4j configuration.
226
Chapter 28. Troubleshooting
Graph hangs and is un-killable
Graph can sometimes hang and be un-killable if some network connection in it hangs. This can be improved by setting a shorter tcp-keepalive so that the connection times out earlier. The default value on Linux is 2 hours (7,200 seconds). You can set it to 10 minutes (600 seconds).
See http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/usingkeepalive.html on tcp-timeout in Linux.
The file descriptor can be closed manually using gdb
. See http://stackoverflow.com/questions/5987820/how-toclose-file-descriptor-via-linux-shell-command/12058001#12058001.
SSL/TLS Issues
Java 7 and HTTPS
There may be issues when using Java 7 and HTTPS-based communication. There are servers that do not support TLS 1.0 (Transport Layer Security) protocol anymore and the Java 7 does not support newer versions of the TLS by default. To activate newer versions of the TLS protocol, user has to specify the system property https.protocols
and set the value to
TLSv1,TLSv1.1,TLSv1.2
. Consult section on Enterprise
Server (p. 11) to find out how to set the system property on particular application server.
SSL-related Failures on WebLogic 12
Certain graphs using SSL-encrypted connections may fail on WebLogic 12 due to damaged library distributed with this application server. The issue can be identified by a SHA-1 digest error in the graph execution stacktrace:
...
Caused by: java.io.IOException: Could not convert socket to TLS
at com.sun.mail.pop3.Protocol.stls(Protocol.java:659)
at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:269)
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:207)
Caused by: javax.net.ssl.SSLException: java.lang.SecurityException:
SHA1 digest error for org/bouncycastle/jce/provider/JCEECPublicKey.class
...
To fix the issue, replace the library
[MW_HOME]/oracle_common/modules/bcprovjdk16-1.45.jar
with the one downloaded directly from Bouncy Castle home page. Restart of the application server is required to load the new library.
227
Part VI. Cluster
Chapter 29. Clustering Features
There are two common Cluster features: high availability and scalability. Both are implemented by the CloverETL
Server on different levels. This section should clarify the basics of CloverETL Clustering.
The CloverETL Server only works in the Cluster if your license allows it.
High Availability
CloverETL Server does not recognize any differences between cluster nodes. Thus, there are no "master" or "slave" nodes meaning all nodes can be virtually equal. There is no single point of failure (SPOF) in the CloverETL cluster itself, however SPOFs may be in the input data or some other external element.
Clustering offers high availability (HA) for all features accessible through HTTP, for event listeners and scheduling. Regarding the HTTP accessible features: it includes sandbox browsing, modification of services configuration (scheduling, launch services, listeners) and primarily job executions. Any cluster node may accept incoming HTTP requests and process them itself or delegate it to another node.
Since all nodes are typically equal, almost all requests may be processed by any cluster node:
• All job files, metadata files, etc. are located in shared sandboxes. Thus all nodes have access to them. A shared filesystem may be a SPOF, thus it is recommended to use a replicated filesystem instead.
• The database is shared by all cluster nodes. Again, a shared DB might be a SPOF, however it may be clustered as well.
But there is still a possibility, that a node itself cannot process a request. In such cases, it completely and transparently delegates the request to a node which can process the request.
These are the requests which are limited to one (or more) specific node(s):
• a request for the content of a partitioned or local sandbox. These sandboxes aren't shared among all cluster nodes. Please note that this request may come to any cluster node which then delegates it transparently to a target node, however, this target node must be up and running.
• A job is configured to use a partitioned or local sandbox. These jobs need nodes which have a physical access to the required sandboxes.
• A job has allocation specified by specific cluster nodes. Concept of "allocation" is described in the following sections.
Thus an inaccessible cluster node may cause a failure of the request, so if it's possible, it's better to avoid using specific cluster nodes or resources accessible only by specific cluster node.
CloverETL itself implements a load balancer for executing jobs. So a job which isn't configured for some specific node(s) may be executed anywhere in the cluster and the CloverETL load balancer decides, according to the request and current load, which node will process the job. All this is done transparently for the client side.
To achieve HA, it is recommended to use an independent HTTP load balancer. Independent HTTP load balancers allow transparent fail-overs for HTTP requests. They send requests to the nodes which are running.
Scalability
There are two independent levels of scalability implemented. Scalability of transformation requests (and any HTTP requests) and data scalability (parallel data processing).
Both of these "scalability levels" are "horizontal". Horizontal scalability means adding nodes to the cluster, whereas vertical scalability means adding resources to a single node. Vertical scalability is supported natively by the
CloverETL engine and it is not described here.
229
Chapter 29. Clustering Features
Transformation Requests
Basically, the more nodes we have in the cluster, the more transformation requests (or HTTP requests in general) we can process at one time. This type of scalability is the CloverETL server's ability to support a growing number of clients. This feature is closely related to the use of an HTTP load balancer which is mentioned in the previous section.
Parallel Data Processing
This type of scalability is currently only available for ETL graphs. Jobflow and Profiler jobs can't run in parallel.
When a transformation is processed in parallel, the whole graph (or its parts) runs in parallel on multiple cluster nodes having each node process just a part of the data.
So the more nodes we have in the cluster, the more data can be processed in the specified time.
The data may be split (partitioned) before the graph execution or by the graph itself on the fly. The resulting data may be stored in partitions or gathered and stored as one group of data.
The curve of scalability may differ according to the type of transformation. It may be almost linear, which is almost always ideal, except when there is a single data source which cannot be read by multiple readers in parallel limiting the speed of further data transformation. In such cases it is not beneficial to have parallel data processing since it would actually wait for input data.
ETL Graph Allocation
Each ETL graph executed in cluster environment is automatically subjected to transformation analysis. The main goal of this analysis is to find so called ETL graph allocation. The graph allocation is set of instructions for cluster environment how the transformation should be executed. For better understanding how the parallel data processing works, it is necessary to get deeper information about the graph analysis and resulted allocation.
First of all, analysis needs to find allocation for each individual component. The component allocation is set of cluster nodes where the component should be running. There are several ways how the component allocation can be specified, see following section of the documentation. But important information for now is, that a component can be requested to run in multiple instances - that is necessary for parallel data processing. Next step of analysis is to find optimal graph decomposition to ensure all component allocation will be satisfied and tries to minimise number of remote edges between graph instances.
Resulted analysis says how many instances (workers) of the graph needs to be executed, on which cluster nodes these instances will be running and which components will be present in the instances. In other words, one executed graph can be running in many instances, each instance can be processed on an arbitrary cluster node and moreover each instance contains only convenient components.
Figure 29.1. Component allocations example
This figure shows a sample graph with a few components with various component allocations. First component
FlatFileReader requests to be executed on node1, the following Reformat component should be running on cluster node2, the ParallelPartition component is a special component which makes possible to change cardinality of allocation of two interconnected components (detailed description of cluster partitioning and gathering follows this section). FlatFileWriter, the last component, requires to be executed right on three cluster nodes node1, node2 and node3. Visualisation of transformation analysis shows the following figure. Three workers (graphs) will be executed, each on a different cluster node (which is not necessary, even multiple workers can be associated with a
230
Chapter 29. Clustering Features single node). Worker on cluster node1 contains only FlatFileReader and first of three instances of FlatFileWriter component. Both components are connected by remote edges with components, which are running on node2. The worker running on node3 contains only FlatFileWriter fed by data remotely transferred from ParallelPartitioner running on node2.
Figure 29.2. Graph decomposition based on component allocations
Component Allocation
Allocation of a single component can be derived in several ways (list is ordered according priority):
• Explicit definition - all components have common attribute Allocation. CloverETL Designer allows user to use convenient dialog.
Figure 29.3. Component allocation dialog
Three different approaches are available for explicit allocation definition:
• Allocation based on number of workers - component will be executed in requested instances on some cluster nodes, which are preferred by CloverETL Cluster. Server can use build-in loadbalancing algorithm to ensure fastest data processing.
• Allocation based on reference on a partitioned sandbox - component allocation corresponds with locations of given partitioned sandbox. Each partitioned sandbox has a list of locations, each bound to specific cluster node. Thus allocation would be equivalent to list of locations. See "Partitioned sandbox" in
Local Sandboxes (p. 232) for details.
• allocation defined by a list of cluster node identifiers (a single cluster node can be used more times)
• Reference to a partitioned sandbox FlatFileReader, FlatFileWriter and ParallelReader components derives theirs allocation from fileURL attribute. In case the URL refers to a file in a partitioned sandbox, the component
231
Chapter 29. Clustering Features allocation is automatically derived from locations of the partitioned sandbox. So in case you manipulate with one of these components with a file in partitioned sandbox suitable allocation is used automatically.
• Adoption from neighbour components By default, allocation is inherited from neighbour components.
Components on the left side have higher priority. Cluster partitioners and cluster gathers are nature bounds for recursive allocation inheritance.
Partitioning/Gathering Data
As mentioned before, data may be partitioned and gathered in multiple ways. It may be prepared before the graph is executed or it may be partitioned on the fly.
Partitioning/gathering "on the fly"
There are six special components to consider: ParallelPartition, ParallelLoadBalancingPartition,
ParallelSimpleCopy, ParallelSimpleGather, ParallelMerge and ParallelRepartition. All the components work similarly to their non-cluster variation. But their splitting or gathering nature is used to change data flow allocation, so they may be used to change distribution of the data among workers.
ParallelPartition and ParallelLoadBalancingPartition work similar to a common partitioner, they change the data allocation from 1 to N. Component preceding the ParallelPartitioner run on just one node, whereas component behind the ParallelPartitioner run in parallel according to node allocation. ParallelSimpleCopy component can be use in similar locations. This component does not distribute the data records, but copies them to all output workers.
ParallelGather and ParallelMerge work in the opposite way. They change the data allocation from N to 1.
Component preceding the gather/merge run in parallel while component behind the gather run on just one node.
Partitioning/gathering data by external tools
Partitioning data on the fly may in some cases be an unnecessary bottleneck. Splitting data using low-level tools can be much better for scalability. The optimal case being, that each running worker reads data from an independent data source. Thus there does not have to be a ParallelPartitioner component and the graph runs in parallel from the beginning.
Or the whole graph may run in parallel, however the results would be partitioned.
Node Allocation Limitations
As described above, each component may have its own node allocation specified which may result in some conflicts.
• Node allocation of neighbouring components must have the same cardinality. So it doesn't have to be the same allocation, but the cardinality must be the same. E.g. There is an ETL graph with 2 components:
DataGenerator and Trash. DataGenerator allocated on NodeA sending data to Trash allocated on NodeB works fine. DataGenerator allocated on NodeA sending data to Trash allocated on NodeA and NodeB fails.
• Node allocation behind the ParallelGather and ParallelMerge must have cardinality 1. So it may be of any allocation, but the cardinality must be just 1.
• Node allocation of components in front of the ParallelPartition, ParallelLoadBalancingPartition and
ParallelSimpleCopy must have cardinality 1.
Partitioned and Local Sandboxes
Partitioned and local sandboxes were mentioned in previous sections. These new sandbox types were introduced in version 3.0 and they are vital for parallel data processing.
Together with shared sandboxes, we have three sandbox types in total.
Shared sandbox
232
Chapter 29. Clustering Features
This type of sandbox must be used for all data which is supposed to be accessible on all cluster nodes. This includes all graphs, jobflows, metadata, connections, classes and input/output data for graphs which should support HA, as described above. All shared sandboxes reside in the directory, which must be properly shared among all cluster nodes. You can use suitable sharing/replicating tool according to the operating system and filesystem.
Figure 29.4. Dialog form for creating new shared sandbox
As you can see in the screenshot above, you can specify the root path on the filesystem and you can use placeholders or absolute path. Placeholders available are environment variables, system properties or CloverETL Server config property intended for this use sandboxes.home
. Default path is set as
[user.data.home]/CloverETL/ sandboxes/[sandboxID]
where the sandboxID
is ID specified by the user. The user.data.home
placeholder refers to the home directory of the user running the Java Virtual Machine process (
/home
subdirectory on Unix-like OS); it is determined as first writable directory selected from following values:
•
USERPROFILE
environment variable on Windows OS
• user.home
system property (user home directory)
• user.dir
system property (JVM process working directory)
• java.io.tmpdir
system property (JVM process temporary directory)
Note that the path must be valid on all cluster nodes. Not just nodes currently connected to the cluster, but also on the nodes that may be connected later. Thus when the placeholders are resolved on the node, the path must exist on the node and it must be readable/writable for the JVM process.
Local sandbox
This sandbox type is intended for data, which is accessible only by certain cluster nodes. It may include massive input/output files. The purpose being, that any cluster node may access content of this type of sandbox, but only one has local (fast) access and this node must be up and running to provide data. The graph may use resources from multiple sandboxes which are physically stored on different nodes since cluster nodes are able to create network streams transparently as if the resource were a local file. See
Using a Sandbox Resource as a Component Data
Do not use local sandbox for common project data (graphs, metadata, connections, lookups, properties files, etc.).
It would cause odd behaviour. Use shared sandboxes instead.
Figure 29.5. Dialog form for creating a new local sandbox
233
Chapter 29. Clustering Features
Sandbox location path is pre-filled with sandboxes.home.local
placeholder which by default points to the
[user.data.home]/CloverETL/sandboxes-local
. The placeholder can be configured as any other
CloverETL configuration property.
Partitioned sandbox
This type of sandbox is actually an abstract wrapper for a couple of physical locations existing typically on different cluster nodes. However, there may be multiple locations on the same node. A partitioned sandbox has two purposes which are both closely related to parallel data processing.
1. node allocation specification - locations of a partitioned sandbox define the workers which will run the graph or its parts. So each physical location will cause a single worker to run. This worker does not have to actually store any data to "its" location. It is just a way to tell the CloverETL Server: "execute this part of ETL graph in parallel on these nodes"
2. storage for part of the data during parallel data processing. Each physical location contains only part of the data. In a typical use, we have input data split in more input files, so we put each file into a different location and each worker processes its own file.
Figure 29.6. Dialog form for creating new local sandbox
As you can see on the screenshot above, for a partitioned sandbox, you can specify one or more physical locations on different cluster nodes.
Sandbox location path is pre-filled with sandboxes.home.partitioned
placeholder which by default points to the
[user.data.home]/CloverETL/sandboxes-paritioned
. Anyway the sandboxes.home.partitioned
config property may be configured as any other CloverETL Server configuration property. Note that directory must be readable/writable for the user running JVM process.
Do not use partitioned sandbox for common project data (graphs, metadata, connections, lookups, properties files, etc.). It would cause odd behavior. Use shared sandboxes instead.
Using a Sandbox Resource as a Component Data Source
A sandbox resource, whether it is a shared, local or partitioned sandbox (or ordinary sandbox on standalone server), is specified in the graph under the fileURL attributes as a so called sandbox URL like this: sandbox://data/path/to/file/file.dat
where "data" is a code for the sandbox and "path/to/file/file.dat" is the path to the resource from the sandbox root. URL is evaluated by CloverETL Server during job execution and a component (reader or writer) obtains the opened stream from the server. This may be a stream to a local file or to some other remote resource. Thus, a job does not have to run on the node which has local access to the resource. There may be more sandbox resources used in the job and each of them may be on a different node.
The sandbox URL has a specific use for parallel data processing. When the sandbox URL with the resource in a partitioned sandbox is used, that part of the graph/phase runs in parallel, according to the node allocation specified by the list of partitioned sandbox locations. Thus, each worker has it is own local sandbox resource.
234
Chapter 29. Clustering Features
CloverETL Server evaluates the sandbox URL on each worker and provides an open stream to a local resource to the component.
The sandbox URL may be used on standalone server as well. It is excellent choice when graph references some resources from different sandboxes. It may be metadata, lookup definition or input/output data. Of course, referenced sandbox must be accessible for the user who executes the graph.
235
Chapter 29. Clustering Features
Graph Allocation Examples
Basic component allocation
This example shows two component graph, where allocation ensures that the first component will be executed on cluster node1 and the second component will be executed on cluster node2.
Basic component allocation with remote data transfer
Two components connected with an edge can have different allocation. The first is executed on node1 and the second is executed on node2. Cluster environment automatically ensures remote data records transfer.
Multiple execution
Graph with multiple node allocation is executed in parallel. In this example both components have same allocation, so three identical transformation will be executed on cluster node1, node2 and node3.
Cluster data partitioning
Graph with two allocations. First component has a single node allocation, which is not specified and is automatically derived to ensure minimal number of remote edges. The ParallelPartition component distribute records for further data processing on cluster node1, node2 and node3.
Cluster data gathering
Graph with two allocations. Resulted data records of parallel data processing in the first component are collected in ClusterGather component and passed to cluster node4 for further single node processing.
236
Chapter 29. Clustering Features
Example of Distributed Execution
The following diagram shows a transformation graph used for parsing invoices generated by a few cell phone network providers in Czech Republic.
The size of these input files may be up to a few gigabytes, so it is very beneficial to design the graph to work in the cluster environment.
Details of the Example Transformation Design
Please note there are four cluster components in the graph and these components define a point of change "node allocation", so the part of the graph demarcated by these components is highlighted by the red rectangle. Allocation of these component should be performed in parallel. This means that the components inside the dotted rectangle should have convenient allocation. The rest of the graph runs just on single node.
Specification of "node allocation"
There are 2 node allocations used in the graph:
• node allocation for components running in parallel (demarcated by the four cluster components)
• node allocation for outer part of the graph which run on a single node
The single node is specified by the sandbox code used in the URLs of input data. The following dialog shows the File URL value: "sandbox://data/path-to-csv-file", where "data" is the ID of the server sandbox containing the specified file. And it is the "data" local sandbox which defines the single node.
237
Chapter 29. Clustering Features
The part of the graph demarcated by the four cluster components may have specified its allocation by the file
URL attribute as well, but this part does not work with files at all, so there is no file URL. Thus, we will use the
"node allocation" attribute. Since components may adopt the allocation from their neighbours, it is sufficient to set it only for one component.
Again, "dataPartitioned" in the following dialog is the sandbox ID.
Let's investigate our sandboxes. This project requires 3 sandboxes: "data", "dataPartitioned" and
"PhoneChargesDistributed".
• data
• contains input and output data
• local sandbox (yellow folder), so it has only one physical location
• accessible only on node "i-4cc9733b" in the specified path
• dataPartitioned
• partitioned sandbox (red folder), so it has a list of physical locations on different nodes
238
Chapter 29. Clustering Features
• does not contain any data and since the graph does not read or write to this sandbox, it is used only for the definition of "nodes allocation"
• on the following figure, allocation is configured for two cluster nodes
• PhoneChargesDistributed
• common sandbox containing the graph file, metadata, and connections
• shared sandbox (blue folder), so all cluster nodes have access to the same files
If the graph was executed with the sandbox configuration of the previous figure, the node allocation would be:
• components which run only on single node, will run only on the "i-4cc9733b" node according to the "data" sandbox location.
• components with allocation according to the "dataPartitioned" sandbox will run on nodes "i-4cc9733b" and
"i-52d05425".
239
Chapter 29. Clustering Features
Scalability of the Example Transformation
The example transformation has been tested in the Amazon Cloud environment with the following conditions for all executions:
• the same master node
• the same input data: 1.2 GB of input data, 27 million records
• three executions for each "node allocation"
• "node allocation" changed between every 2 executions
• all nodes has been of "c1.medium" type
We tested "node allocation" cardinality from 1 single node, all the way up to 8 nodes.
The following figure shows the functional dependence of run-time on the number of nodes in the cluster:
Figure 29.7. Cluster Scalability
The following figure shows the dependency of "speedup factor" on the number of nodes in the cluster. The speedup factor is the ratio of the average runtime with one cluster node and the average runtime with x cluster nodes. Thus: speedupFactor = avgRuntime(1 node) / avgRuntime(x nodes)
We can see, that the results are favourable up to 4 nodes. Each additional node still improves cluster performance, however the effect of the improvement decreases. Nine or more nodes in the cluster may even have a negative effect because their benefit for performance may be lost in the overhead with the management of these nodes.
These results are specific for each transformation, there may be a transformation with much a better or possibly worse function curve.
Table of measured runtimes:
Figure 29.8. Speedup factor
240
Chapter 29. Clustering Features
7
8
5
6
3
4
1
2
nodes
208
181
168
172
861
467
317
236
runtime 1 [s]
204
182
168
159
861
465
319
233
runtime 2 [s]
204
182
168
162
861
466
314
233
runtime 3 [s]
861
466
average runtime [s]
316.67
234
205.33
181.67
168
164.33
speedup factor
4.19
4.74
5.13
5.24
1
1.85
2.72
3.68
241
Chapter 30. Cluster Configuration
Cluster can work properly only if each node is properly configured. Clustering must be enabled, nodeID must be unique on each node, all nodes must have access to shared DB (direct connection or proxied by another cluster node) and shared sandboxes, and all properties for inter-node cooperation must be set according to network environment.
Properties and possible configuration are the following:
•
•
•
Example of 2 Node Cluster Configuration (p. 248)
•
Jobs Load Balancing Properties (p. 251)
242
Chapter 30. Cluster Configuration
Mandatory Properties
Besides mandatory cluster properties, you need to set other necessary properties which are not specifically related to the cluster environment. Database connection must be also configured, however besides direct connection it's alternatively possible to configure proxing using another cluster node/nodes. See property
Mandatory properties - these properties must be properly set on each node of the cluster cluster.enabled
Switch whether the server shall start in the standalone or cluster node mode. The property isn't set at all (empty value) by default, which means, that the mode is chosen according to the loaded license. It's strongly recommended to set the property to "true" if also the other cluster properties are configured. Thus the cluster node will be initialized regardless the license.
cluster.node.id
cluster.jgroups.bind_address
type: boolean
Each cluster node must have unique ID.
type: String default: node01
IP address of ethernet interface, which is used for communication with another cluster nodes. Necessary for inter-node messaging.
cluster.jgroups.start_port
cluster.http.url
type: String, IP address default: 127.0.0.1
Port where jGroups server listens for inter-node messages.
type: int, port default: 7800
URL of the CloverETL cluster node. It must be HTTP/HTTPS URL to the root of a web application, thus typically it would be "http://
[hostname]:[port]/clover". Primarily it's used for synchronous inter-node communication from other cluster nodes. It's recommended to use a fully qualified hostname or IP address, so it's accessible from client browser or
CloverETL Designer.
type: String, URL default: http://localhost:8080/clover
Following property must be set only when the node uses "remote" DB datasource (See property
(p. 247) for details). When the node doesn't have the direct DB connection, it can't
interchange some config data with other nodes, so it's necessary to configure them explicitly.
Mandatory property for remote DB datasource access
cluster.jgroups.tcpping.initial_hosts List of IP addresses (with ports) where we expect running and listening nodes. It is related to another nodes "bind_address" and "start_port" properties. I.e. like this: bind_address1[start_port1],bind_address2[start_port2],... It is not necessary to list all nodes of the cluster, but at least one of listed host:port must be running. Necessary for inter-node messaging.
243
Chapter 30. Cluster Configuration type: String, in format: "IPaddress1[port1],IPaddress2[port2]" default: 127.0.0.1[7800]
244
Chapter 30. Cluster Configuration
Optional Properties
Optional properties - these properties aren't vital for cluster configuration - default values are sufficient cluster.jgroups.external_address
IP address of the cluster node. Configure this only if the cluster nodes are on the different sub-nets, so IP address of the network interface isn't directly accessible from the other cluster nodes.
cluster.jgroups.external_port
type: String, IP address
Port for asynchronous messaging. Configure this only if the cluster nodes are on the different sub-nets, and port opened on the IP address is different then port opened on the node's network interface IP address.
type: int, port
cluster.jgroups.protocol.NAKACK.gc_lag
Number of delivered messages kept in the "sent messages buffer" of each jGroups view member. Messages are kept in sender cache even though they were reported as delivered by existing view members, because there may be some other member temporarily not in the view. The higher the number, the higher chance of reliable messages delivery in unreliable network environment. However the messages consume memory: aproximatelly 4kB for each message.
type: int default: 10000
cluster.jgroups.protocol.NAKACK.xmit_table_obsolete_member_timeout
How long we keep obsolete member in the xmit-table. Time in millis.
It's neccessary to recognition of member temporarily unaccessible and removed from the view. With previous NAKACK implementation, the member removed from the view was also automatically removed from xmit-table, so it appeared as new member when it re-joined the view. With current modified implementation the member is kept in the xmit-table for configured interval longer, so when it re-joins the view, it's known member and undelivered messages may be re-delivered to it. Member in the xmittable isn't consuming memory.
type: long default: 3600000
cluster.jgroups.protocol.AUTH.value
sandboxes.home.partitioned
String used by jgroups member to authenticate to the group. Must be the same on all cluster nodes. Its protection against fake messages.
type: String
This property is intended to be used as placeholder in the location path of partitioned sandboxes. So the sandbox path is specified with the placeholder and it's resolved to the real path just before it's used. The default value uses configuration property "user.data.home" which points to the home directory
245
Chapter 30. Cluster Configuration
sandboxes.home.local
cluster.shared_sandboxes_path
of the user which runs the JVM process. Directory depends on the OS. On unix-like systems it's typically /home/[username] type: String default: ${user.data.home}/CloverETL/sandboxes-partitioned
This property is intended to be used as placeholder in the location path of local sandboxes. So the sandbox path is specified with the placeholder and it's resolved to the real path just before it's used. The default value uses
"user.data.home" configuration property which points to the home directory of the user which runs the JVM process. The directory location depends on the OS. On Unix-like systems it's typically /home/[username] type: String default: ${user.data.home}/CloverETL/sandboxes-local
This property is deprecated. This property still works but it's used only when shared sandbox doesn't have it's own path specified. It's just for backward compatibility and it's not recommended for new deployments.
Since 3.5 it's recommended to specify sandbox path explicitly and use
"sandboxes.home" property/placeholder.
type: String
cluster.node.sendinfo.interval
time interval in ms; each node sends heart-beat with info about itself to another nodes; this interval specifies how often the info is sent under common circumstances type: int default: 2000
cluster.node.sendinfo.cluster.node.sendinfo.min_interval
time interval in ms; Specified minimum interval between two heart-beats. Heart-beat may be send more often then specified by cluster.node.sendinfo.interval, e.g. when jobs start or finish. However the interval will never be shorter then this minimum.
type: int default: 500
cluster.node.sendinfo.history.interval
time interval in ms, for which each node stores heart-beat in the memory;
It's used for rendering figures in the web GUI-monitoring section type: int default: 240000 (4 minutes)
cluster.node.remove.interval
time interval in ms; if no node info comes in this interval, the node is considered as lost and it is removed from the cluster type: int default: 50000
cluster.max_allowed_time_shift_between_nodes
246
Chapter 30. Cluster Configuration
cluster.group.name
Max allowed time shift between nodes. All nodes must have system time synchronized. Otherwise cluster may not work properly. So if this threshold is exceeded, node will be set as invalid.
type: int default: 2000
Each cluster has its unique group name. If you need 2 clusters in the same network environment, each of them would have its own group name.
cluster.jgroups.protocol.AUTH.value
Authentication string/password used for verification cluster nodes accessing the group. If this property is not specified, Cluster should be protected by firewall settings.
type: String
cluster.datasource.type
type: String defult: cloverCluster
Change this property to "remote" if the node doesn't have direct connection to the CloverETL Server database, so it has to use some other cluster node as proxy to handle persistent operations. In such case, also property "cluster.datasource.delegate.nodeIds" must be properly configured. Properties jdbc.* will be ignored. Please note, that scheduler is active only on nodes with direct connection.
type: String default: local
cluster.datasource.delegate.nodeIds List of cluster node IDs (separated by comma ",") which this node may use as a proxy to handle persistent operations. At least one of the listed node IDs must be running, otherwise this node will fail. All listed node
IDs must have a direct connection to CloverETL Server database properly configured. Property "cluster.datasource.delegate.nodeIds" is ignored by default. Property "cluster.datasource.type" must be set to "remote" to enable the feature.
type: String
247
Chapter 30. Cluster Configuration
Example of 2 Node Cluster Configuration
This section contains examples of CloverETL cluster nodes configuration. We assume that the user "clover" is running the JVM process and the license will be uploaded manually in the web GUI. In addition it is necessary to configure:
• sharing or replication of file system directory which the property "sandboxes.home" is pointing to. E.g. on Unixlike systems it would be typically
/home/[username]/CloverETL/sandboxes
.
• connection to the same database from both nodes
Basic 2-nodes Cluster Configuration
This example describes the simple cluster: each node has direct connection to database.
Figure 30.1. Configuration of 2-nodes cluster, each node has access to database
configuration of node on 192.168.1.131
jdbc.driverClassName=org.postgresql.Driver
jdbc.url=jdbc:postgresql://192.168.1.200/clover?charSet=UTF-8
jdbc.dialect=org.hibernate.dialect.PostgreSQLDialect
jdbc.username=clover
jdbc.password=clover
cluster.enabled=true
cluster.node.id=node01
cluster.http.url=http://192.168.1.131:8080/clover
cluster.jgroups.bind_address=192.168.1.131
cluster.group.name=TheCloverCluster1
Configuration of node on 192.168.1.132
jdbc.driverClassName=org.postgresql.Driver
jdbc.url=jdbc:postgresql://192.168.1.200/clover?charSet=UTF-8
jdbc.dialect=org.hibernate.dialect.PostgreSQLDialect
jdbc.username=clover
248
Chapter 30. Cluster Configuration
jdbc.password=clover
cluster.enabled=true
cluster.node.id=node02
cluster.http.url=http://192.168.1.132:8080/clover
cluster.jgroups.bind_address=192.168.1.132
cluster.group.name=TheCloverCluster1
If you use Apache Tomcat, the configuration is placed in $CATALINA_HOME/webapps/clover/WEB-
INF/config.properties
file. The location and file name on other application server may differ.
2-nodes Cluster with Proxied Access to Database
This cluster configuration is similar to previous one, but only one node has direct access to database. The node2 has to use node1 as a proxy.
Figure 30.2. Configuration of 2-nodes cluster, one node without direct access to database
Configuration of node on 192.168.1.131
jdbc.driverClassName=org.postgresql.Driver
jdbc.url=jdbc:postgresql://192.168.1.200/clover?charSet=UTF-8
jdbc.dialect=org.hibernate.dialect.PostgreSQLDialect
jdbc.username=clover
jdbc.password=clover
cluster.enabled=true
cluster.node.id=node01
cluster.http.url=http://192.168.1.131:8080/clover
cluster.jgroups.bind_address=192.168.1.131
cluster.group.name=TheCloverCluster2
Configuration of node on 192.168.1.132
cluster.datasource.type=remote (1)
cluster.datasource.delegate.nodeIds=node01
249
Chapter 30. Cluster Configuration
cluster.enabled=true
cluster.node.id=node02
cluster.http.url=http://192.168.1.132:8080/clover
cluster.jgroups.bind_address=192.168.1.132
cluster.group.name=TheCloverCluster2
1
These two lines describe access to database via another node.
2-nodes cluster with load balancer
If you use any external load balancer, the configuration of CloverETL Cluster will be same as in the first example.
Figure 30.3. Configuration of 2-nodes cluster, one node without direct access to database
The cluster.http.url
and cluster.jgroups.bind_address
are urls of particular cluster nodes even if you use load balancer.
250
Chapter 30. Cluster Configuration
Jobs Load Balancing Properties
Multiplicators of load balancing criteria. Load balancer decides which cluster node executes graph. It means, that any node may process request for execution, but graph may be executed on the same or on different node according to current load of the nodes and according to these multiplicators.
The higher number, the higher relevance for decision. All multiplicators must be greater then 0.
Each node of the cluster may have different load balancing properties. Any node may process incoming requests for transformation execution and each may apply criteria for loadbalancing in a different way according to its own configuration.
These properties aren't vital for cluster configuration - default values are sufficient
Table 30.1. Load balancing properties
property
cluster.lb.balance.running_graphs
float
type
cluster.lb.balance.memused
cluster.lb.balance.cpus
cluster.lb.balance.request_bonus
cluster.lb.balance.node_bonus
float float float float
3
default
0.5
1.5
2
1
description
Specify importance of running graphs for load balancing.
Specify importance of used memory for load balancing.
Specify importance of number of CPUs for load balancing.
Specify importance of the fact, that the node is the same which processes request for execution. The same node, which decides where to execute graph.
If you specify this multiplicator great enough, it will cause, that graph will be always executed on the same node, which processes request for execution.
Overall ratio bonus for configured node. Values greater then "1" increase probability the node will be chosen by the loadbalancer. Value "1" means no bonus or penalty. "0" means that the node will be never chosen by the loadbalancer, however it still may execute graphs, e.g.
when there is no other node in cluster, or when the graph is designed to run on the node.
251
Chapter 30. Cluster Configuration
Running More Clusters
If you run more clusters, each cluster has to have its own unique name. If the name is not unique, the cluster nodes of different clusters may consider foreign cluster nodes as part of the same cluster. The cluster name is configured using cluster.group.name
option. See Optional Properties (p. 245).
252
Chapter 30. Cluster Configuration
Cluster Reliability in Unreliable Network Environment
CloverETL Server instances must cooperate with each other to form a cluster together. If the connection between nodes doesn't work at all, or if it's not configured, cluster can't work properly. This chapter describes cluster nodes behavior in environment, where the connection between nodes is somehow unreliable.
Nodes use three channels to exchange status info or data
1. synchronous calls (via HTTP/HTTPS)
Typically NodeA requests some operation on NodeB, e.g. job execution. HTTP/HTTPS is also used for streaming data between workers of parallel execution
2. asynchronous messaging (TCP connection on port 7800 by default)
Typically heart-beat or events, e.g. job started or finished.
3. shared database – each node must be able to create DB connection
Shared configuration data, execution history etc.
Following scenarios are described below one by one, however they may occur together:
•
NodeA Cannot Establish HTTP Connection to NodeB (p. 253)
•
NodeA Cannot Establish TCP Connection (Port 7800 by Default) to NodeB (p. 253)
•
NodeB is Killed or It Cannot Connect to the Database (p. 254)
•
Auto-Resuming in Unreliable Network (p. 254)
•
Long-Term Network Malfunction May Cause Jobs to Hang on (p. 255)
NodeA Cannot Establish HTTP Connection to NodeB
When HTTP request can't be established between nodes, jobs which are delegated between nodes, or jobs running in parallel on more nodes will fail. The error is visible in the executions history. Each node periodically executes check-task which checks HTTP connection to other nodes. If the problem is detected, one of the nodes is suspended, since they can't cooperate with each other.
Time-line describing the scenario:
• 0s network connection between NodeA and NodeB is down
• 0-40s a check-task running on NodeA can't establish HTTP connection to NodeB; check may last for 30s until it times-out; there is no re-try, if connection fails even just once, it's considered as unreliable, so the nodes can't cooperate
• status of NodeA or NodeB (the one with shorter uptime) is changed to “suspended”
The following configuration properties serve to tune time intervals mentioned above:
• cluster.node.check.checkMinInterval
- periodicity of cluster node checks (40000ms by default)
• cluster.sync.connection.readTimeout
– HTTP connection response timeout (30000ms by default)
• cluster.sync.connection.connectTimeout
– establishing HTTP connection timeout (7000ms by default)
NodeA Cannot Establish TCP Connection (Port 7800 by Default) to
NodeB
TCP connection is used for asynchronous messaging. When the NodeB can't send/receive asynchronous messages, the other nodes aren't notified about started/finished jobs, so parent jobflow running on NodeA keeps waiting for
253
Chapter 30. Cluster Configuration the event from NodeB. Heart-beat is vital for meaningful load-balancing, the same check-task mentioned above also checks heart-beat from all cluster nodes.
Time-line describing the scenario:
• 0s network connection between NodeA and NodeB is down
• 60s NodeA uses the last available NodeB heart-beat
• 0-40s check-task running on NodeA detects missing heart-beat from NodeB
• status of NodeA or NodeB (the one with shorter uptime) is changed to “suspended”
The following configuration properties serve to tune time intervals mentioned above:
• cluster.node.check.checkMinInterval
- periodicity of cluster node checks (40000ms by default)
• cluster.node.sendinfo.interval
– periodicity of heart-beat messages (2000ms by default)
• cluster.node.sendinfo.min_interval
– the heart-beat may occasionally be sent more often than specified by “cluster.node.sendinfo.interval”, this property specifies minimum interval (500ms by default)
• cluster.node.remove.interval
– maximum interval for missing heart-beat (50000ms by default)
NodeB is Killed or It Cannot Connect to the Database
Access to the database is vital for running jobs, running scheduler and cooperation with other nodes also touching database is used for detection of dead process. When the JVM process of NodeB is killed, it stops touching the database and the other nodes may detect it.
Time-line describing the scenario:
• 0s-30s last touch on DB
• NodeB or its connection to the database is down
• 90s NodeA sees the last touch
• 0-40s check-task running on NodeA detects obsolete touch from NodeB
• status of NodeB is changed to “stopped”, jobs running on the NodeB are "solved", which means, that their status is changed to UNKNOWN and event is dispatched among the cluster nodes. Job result is considered as error.
The following configuration properties serve to tune time intervals mentioned above:
• cluster.node.touch.interval
– periodicity of database touch (20000ms by default)
• cluster.node.touch.forced_stop.interval
– interval when the other nodes accept last touch
(60000ms by default)
• cluster.node.check.checkMinInterval
- periodicity of cluster node checks (40000ms by default)
• cluster.node.touch.forced_stop.solve_running_jobs.enabled
- not interval, but boolean value, which can switch the "solving" of running jobs mentioned above
Auto-Resuming in Unreliable Network
In version 4.4 we added auto-resuming of suspended nodes
Time-line describing the scenario:
• NodeB is suspended after connection loss
• 0s NodeA successfully reestablishes connection to NodeB
• 120s NodeA changes NodeB status to "forced_resume"
• NodeB attempts to resume itself if maximum auto-resume count is not reached.
• If the connection is lost again the cycle repeats, if maximum auto-resume count is exceeded the node will remain suspended until the counter is reset. To prevent suspend-resume cycles.
• 240m auto-resume counter is reset
254
Chapter 30. Cluster Configuration
The following configuration properties serve to tune time intervals mentioned above:
• cluster.node.check.intervalBeforeAutoresume
- time (in ms) the node has to be accessible to be forcibly resumed (120000 by default)
• cluster.node.check.maxAutoresumeCount
- how many times a node may try to auto-resume itself
(3 by default)
• cluster.node.check.intervalResetAutoresumeCount=240
- time (in minutes) before autoresume counter will be reset
Long-Term Network Malfunction May Cause Jobs to Hang on
Jobflow or master execution executing child jobs on another cluster nodes must be notified about status changes of their child jobs. When the asynchronous messaging doesn't work, events from the child jobs aren't delivered, so parent jobs keep running. When the network works again, the child job events may be re-transmitted, so hung parent job may be finished. However the network malfunction may be so long, that the event can't be re-transmitted.
Please see following time-line to consider proper configuration:
• job A running on NodeA executes job B running on NodeB
• network between NodeA and NodeB is down from some reason
• job B finishes and sends the “finished” event, however it can't be delivered to NodeA – event is stored in the
“sent events buffer”
• Since the network is down, also heart-beat can't be delivered and maybe HTTP connections can't be established, the cluster reacts as described in the sections above. Even though the nodes may be suspended, parent job A keeps waiting for the event from job B
•
now, there are 3 possibilities:
a. Network finally starts working and since all undelivered events are in the “sent events buffer”, they are retransmitted and all of them are finally delivered. Parent job A is notified and proceeds. It may fail later, since some cluster nodes may be suspended.
b. Network finally starts working, but number of the events sent during the malfunction exceeded “sent events buffer” limit size. So some messages are lost and won't be re-transmitted. Thus the buffer size limit should be higher in the environment with unreliable network. Default buffer size limit is 10000 events. It should be enough for thousands of simple job executions, basically it depends on number of job phases. Each job execution produces at least 3 events (job started, phase finished, job finished). Please note that there are also some other events fired occasionally (configuration changes, suspending, resuming, cache invalidation).
Also messaging layer itself stores own messages to the buffer, but it's just tens messages in a hour. Heartbeat is not stored in the buffer.
There is also inbound events buffer used as temporary storage for events, so the events may be delivered in correct order when some events can't be delivered at the moment. When the cluster node is inaccessible, the inbound buffer is released after timeout, which is set to 1 hour by default.
c. Node B is restarted, so all undelivered events in the buffer are lost.
The following configuration properties serve to tune time intervals mentioned above:
• cluster.jgroups.protocol.NAKACK.gc_lag
– limit size of the sent events buffer; Please note that each stored message takes 2kB of heap memory (default limit is 10000 events)
• cluster.jgroups.protocol.NAKACK.xmit_table_obsolete_member_timeout
– inbound buffer timeout of unaccessible cluster node
255
Chapter 31. Recommendations for Cluster
Deployment
1. All nodes in the cluster should have a synchronized system date-time.
2. All nodes share sandboxes stored on a shared or replicated filesystem. The filesystem shared among all nodes is single point of failure. Thus, the use of a replicated filesystem is strongly recommended.
3. All nodes share a DB, thus it must support transactions. I.e. The MySQL table engine, MyISAM, may cause strange behaviour because it is not transactional.
4. All nodes share a DB, which is a single point of failure. Use of a clustered DB is strongly recommended.
5. Configure the license by "license.file" property or upload it in the Web GUI, so it's stored in the database. Do not use clover-license.war
.
256
Chapter 32. Multiple CloverServer Instances on the same Host
Running multiple CloverETL Server instances on the same host is not recommended. If you do so, you should ensure that the instances do not interfere with each other.
• Each instance must run in a separate application server.
• Each instance must have its own port to listen. Application server can have some additional opened ports, therefore you might change the configuration of the application server as well.
• The instances must have different
${java.io.tmpdir}
directory.
• Each instance needs separate
${sanboxes.home}
directory.
See the documentation of particular application server for further information on running multiple instances of the application server on the same computer.
257
List of Figures
258
CloverETL Server
259
List of Tables
260
CloverETL Server
261
List of Examples
262
دانلود
تبلیغات