Dukes Bank on Multiple Nodes

From ControlTier

Jump to: navigation, search

Java duke mascot.jpg This is part of the DukesBank portion of the ControlTier Demo

Contents

Overview

This page describes how to demonstrate the Dukes Bank build and deployment on multiple nodes. This example shows a more realistic configuration scenario one might see in a dev or QA environment. The examples in this demo will show the management of the Dukes Bank when its components are deployed on separate nodes.

The diagram shows six machines divided into three groups. The "admin" group contains the ControlTier server where all centralized commands are performed. The "development" group has the build server and two tests host. Finally, the "staging" group contains just two hosts where the QA app and database servers run.

DukesBank-Multiple-Nodes.png

Expanded operation

Site view

Process flow view

Prerequisites

Ensure you have already completed the following:

Update project definition

Dukes Bank project is defined in two parts:

  1. default-object.xml: This is a template file that contains the configuration model describing how the Dukes Bank components are deployed and tied together. This file stays unchanged. Node locations are maintained in the defaults file below.
  2. defaults-<os.name>.xml: This file defines the default locations of the Dukes Bank deployments, a single node configuration. You can edit this file to specify other nodes.

Edit defaults file

cp $CTL_BASE/modules/DukesBankProjectBuilder/templates/defaults.Linux.xml $CTL_BASE/src

Eg: vi $CTL_BASE/src/defaults.Linux.xml

File listing: defaults.Linux.xml

<?xml version="1.0"?>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Defaults data for DukesBankProjectBuilder generate-resources project XML document.      -->
<!--                                                                                       -->
<!-- Defines a set of objects that implements the Duke's Bank and Hello World sample       -->
<!-- application development and staging environments deployed to one or more systems.     -->
<!--                                                                                       -->
<!-- The target platform is JBoss 4.0 and HSQLDB database and Tomcat 6.                    -->
<!--                                                                                       -->
<!-- Defines deployment and setting type objects as they are first used, and subsequently  -->
<!-- refers to objects by type and name whenever they are needed again.                    -->
<!--                                                                                       -->
<!-- This file can be supplied to the ProjectBuilder "generate-resources" command to load    -->
<!-- sample objects into a project that contains the "content" library's type model.       -->
<!--                                                                                       -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<defaults>
  <default>
    <!-- The default node is the framework node of the Ctl client invoking the -->
    <!-- generate-resources command. (For the default installation this will be  -->
    <!-- "localhost").                                                         -->
    <node>${framework.node}</node>
  </default>

  <!-- The default location of the installation directory for the Duke's Bank    -->
  <!-- and Hello World sample application source files and packages:             -->
  <installroot>${env.CTIER_ROOT}/demo/elements</installroot>

  <!-- The out-of-the box sample applications can be configured to run on        -->
  <!-- from one to six systems. One system must be designated the ControlTier    -->
  <!-- server. This is the system where Workbench and Jobcenter run. Another     -->
  <!-- system is designated as the build box where CruiseControl and the Ant     -->
  <!-- based build are run.                                                      -->
  <!--                                                                           -->
  <!-- One or two boxes are assigned to the development environment. Builds are  -->
  <!-- run here, and the development JBoss instance and "source" HSQLDB database -->
  <!-- instance are deployed here. A fifth and possibly sixth system host the    -->
  <!-- staging environment which includes both JBoss and HSQLDB instances.       -->
  <!--                                                                           -->
  <!-- Note that all these systems can be the same box in which case separate    -->
  <!-- JBoss and HSQLDB server instances are started on separate ports.          -->

  <server>
    <node>${defaults.default.node}</node>
  </server>
  <development>
    <buildserver>
      <scmconnection>
	<dukesbank>https://moduleforge.svn.sourceforge.net/svnroot/moduleforge/elements/branches/3.2.4/demo/DukesBank/src</dukesbank>
      </scmconnection>
      <node>dev-build</node>
    </buildserver>
    <applicationserver>
      <node>dev-app1</node>
    </applicationserver>
    <databaseserver>
      <node>dev-db1</node>
    </databaseserver>
  </development>
  <staging>
    <applicationserver>
      <node>stg-app1</node>
    </applicationserver>
    <databaseserver>
      <node>stg-db1</node>
    </databaseserver>
  </staging>
</defaults>

Generate project data

Use the "generate-resources" command to read the new defaults and regenerate the Dukes Bank project data:

ctl -p demo -t DukesBankProjectBuilder -r dukesbank -c generate-resources -- \
  -defaults $CTL_BASE/src/defaults.Linux.xml -upload

The "-upload" option will load it to the ControlTier server.

Generate job definitions

Use the "generate-jobs" command to read the new defaults and regenerate the Dukes Bank jobs data:

ctl -p demo -t DukesBankProjectBuilder -r dukesbank -c generate-jobs -- \
  -defaults $CTL_BASE/src/defaults.Linux.xml -upload

Update CTL

Run the "create" and "install" actions:

ctl-exec -- ctl-project -p demo -a create
.
.
.
ctl-exec -- ctl-project -p demo -a install
.
.
.


Run Commands

Run a build with a new buildstamp.

Run it from the ControlTier server. Use the "-I" flag to turn on network dispatching

ctl -I ".*" ...

Run Status

Check status in the staging environment.

Run this command on the ControlTier server :

ctl -p demo -t Site  -r stagingDukesBank -c Status 
.
.
.
Personal tools
Namespaces
Variants
Actions
Navigation
Communication
Development
Toolbox
Print/export