Ubik Batch Server Administration Guide
From UbikWiki
(→Plugin Manager Configuration) |
(→Extension Manager Configuration) |
||
Line 290: |
Line 290: | ||
</source> | </source> | ||
- | === Extension Manager Configuration === | + | === Extension Manager Configuration (MANDATORY FILE)=== |
Configuration file is done in file <INSTALL_DIRECTORY>/config/extension-manager.xml. | Configuration file is done in file <INSTALL_DIRECTORY>/config/extension-manager.xml. | ||
An extension register Configuration extension (BatchStarts, their associated JMX and Persistence elements) to the core server. | An extension register Configuration extension (BatchStarts, their associated JMX and Persistence elements) to the core server. | ||
- | By default the server comes with a mandatory extension: | + | By default the server comes with a mandatory extension, so minimal configuration is: |
<source lang="xml"><?xml version="1.0" encoding="UTF-8"?> | <source lang="xml"><?xml version="1.0" encoding="UTF-8"?> | ||
<extensions> | <extensions> |
Revision as of 11:00, 2 March 2009
Contents
|
JVM launcher configuration
The server runs with a JDK 5. Ensure you always use the last update of the JDK:
JVM configuration is done in files:
- setEnv.cfg for Linux/Unix
- setenv.cmd for Windows
Advised options for the JVM are:
- -server
- -XX:MaxPermSize=128M (or above) depending on the number of BARs deployed on the server and their size
- Tune -Xms and -Xmx depending on the load of your batches and the number of BARs deployed
- -XX:+HeapDumpOnOutOfMemoryError
- -XX:HeapDumpPath=<path to logging folder>
Other options:
- -DLOG_ROOT_PATH=<path to logging folder>
This enables developers to name their logging files relatively to this file using ${LOG_ROOT_PATH}/<bar name>/<what they want>.log
Setting this property enables portable configuration files.
Batch Server General configuration
This configuration is in file <INSTALL_DIRECTORY>/config/config.properties
Common Configuration parameters:
Parameter | Description | Default Value |
---|---|---|
CONSOLE_ID | Unique ID Of the Batch Server | N/A |
INSTALL_DIR | Folder where server is installed | N/A |
CONFIG_ROOT | Declaration of a variable used later as ${} | ${INSTALL_DIR}/ config
|
PLUGIN_MANAGER_FILE | Path to the file that contains general plugin | ${INSTALL_DIR}/ config/ plugin-manager.xml |
LOCK_DIR | Lock folder used only if service
com.saltoconsulting.console.service.LOCKING_SYSTEM is set to com.ubikingenierie.console.locking.impl.FileLockingService, by default Database Locking is used | ${INSTALL_DIR}/ LOCK_DIR |
COLD_DEPLOYMENT_DIR | Folder Batch Server will look into to deploy BARs at startup | ${INSTALL_DIR}/ batches-cold-deploy |
BAR_UPLOAD_DIRECTORY | Folder that will contain BARs transfered from Batch Web Controller,
This folder must only be used by this server and it must be writable | ${INSTALL_DIR}/ bar-upload-folder |
BAR_UPLOAD_LISTEN_PORT | Port on which the Batch server listens for BARs upload | N/A |
OUTPUT_DATA | Folder used temporarily for Mail Generation and Lifecycle state | <INSTALL_DIRECTORY> / output |
USER_FILE | File that hosts JMX Authentication informations | |
com.salto.console. MAIL_MANAGER_STORE | Component used to manage configuraton of Mails, choose between:
=> Saves data in Database(default)
=> Saves data in XML file | salto.batch.system. MailManagerDBStore |
MAIL_FILE | Configuration file for Mail Server (MUST BE OK TO SEND MAILS, always used) | ${CONFIG_ROOT} / mail.xml |
MAIL_MANAGER_FILE | File that contains Mails of users to be notified on error,
Used only if com.salto.console.MAIL_MANAGER_STORE=salto.batch.system.MailManagerXMLStore Otherwise informations are stored in Database | ${CONFIG_ROOT} / mail-manager.xml |
JMX connectivity
Configuration parameters:
Parameter | Description | |
JNDI_NAME | JNDI Name that will appear at the end of the JMX URL | |
JMX_SERVICE_PORT | JMX Port that will appear in the URL (It must be free) | |
NAMING_SERVICE_PORT | Naming service Port that will appear in the URL (It must be free) | |
ACTIVATE_HTTP_ADAPTOR | JMX interface that exposes Operations in a Browser (Do not activate in PRODUCTION) | false |
JMX_HTTP_ADAPTOR_PORT | Port of the HTTP JMX adaptor if ACTIVATE_HTTP_ADAPTOR is true |
service:jmx:rmi://<HOST OF THE MACHINE>:<JMX_SERVICE_PORT>/jndi/rmi:// <HOST OF THE MACHINE>:<NAMING_SERVICE_PORT>/<JNDI_NAME>
Mailer connectivity
This configuration is referenced by MAIL_FILE property in config.properties (in file <INSTALL_DIRECTORY>/config/mail.xml)
Configuration parameters:
Parameter | Description | Default Value |
mailHost | Host of the Mail Server | N/A |
mailPort | Port of the Mail Server | 25 |
Mailer | Name that will appear in Sent mails | N/A |
Logging configuration
This configuration is in file <INSTALL_DIRECTORY>/config/log.properties.
Logging is based on Log4j, and this file controls the Server log level. Batch Logging configuration is hosted in each BAR
See http://logging.apache.org/log4j/docs/manual.html
Database connectivity Configuration
JDBC Drivers Configuration
Driver libraries must be put in folder:
- <INSTALL_DIRECTORY>/common/lib
Ensure you always have the last version of the drivers.
Connections Configuration
This configuration is done in file <INSTALL_DIRECTORY>/config/datasource.xml)
Ubik Batch Server uses Apache commons-dbcp implementation, see:
Note that "jdbc/console" is a mandatory pool for the server to run (poolPreparedStatements must be set to false for it).
Datasource DTD:
<!ELEMENT drivers (ResourceParams*) > <!ELEMENT ResourceParams (parameter*) > <!ATTLIST ResourceParams name CDATA #REQUIRED> <!ELEMENT parameter (name,value)> <!ELEMENT name (#PCDATA)> <!ELEMENT value (#PCDATA)>
Example of a pool configuration:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE drivers PUBLIC "-//Salto-consulting //DTD JDBC Datasource Configuration 1.0//EN" "http://www.salto-consulting.com/consolebatch/config/datasource.dtd"> <drivers> <ResourceParams name="jdbc/batchweb"> <parameter> <name>user</name> <value>batchweb</value> </parameter> <parameter> <name>username</name> <value>batchweb</value> </parameter> <parameter> <name>password</name> <value><![CDATA[+64wI0/45dIWg1akLg5LMg==]]></value> </parameter> <parameter> <name>isPasswordEncrypted</name> <value>true</value> </parameter> <parameter> <name>driverClassName</name> <value>org.postgresql.Driver</value> </parameter> <parameter> <name>url</name> <value><![CDATA[jdbc:postgresql://localhost:5432/batchweb]]></value> </parameter> <parameter> <name>validationQuery</name> <value><![CDATA[select 1 from dual]]></value> </parameter> <parameter> <name>testOnBorrow</name> <value>true</value> </parameter> <parameter> <name>initialSize</name> <value>0</value> </parameter> <parameter> <name>maxWait</name> <value>2000</value> </parameter> <parameter> <name>maxActive</name> <value>15</value> </parameter> <parameter> <name>minIdle</name> <value>1</value> </parameter> <parameter> <name>maxIdle</name> <value>2</value> </parameter> <parameter> <name>timeBetweenEvictionRunsMillis</name> <value>300000</value> </parameter> <parameter> <name>numTestsPerEvictionRun</name> <value>3</value> </parameter> <parameter> <name>poolPreparedStatements</name> <value>true</value> </parameter> <parameter> <name>maxOpenPreparedStatements</name> <value>50</value> </parameter> <parameter> <name>connectionProperties</name> <value>loglevel=org.postgresql.Driver.DEBUG;allowEncodingChanges=true</value> </parameter> </ResourceParams> ... </drivers>
Extension Manager Configuration (MANDATORY FILE)
Configuration file is done in file <INSTALL_DIRECTORY>/config/extension-manager.xml.
An extension register Configuration extension (BatchStarts, their associated JMX and Persistence elements) to the core server. By default the server comes with a mandatory extension, so minimal configuration is:
<?xml version="1.0" encoding="UTF-8"?> <extensions> <extension className="com.ubikingenierie.console.configuration.extension.CoreExension" > </extension> </extensions>
Plugin Manager Configuration (MANDATORY FILE)
A plugin is a class with a start and destroy method. It contains code that must be executed at startup and shutdown of the server.
Configuration file is referenced by property PLUGIN_MANAGER_FILE in config.properties.
<?xml version="1.0" encoding="UTF-8"?> <!-- #Release @VERSION@ at @DATE@ --> <plugins> <plug-in className="salto.batch.plugin.ServiceInitializationPlugin" id="salto.batch.plugin.ServiceInitializationPlugin"> <set-property property="initializationOrder" value="-2"></set-property> <set-property property="serviceConfigFile" value="<DEPENDS ON YOUR INSTALLATION FOLDER>/config/service-config.properties"></set-property> </plug-in> <plug-in className="com.saltoconsulting.console.monitoring.plugin.HealthMonitorPlugin" id="com.saltoconsulting.console.monitoring.plugin.HealthMonitorPlugin"> <set-property property="initializationOrder" value="-1"></set-property> <set-property property="schedulingPeriod" value="120000"></set-property> <set-property property="acceptableBatchDelay" value="120000"></set-property> </plug-in> <plug-in className="salto.batch.system.LockedBatchCheckerPlugin" id="com.saltoconsulting.batch.system.plugin.LockedBatchCheckerPlugin"> <set-property property="initializationOrder" value="-1"></set-property> </plug-in> </plugins>
Server JMS configuration:
Our server integrates a JNDI connector that integrates in the local JNDI JMS objects from remote JNDIs.
It integrates a process that reconnects to the remote JNDIs during the lifetime of the server.
This enables startup even if remote objects are not yet available.
JMS Object (ConnectionFactories, Topics and Queues) are integrated in the local server JNDI using a configuration file:
- <BATCH_SERVER_HOME>/config/jms-config.xml
JNDI Objects are composed of:
Element | Description |
localJndiName | Physical name in the local JNDI (must be unique) |
type | One of:* javax.jms.ConnectionFactory
|
distantJndiName | Physical name in the remote JNDI |
env-property | Element with 2 children:* name (Name of a JNDI property used to connect to the Remote JNDI)
|
env-property/name | Name of the property, examples:* java.naming.provider.url
|
env-property/value | Value of the property |
JMS Config DTD:
<!ELEMENT jndi-objects (jndi-object*) > <!ELEMENT jndi-object (localJndiName, type, distantJndiName, env-property*) > <!ELEMENT type (#PCDATA)> <!ELEMENT localJndiName (#PCDATA)> <!ELEMENT distantJndiName (#PCDATA)> <!ELEMENT env-property (name, value) > <!ELEMENT name (#PCDATA)> <!ELEMENT value (#PCDATA)>
Example:
<jndi-objects> <jndi-object> <localJndiName>jms/localConnectionFactoryOJMS</localJndiName> <type>javax.jms.ConnectionFactory</type> <distantJndiName>demoConnectionFactoryOJMS</distantJndiName> <env-property> <name>java.naming.provider.url</name> <value>tcp://localhost:3035/</value> </env-property> <env-property> <name>java.naming.factory.initial</name> <value>org.exolab.jms.jndi.InitialContextFactory</value> </env-property> </jndi-object> ... </jndi-objects>
Note about bindings:
To decouple coding process from deployment, developper should use logical names (start with java:comp/env/jms/localQueue).
To use physical name, just use jms/localQueue.
Deployer can then bind logical to physical names using <BAR_DISPLAY_NAME>-binding.xml, example:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE bar-resources PUBLIC "-//Ubik-Ingenierie //DTD BAR Binding Resource Configuration 1.0//EN" "http://www.ubik-ingenierie.com/consolebatch/config/bar-binding.dtd"> <bar-resources> <bar-resource nameinbar="jdbc/toto" boundname="jdbc/batchweb" /> <bar-resource nameinbar="jdbc/batchweb" boundname="jdbc/batchweb" /> <bar-resource nameinbar="jms/localConnectionFactory" boundname="jms/localConnectionFactoryOJMS" /> <bar-resource nameinbar="jms/localDemoQueue" boundname="jms/localDemoQueueOJMS" /> </bar-resources>
If developer has used « java:comp/env/jms/localConnectionFactory » in his code, he will in fact use the object jms/localConnectionFactoryOJMS. If he chooses to use physical names (which is not recommended) he will use the name « jms/localConnectionFactoryOJMS». Note that if Batch Server administrator chooses to rename the resource, the code must be modified, while in the first solution, only binding file must be changed.
JMS Brokers:
ActiveMQ
Libraries to add in business/lib folder
- activemq-core-4.1.1.jar
- backport-util-concurrent-2.1.jar
JNDI
Attribute | Value |
java.naming.provider.url | tcp://hostname:61616 |
java.naming.factory.initial | org.apache.activemq.jndi.ActiveMQInitialContextFactory |
More details
Example
<jndi-object> <localJndiName>jms/localConnectionFactoryAMQ</localJndiName> <type>javax.jms.ConnectionFactory</type> <distantJndiName>demoConnectionFactoryAMQ</distantJndiName> <env-property> <name>java.naming.provider.url</name> <value>tcp://hostname:61616</value> </env-property> <env-property> <name>java.naming.factory.initial</name> <value>org.apache.activemq.jndi.ActiveMQInitialContextFactory</value> </env-property> </jndi-object>
SonicMQ
Libraries to add in business/lib folder
- client.jar
- broker.jar
- mfcontext.jar
JNDI
Attribute | Value |
java.naming.provider.url | tcp://hostname:2506 |
java.naming.factory.initial | com.sonicsw.jndi.mfcontext.MFContextFactory |
More details
Example
<jndi-object> <localJndiName>jms/localConnectionFactorySonicMQ</localJndiName> <type>javax.jms.ConnectionFactory</type> <distantJndiName>demoConnectionFactorySonicMQ</distantJndiName> <env-property> <name>java.naming.provider.url</name> <value>tcp://hostname:2506</value> </env-property> <env-property> <name>java.naming.factory.initial</name> <value>com.sonicsw.jndi.mfcontext.MFContextFactory</value> </env-property> </jndi-object>
OpenJMS
Libraries to add in business/lib folder
- openjms-common-0.7.7-beta-1.jar
- openjms-0.7.7-beta-1.jar
- openjms-net-0.7.7-beta-1.jar
- spice-jndikit-1.2.jar (only if embedded JNDI is used)
JNDI
Attribute | Value |
java.naming.provider.url | tcp://localhost:3035/ |
java.naming.factory.initial | org.exolab.jms.jndi.InitialContextFactory |
More details
Example
<jndi-object> <localJndiName>jms/localConnectionFactoryOJMS</localJndiName> <type>javax.jms.ConnectionFactory</type> <distantJndiName>demoConnectionFactoryOJMS</distantJndiName> <env-property> <name>java.naming.provider.url</name> <value>tcp://localhost:3035/</value> </env-property> <env-property> <name>java.naming.factory.initial</name> <value>org.exolab.jms.jndi.InitialContextFactory</value> </env-property> </jndi-object>
MQSeries 6.x
Note
MQSeries does not have an in-house JNDI.
You need to install:
- support pac ME01 (WebSphere MQ Initial Context),
- which in turn requires support pac MS0B (MQSeries Java classes for PCF)
Libraries to add in business/lib folder
- mq-6.0.jar
- mqjms-6.0.jar
- mqcontext-6.0.jar
- mqdhbcore-1.3.1.jar
- com.ibm.mq.pcf-6.0.3.jar
JNDI
Attribute | Value |
java.naming.provider.url | SERVER_HOST:1431/SYSTEM.DEF.SVRCONN |
java.naming.factory.initial | com.ibm.mq.jms.context.WMQInitialContextFactory |
Example
<jndi-object> <localJndiName>jms/QueueMQSeries</localJndiName> <type>javax.jms.Queue</type> <distantJndiName>TEST.QUEUE</distantJndiName> <env-property> <name>java.naming.provider.url</name> <value>sv049002.si3si.int:1431/SYSTEM.DEF.SVRCONN</value> </env-property> <env-property> <name>java.naming.factory.initial</name> <value>com.ibm.mq.jms.context.WMQInitialContextFactory</value> </env-property> </jndi-object>
Using SUN FsContext
Libraries to add in business/lib folder
- providerutil-1.2.jar
- fscontext-1.2.jar
JNDI
Attribute | Value |
java.naming.provider.url | file://C:\development\ubik\workspace\BrokerRunner\jndi |
java.naming.factory.initial | com.sun.jndi.fscontext.RefFSContextFactory |
Example
<jndi-object> <localJndiName>jms/QueueMQSeries</localJndiName> <type>javax.jms.Queue</type> <distantJndiName>TEST.QUEUE</distantJndiName> <env-property> <name>java.naming.provider.url</name> <value>file://C:\development\ubik\workspace\BrokerRunner\jndi</value> </env-property> <env-property> <name>java.naming.factory.initial</name> <value>com.sun.jndi.fscontext.RefFSContextFactory</value> </env-property> </jndi-object>
Authors
- Philippe Mouawad
History
- Page created by Pmouawad, 21 March 2008: New page: == Server JMS configuration: == Our server integrates a JNDI connector that integrates in the local JNDI JMS objects from remote JNDIs. It integrates a process that reconnects to the remo...
- Contributors: Pmouawad x99, Abourre x2
- Last modified by Pmouawad, 10 January 2014: /* Connections Configuration */