geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v2.2 > Configuring your own Monitoring Plugin DataSource
Date Wed, 15 Jul 2009 09:43:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=GMOxDOC22&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/GMOxDOC22/Configuring+your+own+Monitoring+Plugin+DataSource">Configuring
your own Monitoring Plugin DataSource</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~sophia">Ying
Tang</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <p>The basic information of the server can be captured and stored in a database
that is supported by Geronimo. The Geronimo management node takes advantage of MBeans to collect
the server's statistics for a given time, also called <b>snapshots</b>. These
snapshots are all JSR 77 compatible. In this way the administrator can monitor the server
status. </p>

<p>By default, the datasources are used to connect an Apache Derby database (the reason
for this is because the default DB that Geronimo uses is also Derby). However, since the datasources
are all packaged into separate plugins, anyone is able to write their own datasource deployment
descriptor, package it into a plugin, and use it instead of the one provided by default.</p>

<p>In order to use your own database for the Monitoring Plugin you must ensure the following:</p>
<ul>
	<li>Datasource for the Active Database must be named <b>jdbc/ActiveDS</b></li>
	<li>Datasource for the Archive Database must be named <b>jdbc/ArchiveDS</b></li>
	<li>Module ID must be <b>org.apache.geronimo.plugins.monitoring/agent-ds//car</b>
because there is a dependency on this module ID in the plugin</li>
</ul>


<h2><a name="ConfiguringyourownMonitoringPluginDataSource-Thedeploymentdescriptorfortheoriginaldatasource"></a>The
deployment descriptor for the original datasource</h2>
<p>Here is the original deployment descriptor for the datasources used for the Monitoring
Plugin in <tt>&lt;geronimo_home&gt;\repository\org\apache\geronimo\plugins\monitoring\agent-ds\&lt;version&gt;\agent-ds-&lt;version&gt;.car\META-INF</tt>.
</p>

<style type="text/css">
@import url(/confluence/download/resources/confluence.ext.code:code/shStyles.css);
</style>
<!--[if IE]>
<style type="text/css">
    .code textarea, .code input { padding: 0 !important; }
</style>
<![endif]-->
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shCore.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushCSharp.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushPhp.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushJScript.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushVb.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushSql.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushXml.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushShell.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushDelphi.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushPython.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushJava.js"></script>
<div class="code">
<textarea name="newcodemacro" class="xml:nocontrols:nogutter" rows="10" readonly="readonly">&lt;connector
xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-${geronimoSchemaVersion}"&gt;
    &lt;environment&gt;
        &lt;moduleId&gt;
            &lt;groupId&gt;${pom.groupId}&lt;/groupId&gt;
            &lt;artifactId&gt;${pom.artifactId}&lt;/artifactId&gt;
            &lt;version&gt;${version}&lt;/version&gt;
            &lt;type&gt;car&lt;/type&gt;
        &lt;/moduleId&gt;
        &lt;dependencies&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;org.apache.geronimo.configs&lt;/groupId&gt;
                &lt;artifactId&gt;system-database&lt;/artifactId&gt;
                &lt;type&gt;car&lt;/type&gt;
            &lt;/dependency&gt;
            &lt;!-- SQL files --&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;org.apache.geronimo.plugins.monitoring&lt;/groupId&gt;
                &lt;artifactId&gt;agent-sql&lt;/artifactId&gt;
                &lt;version&gt;${monitoringConsoleVersion}&lt;/version&gt;
                &lt;type&gt;jar&lt;/type&gt;
            &lt;/dependency&gt;
        &lt;/dependencies&gt;
    &lt;/environment&gt;

    &lt;resourceadapter&gt;
        &lt;outbound-resourceadapter&gt;
            &lt;!-- Pool for Active Statistics --&gt;
            &lt;connection-definition&gt;
                &lt;connectionfactory-interface&gt;javax.sql.DataSource&lt;/connectionfactory-interface&gt;
                &lt;connectiondefinition-instance&gt;
                    &lt;name&gt;jdbc/ActiveDS&lt;/name&gt;
                    &lt;config-property-setting name="CreateDatabase"&gt;true&lt;/config-property-setting&gt;
                    &lt;config-property-setting name="Password"&gt;monitor&lt;/config-property-setting&gt;
                    &lt;config-property-setting name="UserName"&gt;monitor&lt;/config-property-setting&gt;
                    &lt;config-property-setting name="DatabaseName"&gt;ActiveMRCDB&lt;/config-property-setting&gt;
                    &lt;connectionmanager&gt;
                        &lt;local-transaction/&gt;
                        &lt;single-pool&gt;
                            &lt;max-size&gt;10&lt;/max-size&gt;
                            &lt;min-size&gt;0&lt;/min-size&gt;
                            &lt;match-one/&gt;
                        &lt;/single-pool&gt;
                    &lt;/connectionmanager&gt;
                &lt;/connectiondefinition-instance&gt;
             &lt;/connection-definition&gt;
             &lt;!-- Pool for Archived Statistics --&gt;
             &lt;connection-definition&gt;
                 &lt;connectionfactory-interface&gt;javax.sql.DataSource&lt;/connectionfactory-interface&gt;
                 &lt;connectiondefinition-instance&gt;
                     &lt;name&gt;jdbc/ArchiveDS&lt;/name&gt;
                     &lt;config-property-setting name="CreateDatabase"&gt;true&lt;/config-property-setting&gt;
                     &lt;config-property-setting name="Password"&gt;monitor&lt;/config-property-setting&gt;
                     &lt;config-property-setting name="UserName"&gt;monitor&lt;/config-property-setting&gt;
                     &lt;config-property-setting name="DatabaseName"&gt;ArchiveMRCDB&lt;/config-property-setting&gt;
                     &lt;connectionmanager&gt;
                         &lt;local-transaction/&gt;
                         &lt;single-pool&gt;
                             &lt;max-size&gt;10&lt;/max-size&gt;
                             &lt;min-size&gt;0&lt;/min-size&gt;
                             &lt;match-one/&gt;
                         &lt;/single-pool&gt;
                     &lt;/connectionmanager&gt;
                 &lt;/connectiondefinition-instance&gt;
             &lt;/connection-definition&gt;
         &lt;/outbound-resourceadapter&gt;
     &lt;/resourceadapter&gt;

     &lt;!-- These two GBeans will create the tables for the database automatically --&gt;
     &lt;gbean name="ActiveDSGBean" class="org.apache.geronimo.connector.DatabaseInitializationGBean"&gt;
         &lt;attribute name="testSQL"&gt;SELECT t.tablename FROM SYS.SYSTABLES t WHERE
lower(t.tablename)='statistics'&lt;/attribute&gt;
         &lt;attribute name="path"&gt;META-INF/database/derby/createTables.sql&lt;/attribute&gt;
         &lt;reference name="DataSource"&gt;
             &lt;name&gt;jdbc/ActiveDS&lt;/name&gt;
         &lt;/reference&gt;
     &lt;/gbean&gt;
     &lt;gbean name="ArchiveDSGBean" class="org.apache.geronimo.connector.DatabaseInitializationGBean"&gt;
         &lt;attribute name="testSQL"&gt;SELECT t.tablename FROM SYS.SYSTABLES t WHERE
lower(t.tablename)='statistics'&lt;/attribute&gt;
         &lt;attribute name="path"&gt;META-INF/database/derby/createTables.sql&lt;/attribute&gt;
         &lt;reference name="DataSource"&gt;
             &lt;name&gt;jdbc/ArchiveDS&lt;/name&gt;
         &lt;/reference&gt;
     &lt;/gbean&gt;
&lt;!--this ought to be in the agent plan but this realm is not always started before
the credential-store, even with the dependency--&gt;
  &lt;gbean name="monitoring-runas-realm" class="org.apache.geronimo.security.realm.GenericSecurityRealm"&gt;
    &lt;attribute name="realmName"&gt;monitoring-runas-realm&lt;/attribute&gt;
    &lt;attribute name="global"&gt;false&lt;/attribute&gt;
    &lt;xml-reference name="LoginModuleConfiguration"&gt;
      &lt;lc:login-config xmlns:lc="http://geronimo.apache.org/xml/ns/loginconfig-1.2"&gt;
        &lt;lc:login-module control-flag="REQUIRED"&gt;
          &lt;lc:login-domain-name&gt;monitoring-runas-domain&lt;/lc:login-domain-name&gt;
          &lt;lc:login-module-class&gt;org.apache.geronimo.security.credentialstore.RunAsLoginModule&lt;/lc:login-module-class&gt;
          &lt;lc:option name="principalClass"&gt;org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal&lt;/lc:option&gt;
          &lt;lc:option name="principalNames"&gt;admin&lt;/lc:option&gt;
        &lt;/lc:login-module&gt;
      &lt;/lc:login-config&gt;
    &lt;/xml-reference&gt;
    &lt;!--&lt;reference name="ServerInfo"&gt;--&gt;
    &lt;!--&lt;name&gt;ServerInfo&lt;/name&gt;--&gt;
    &lt;!--&lt;/reference&gt;--&gt;
  &lt;/gbean&gt;
&lt;/connector&gt;</textarea>
<script class="javascript">
    if(!window.newcodemacro_initialised)
    {
        window.newcodemacro_initialised = true;
        window.oldonloadmethod = window.onload;
        window.onload = function(){
            dp.SyntaxHighlighter.HighlightAll('newcodemacro');
            if(window.oldonloadmethod)
            {
                window.oldonloadmethod();
            }
        }
    }

</script>
</div>

<p><tt>META-INF/database/derby</tt> is the path of <tt>createTables.sql</tt>
packaged in tha JAR file <tt>&lt;geronimo_home&gt;\repository\org\apache\geronimo\plugins\monitoring\agent-sql\&lt;version&gt;\agent-sql-&lt;version&gt;.jar</tt>,
which is a dependency of the datasource.</p>

<p>The two gbeans at the end of the deployment descriptor is pointing to an SQL file
<tt>createTables.sql</tt> in order to create the necessary tables under the condition
that they do not exist. The elements of these two tables are described as the following:</p>
<ul>
	<li>MBeans
	<ul>
		<li><b>id</b> (Primary Key): id of the MBean.</li>
		<li><b>mbeanName</b>: name of the MBean.</li>
		<li><b>statsNameList</b>: comma separated strings to represent an MBean's
statistics name.</li>
	</ul>
	</li>
	<li>Statistics
	<ul>
		<li><b>id</b> (Primary Key): id of the statistics.</li>
		<li><b>mbeanId</b> (Foreign Key): id of MBean.</li>
		<li><b>snapshot_time</b>: the duration of time in between snapshots.</li>
		<li><b>statsValueList</b>: comma separated strings to represent an MBean's
statistics value.</li>
	</ul>
	</li>
</ul>


<div class="code">
<textarea name="newcodemacro" class="java:nocontrols:nogutter" rows="10" readonly="readonly">-----------------------------------------------------------------------------
-- MBEANS
-----------------------------------------------------------------------------

CREATE TABLE MBeans(
    id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
    mbeanName VARCHAR(256) NOT NULL,
    statsNameList VARCHAR(512) NOT NULL,
    PRIMARY KEY(id)
);

-----------------------------------------------------------------------------
-- STATISTICS
-----------------------------------------------------------------------------

CREATE TABLE Statistics (
    id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
    mbeanId INT NOT NULL,
    snapshot_time BIGINT NOT NULL,
    statsValueList VARCHAR(512) NOT NULL,
    PRIMARY KEY(id),
    FOREIGN KEY (mbeanId) REFERENCES MBeans(id)
);</textarea>
<script class="javascript">
    if(!window.newcodemacro_initialised)
    {
        window.newcodemacro_initialised = true;
        window.oldonloadmethod = window.onload;
        window.onload = function(){
            dp.SyntaxHighlighter.HighlightAll('newcodemacro');
            if(window.oldonloadmethod)
            {
                window.oldonloadmethod();
            }
        }
    }

</script>
</div>


<h2><a name="ConfiguringyourownMonitoringPluginDataSource-AnExample"></a>An
Example</h2>
<p>In this example, we will replace the default Apache Derby plugin datasource with
a DB2 Express-C one.</p>

<h3><a name="ConfiguringyourownMonitoringPluginDataSource-Prerequisites"></a>Prerequisites</h3>
<p>Before we get started to replace the monitoring plugin datasource, we should install
DB2 Express-C database and its driver JAR packages on Geronimo, and then configure a DB2 Express-C
datasource for Geronimo to connect to that database.</p>
<ol>
	<li>Download and install DB2 Express_C. See <a href="http://www.ibm.com/software/data/db2/express/"
rel="nofollow">DB2 Express-C</a> for details about downloading and installing this
database.</li>
	<li>Install the driver JAR packages on Geronimo. See <a href="/confluence/display/GMOxDOC22/Configuring+a+DB2+datasource#ConfiguringaDB2datasource-AddingDB2driverstotherepository">Adding
DB2 drivers to the repository</a> for detailed steps.</li>
	<li>Deploy a datasource for DB2 Express-C. See <a href="/confluence/display/GMOxDOC22/Configuring+a+DB2+datasource#ConfiguringaDB2datasource-CreatingadatabaseconnectionpoolusingthewizardfromtheGeronimoAdministrationConsole">Creating
a database connection pool using the wizard from the Geronimo Administration Console</a>
for detailed information.</li>
</ol>


<h3><a name="ConfiguringyourownMonitoringPluginDataSource-Replacingthedefaultmonitoringplugindatasouce"></a>Replacing
the default monitoring plugin datasouce</h3>
<p>Now that we have a DB2 monitoring plugin datasource, we have to create deployment
descriptors for the datasource.</p>
<ol>
	<li>Create the deployment plan <tt><a href="/confluence/download/attachments/93396/db2-agent-ds.xml?version=1">db2-agent-ds.xml</a></tt>
based on the default <tt><a href="#ConfiguringyourownMonitoringPluginDataSource-Thedeploymentdescriptorfortheoriginaldatasource">plan.xml</a></tt>.
<div class="code">
<textarea name="newcodemacro" class="xml:nocontrols:nogutter" rows="10" readonly="readonly">&lt;connector
xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"&gt;
  &lt;dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"&gt;
    &lt;dep:moduleId&gt;
      &lt;dep:groupId&gt;org.apache.geronimo.plugins.monitoring&lt;/dep:groupId&gt;
      &lt;dep:artifactId&gt;db2-agent-ds&lt;/dep:artifactId&gt;
      &lt;dep:version&gt;2.2-SNAPSHOT&lt;/dep:version&gt;
      &lt;dep:type&gt;car&lt;/dep:type&gt;
    &lt;/dep:moduleId&gt;

    &lt;dep:dependencies&gt;
      &lt;dep:dependency&gt;
        &lt;dep:groupId&gt;org.apache.geronimo.plugins.monitoring&lt;/dep:groupId&gt;
        &lt;dep:artifactId&gt;agent-sql&lt;/dep:artifactId&gt;
        &lt;dep:version&gt;2.2-SNAPSHOT&lt;/dep:version&gt;
        &lt;dep:type&gt;jar&lt;/dep:type&gt;
      &lt;/dep:dependency&gt;
      &lt;dep:dependency&gt;
        &lt;dep:groupId&gt;com.ibm.db2&lt;/dep:groupId&gt;
        &lt;dep:artifactId&gt;db2jcc&lt;/dep:artifactId&gt;
        &lt;dep:version&gt;9.5.0&lt;/dep:version&gt;
        &lt;dep:type&gt;jar&lt;/dep:type&gt;
      &lt;/dep:dependency&gt;
      &lt;dep:dependency&gt;
        &lt;dep:groupId&gt;com.ibm.db2&lt;/dep:groupId&gt;
        &lt;dep:artifactId&gt;db2jcc_license_cu&lt;/dep:artifactId&gt;
        &lt;dep:version&gt;9.5.0&lt;/dep:version&gt;
        &lt;dep:type&gt;jar&lt;/dep:type&gt;
      &lt;/dep:dependency&gt;
    &lt;/dep:dependencies&gt;

    &lt;dep:hidden-classes/&gt;
    &lt;dep:non-overridable-classes/&gt;
    &lt;dep:private-classes/&gt;
  &lt;/dep:environment&gt;
 
 &lt;resourceadapter&gt;
    &lt;outbound-resourceadapter&gt;
      &lt;!--Pool for Active Statistics--&gt;
      &lt;connection-definition&gt;
        &lt;connectionfactory-interface&gt;javax.sql.DataSource&lt;/connectionfactory-interface&gt;
        &lt;connectiondefinition-instance&gt;
          &lt;name&gt;jdbc/ActiveDS&lt;/name&gt;
	   &lt;config-property-setting name="UserName"&gt;db2admin&lt;/config-property-setting&gt;
          &lt;config-property-setting name="Password"&gt;db2manager&lt;/config-property-setting&gt;
          &lt;config-property-setting name="PortNumber"&gt;50000&lt;/config-property-setting&gt;
          &lt;config-property-setting name="ServerName"&gt;localhost&lt;/config-property-setting&gt;
          &lt;config-property-setting name="DatabaseName"&gt;activedb&lt;/config-property-setting&gt;
          &lt;config-property-setting name="DriverType"&gt;4&lt;/config-property-setting&gt;
         
          &lt;connectionmanager&gt;
            &lt;xa-transaction&gt;
                     &lt;transaction-caching/&gt;
            &lt;/xa-transaction&gt;

            &lt;single-pool&gt;
              &lt;max-size&gt;10&lt;/max-size&gt;
              &lt;min-size&gt;0&lt;/min-size&gt;
              &lt;match-one/&gt;
            &lt;/single-pool&gt;
          &lt;/connectionmanager&gt;
        &lt;/connectiondefinition-instance&gt;
      &lt;/connection-definition&gt;
      &lt;!--Pool for Archived Statistics--&gt;
      &lt;connection-definition&gt;
        &lt;connectionfactory-interface&gt;javax.sql.DataSource&lt;/connectionfactory-interface&gt;
        &lt;connectiondefinition-instance&gt;
          &lt;name&gt;jdbc/ArchiveDS&lt;/name&gt;
          &lt;config-property-setting name="UserName"&gt;db2admin&lt;/config-property-setting&gt;
          &lt;config-property-setting name="Password"&gt;db2manager&lt;/config-property-setting&gt;
          &lt;config-property-setting name="PortNumber"&gt;50000&lt;/config-property-setting&gt;
          &lt;config-property-setting name="ServerName"&gt;localhost&lt;/config-property-setting&gt;
          &lt;config-property-setting name="DatabaseName"&gt;archdb&lt;/config-property-setting&gt;
          &lt;config-property-setting name="DriverType"&gt;4&lt;/config-property-setting&gt;
         
          &lt;connectionmanager&gt;
            &lt;xa-transaction&gt;
                     &lt;transaction-caching/&gt;
            &lt;/xa-transaction&gt;

            &lt;single-pool&gt;
              &lt;max-size&gt;10&lt;/max-size&gt;
              &lt;min-size&gt;0&lt;/min-size&gt;
              &lt;match-one/&gt;
            &lt;/single-pool&gt;
          &lt;/connectionmanager&gt;
        &lt;/connectiondefinition-instance&gt;
      &lt;/connection-definition&gt;
    &lt;/outbound-resourceadapter&gt;
  &lt;/resourceadapter&gt;
  &lt;!--These two GBeans will create the tables for the database automatically--&gt;
  &lt;gbean name="ActiveDSGBean" class="org.apache.geronimo.connector.DatabaseInitializationGBean"&gt;
    &lt;attribute name="testSQL"&gt;SELECT t.tablename FROM SYS.SYSTABLES t WHERE
lower(t.tablename)='statistics'&lt;/attribute&gt;
    &lt;attribute name="path"&gt;META-INF/database/derby/createTables.sql&lt;/attribute&gt;
    &lt;reference name="DataSource"&gt;
      &lt;name&gt;jdbc/ActiveDS&lt;/name&gt;
    &lt;/reference&gt;
  &lt;/gbean&gt;
  &lt;gbean name="ArchiveDSGBean" class="org.apache.geronimo.connector.DatabaseInitializationGBean"&gt;
    &lt;attribute name="testSQL"&gt;SELECT t.tablename FROM SYS.SYSTABLES t WHERE
lower(t.tablename)='statistics'&lt;/attribute&gt;
    &lt;attribute name="path"&gt;META-INF/database/derby/createTables.sql&lt;/attribute&gt;
    &lt;reference name="DataSource"&gt;
      &lt;name&gt;jdbc/ArchiveDS&lt;/name&gt;
    &lt;/reference&gt;
  &lt;/gbean&gt;
  &lt;!--this ought to be in the agent plan but this realm is not always started before
the credential-store, even with the dependency--&gt;
  &lt;gbean name="monitoring-runas-realm" class="org.apache.geronimo.security.realm.GenericSecurityRealm"&gt;
    &lt;attribute name="realmName"&gt;monitoring-runas-realm&lt;/attribute&gt;
    &lt;attribute name="global"&gt;false&lt;/attribute&gt;
    &lt;xml-reference name="LoginModuleConfiguration"&gt;
      &lt;lc:login-config xmlns:lc="http://geronimo.apache.org/xml/ns/loginconfig-1.2"&gt;
        &lt;lc:login-module control-flag="REQUIRED"&gt;
          &lt;lc:login-domain-name&gt;monitoring-runas-domain&lt;/lc:login-domain-name&gt;
          &lt;lc:login-module-class&gt;org.apache.geronimo.security.credentialstore.RunAsLoginModule&lt;/lc:login-module-class&gt;
          &lt;lc:option name="principalClass"&gt;org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal&lt;/lc:option&gt;
          &lt;lc:option name="principalNames"&gt;admin&lt;/lc:option&gt;
        &lt;/lc:login-module&gt;
      &lt;/lc:login-config&gt;
    &lt;/xml-reference&gt;
    &lt;!--&lt;reference name="ServerInfo"&gt;--&gt;
    &lt;!--&lt;name&gt;ServerInfo&lt;/name&gt;--&gt;
    &lt;!--&lt;/reference&gt;--&gt;
  &lt;/gbean&gt;
&lt;/connector&gt;</textarea>
<script class="javascript">
    if(!window.newcodemacro_initialised)
    {
        window.newcodemacro_initialised = true;
        window.oldonloadmethod = window.onload;
        window.onload = function(){
            dp.SyntaxHighlighter.HighlightAll('newcodemacro');
            if(window.oldonloadmethod)
            {
                window.oldonloadmethod();
            }
        }
    }

</script>
</div>

<p>You have to make the following changes to <tt>db2-agent-ds.xml</tt>:</p>
	<ul>
		<li>Update &lt;dependencies&gt; section with drivers required by DB2 Express-C.</li>
		<li>Change the username and password for the datasource, and add ServerName and portnumber
settings.</li>
		<li>The <b>DatabaseName</b> for <b>jdbc/ActiveDS</b> is <tt>activedb</tt>,
and  the <b>DatabaseName</b> for <b>jdbc/ArchiveDS</b> is <tt>archdb</tt>.</li>
	</ul>
	</li>
	<li>Similarly, create <tt><a href="/confluence/download/attachments/93396/db2-mconsole-ds.xml?version=1">db2-mconsole-ds.xml</a></tt>.
<b>DatabaseName</b> in this file is <tt>mcdb</tt>.</li>
	<li>Create the corresponding databases in DB2 Express-C: <b>activedb</b>,
<b>archdb</b> and <b>mcdb</b>.</li>
	<li>Change <tt>var\config\config.xml</tt> for Geronimo to prevent the following
modules from being launched at startup time. This can be done by adding a <tt>Load="false"</tt>
to each module. This will prevent the configuration changes below from causing conflicts.
	<ul>
		<li>org.apache.geronimo.plugins.monitoring/agent-ds/2.2-SNAPSHOT/car</li>
		<li>org.apache.geronimo.plugins.monitoring/agent/2.2-SNAPSHOT/car</li>
		<li>org.apache.geronimo.plugins.monitoring/mconsole-ds/2.2-SNAPSHOT/car</li>
		<li>org.apache.geronimo.plugins.monitoring/mconsole-tomcat/2.2-SNAPSHOT/car</li>
	</ul>
	</li>
	<li>Start the server and deploy the plans using the deploy command.
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>deploy.bat deploy ..\repository\org\tranql\tranql-connector-db2-xa\1.3\tranql-connector-db2-xa-1.3.rar
&lt;plan_path&gt;:\db2-agent-ds.xml
deploy.bat deploy ..\repository\org\tranql\tranql-connector-db2-xa\1.3\tranql-connector-db2-xa-1.3.rar
&lt;plan_path&gt;:\db2-mconsole-ds.xml
</pre>
</div></div>
<p>where &lt;plan_path&gt; is the directory where your plans are placed.</p></li>
	<li>Shutdown the server and change <tt>var\config\artifact_aliases.properties</tt>
file to replace default modules. In this way Geronimo will load DB2 datasources at startup
time instead of the default ones.
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>org.apache.geronimo.plugins.monitoring/agent-ds/2.2/car=org.apache.geronimo.plugins.monitoring/db2-agent-ds/2.2/car

org.apache.geronimo.plugins.monitoring/mconsole-ds/2.2/car=org.apache.geronimo.plugins.monitoring/db2-mconsole-ds/2.2/car
</pre>
</div></div></li>
	<li>In <tt>var\config\config.xml</tt>, load <tt>org.apache.geronimo.plugins.monitoring/agent/2.2/car</tt>
and <tt>org.apache.geronimo.plugins.monitoring/mconsole-tomcat/2.2/car</tt> at
startup time. This can be done by removing the <tt>Load="false"</tt> for each
module.</li>
</ol>





     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/GMOxDOC22/Configuring+your+own+Monitoring+Plugin+DataSource">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=93396&revisedVersion=8&originalVersion=7">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/GMOxDOC22/Configuring+your+own+Monitoring+Plugin+DataSource?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message