Ubik Batch Server Administration Guide

From UbikWiki

(Difference between revisions)
(Logging configuration)
(Datasource Configuration)

Line 174:

Line 174:

<name>driverClassName</name>
<name>driverClassName</name>
<value>org.postgresql.Driver</value>
<value>org.postgresql.Driver</value>
-
</parameter>
 
-
<parameter>
 
-
<name>driverName</name>
 
-
<value><![CDATA[jdbc:postgresql://localhost:5432/batchweb]]></value>
 
</parameter>
</parameter>
<parameter>
<parameter>

Revision as of 23:08, 21 March 2008

Contents

Batch Server General configuration

This configuration is in file <INSTALL_DIRECTORY>/config/config.properties

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:
  1. salto.batch.system.MailManagerDBStore => Saves data in Database(default)
  2. salto.batch.system.MailManagerXMLStore => 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:

Paramter 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
mailPort Port of the Mail Server 25
Mailer Name that will appear in Sent mails

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

Datasource Configuration

This configuration is done in file <INSTALL_DIRECTORY>/config/datasource.xml)

Ubik Batch Server uses Apache commons-dbcp implementation, see:

Example of a pool configuration:

<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>

TODO : Document datasources

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
  • javax.jms.Queue
  • javax.jms.Topic


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)
  • value (Value of the JNDI property used to connect to the Remote JNDI)


env-property/name Name of the property, examples:* java.naming.provider.url
  • java.naming.factory.initial
  • java.naming.factory.url.pkgs
  • ...


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>

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>
Personal tools