[Top] [Prev] [Next] [Bottom]

4. Connecting Domains


What This Chapter Is About

This chapter describes how to hook BEA TUXEDO system applications together as communicating /TDOMAINs. We want to make it clear at the outset that while this discussion refers to sample programs delivered with the BEA TUXEDO system software (and add-ons), we are describing the steps in a process, not documenting sample programs presently delivered with the Domains software.

The Principal Sections of the Chapter

This chapter contains the following sections:

The Starting Point: Two BEA TUXEDO Applications

Suppose a company has developed the two BEA TUXEDO system applications shown in Figure 4-1.

Figure 4-1 Two BEA TUXEDO System Applications

bankapp and the Credit Authorization Application

The applications shown in Figure 4-1 are known as bankapp and the Credit Authorization application. bankapp is distributed as a sample application with the BEA TUXEDO software. It can be found in $TUXDIR/apps/bankapp, and is documented in the BEA TUXEDO Application Development Guide. Be sure to take a close look at the configuration file for implementing bankapp as a multiprocessor application: $TUXDIR/apps/bankapp/ubbmp.

The Credit Authorization application is described in more detail later in this chapter. For the time being, we ask you to think of it only as a hypothetical extension of bankapp.

The Need to Intercommunicate

In the course of time our hypothetical business organization has come to realize that their customers would be better served if the bankapp application could communicate directly with the Credit Authorization application. That way they could offer instant credit cards to anyone opening a new account.

In the remainder of this chapter we are going to look at two solutions to this problem.

Solution 1: Reconfigure the Applications

The first solution is to combine two BEA TUXEDO system applications into one, as shown in Figure 4-2.

Figure 4-2 Combining Two BEA TUXEDO System Applications

In the process of combining the two applications into a single configuration, the following changes are made:

Configuration File to Combine the Sample Applications

Listing 4-1 shows a possible configuration file for the combined applications. A similar config file (differing only in the network address) must be installed on each machine of the application.

Listing 4-1 Sample Configuration File for the Combined Application
*RESOURCES
IPCKEY 76666
UID 0000
GID 000
PERM 0660
MAXACCESSERS 40
MAXSERVERS 35
MAXSERVICES 75
MAXCONV 10
MASTER SITE1,SITE2
SCANUNIT 10
MODEL MP
LDBAL Y
OPTIONS LAN,MIGRATE
MAXGTT 100
MAXBUFTYPE 16
SCANUNIT 10
SANITYSCAN 5
DBBLWAIT 6
BBLQUERY 50
BLOCKTIME 2
#
#
*MACHINES
#
mach1 LMID=SITE1
TUXDIR="/home/mylogin/tuxroot"
APPDIR="/home/mylogin/bankapp"
ENVFILE="/home/mylogin/bankapp/ENVFILE"
TLOGDEVICE="/home/mylogin/bankapp/TLOG"
TLOGNAME=TLOG
TUXCONFIG="/home/mylogin/bankapp/tuxconfig"
ULOGPFX="/home/mylogin/bankapp/ULOG"
TYPE="type1"
#
mach2 LMID=SITE2
TUXDIR="/home/mylogin/tuxroot"
APPDIR="/home/mylogin/bankapp"
ENVFILE="/home/mylogin/bankapp/ENVFILE"
TLOGDEVICE="/home/mylogin/bankapp/TLOG"
TLOGNAME=TLOG
TUXCONFIG="/home/mylogin/bankapp/tuxconfig"
ULOGPFX="/home/mylogin/bankapp/ULOG"
TYPE="type2"
#
mach3 LMID=SITE3
TUXDIR="/home/mylogin/tuxroot"
APPDIR="/home/mylogin/bankapp"
ENVFILE="/home/mylogin/bankapp/ENVFILE"
TLOGDEVICE="/home/mylogin/bankapp/TLOG"
TLOGNAME=TLOG
TUXCONFIG="/home/mylogin/bankapp/tuxconfig"
ULOGPFX="/home/mylogin/bankapp/ULOG"
TYPE="type2"
#
mach4 LMID=SITE4
TUXDIR="/home/mylogin/tuxroot"
APPDIR="/home/mylogin/bankapp"
ENVFILE="/home/mylogin/bankapp/ENVFILE"
TLOGDEVICE="/home/mylogin/bankapp/TLOG"
TLOGNAME=TLOG
TUXCONFIG="/home/mylogin/bankapp/tuxconfig"
ULOGPFX="/home/mylogin/bankapp/ULOG"
TYPE="type1"
#
*GROUPS
#
DEFAULT: TMSNAME=TMS_SQL TMSCOUNT=2
BANKB1 LMID=SITE1 GRPNO=1
OPENINFO="TUXEDO/SQL:/home/mylogin/bankapp/bankdl1:bankdb:readwrite"
BANKB2 LMID=SITE2 GRPNO=2
OPENINFO="TUXEDO/SQL:/home/mylogin/bankapp/bankdl2:bankdb:readwrite"
BANKB3 LMID=SITE3 GRPNO=3
OPENINFO="TUXEDO/SQL:/home/mylogin/bankapp/bankdl3:bankdb:readwrite"
BANKB4 LMID=SITE4 GRPNO=4
OPENINFO="TUXEDO/SQL:/home/mylogin/bankapp/bankdl4:bankdb:readwrite"
#
#
*NETWORK
#
SITE1 NADDR="<network address of SITE1>"
BRIDGE="<device of provider1>"
NLSADDR="<network listener address of SITE1>"
SITE2 NADDR="<network address of SITE2>"
BRIDGE="<device of provider2>"
NLSADDR="<network listener address of SITE2>"
SITE3 NADDR="<network address of SITE3>"
BRIDGE="<device of provider3>"
NLSADDR="<network listener address of SITE3>"
SITE4 NADDR="<network address of SITE4>"
BRIDGE="<device of provider4>"
NLSADDR="<network listener address of SITE4>"
#
*SERVERS<

Limitations of This Solution

Solution 2: Redefine the Applications as /TDOMAINS

Figure 4-3 shows the combined application reconfigured as four /TDOMAINs. (Three of the domains are in the left-hand circle.)

Figure 4-3 Picture of the Domain Configuration

Changes to the BEA TUXEDO System Configuration Files

To reconfigure the combined application as /TDOMAINs, make the following changes to the UBBCONFIG files:

Listing 4-2 shows a sample converted UBBCONFIG file.

Listing 4-2 A Converted UBBCONFIG File
*RESOURCES
IPCKEY 76666
UID 7901
GID 601
PERM 0660
MAXACCESSERS 40
MAXSERVERS 35
MAXSERVICES 75
MAXCONV 10
MASTER SITE1
SCANUNIT 10
MODEL SHM
LDBAL Y
MAXGTT 100
MAXBUFTYPE 16
SCANUNIT 10
SANITYSCAN 5
BBLQUERY 50
BLOCKTIME 2
#
*MACHINES
sfexpz LMID=SITE1
TUXDIR="/home/mylogin/tuxroot"
APPDIR="/home/mylogin/creditapp"
ENVFILE="/home/mylogin/creditapp/ENVFILE"
TLOGDEVICE="/home/mylogin/creditapp/TLOG"
TLOGNAME=TLOG
TUXCONFIG="/home/mylogin/creditapp/tuxconfig"
ULOGPFX="/home/mylogin/creditapp/ULOG"
TYPE="type1"
#
#
#
*GROUPS
DEFAULT: LMID=SITE1
BANKB1 GRPNO=1 TMSNAME=TMS_SQL TMSCOUNT=2
OPENINFO="TUXEDO/SQL:/home/mylogin/creditapp/crdtdl1:bankdb:readwrite"
BANKB2 GRPNO=2
BANKB3 GRPNO=3
BANKB4 GRPNO=4
DMADMGRP LMID=mach1 GRPNO=5
#
#
#
*SERVERS
#
DEFAULT: RESTART=Y MAXGEN=5 REPLYQ=Y CLOPT="-A"
GWADM SRVGRP=BANKB2 SRVID=30
REPLYQ = Y RESTART = Y GRACE = 0
GWTDOMAIN SRVGRP=BANKB2 SRVID=31
REPLYQ = Y RESTART = Y GRACE = 0
GWADM SRVGRP=BANKB3 SRVID=24
REPLYQ = Y RESTART = Y GRACE = 0
GWTDOMAIN SRVGRP=BANKB3 SRVID=25
REPLYQ = Y RESTART = Y GRACE = 0
GWADM SRVGRP=BANKB4 SRVID=20
REPLYQ = Y RESTART = Y GRACE = 0
GWTDOMAIN SRVGRP=BANKB4 SRVID=21
REPLYQ = Y RESTART = Y GRACE = 0
DMADM SRVGRP="DMADMGRP" SRVID=50
REPLYQ = N RESTART = Y GRACE = 0
TLRA SRVGRP=BANKB1 SRVID=2 CLOPT="-A -- -T 100"
BTADD SRVGRP=BANKB1 SRVID=3
ACCTA SRVGRP=BANKB1 SRVID=4
CRDT SRVGRP=BANKB1 SRVID=5
CRDTA SRVGRP=BANKB1 SRVID=6
*SERVICES
DEFAULT: LOAD=50
INQUIRYA PRIO=50
WITHDRAWALA PRIO=50
OPEN_ACCT2 PRIO=40
OPENC PRIO=40
OPENCA PRIO=40
CLOSECA PRIO=40
BR_ADD PRIO=20
TLR_ADD PRIO=20

Adding DMCONFIG Files

You also need to make four DMCONFIG files. A sample is shown in Listing 4-3.

Listing 4-3 Sample DMCONFIG File
#
#
*DM_LOCAL_DOMAINS
#
#
QDOM1 GWGRP=BANKB2
TYPE=TDOMAIN
DOMAINID=QDOM1
BLOCKTIME=10
MAXDATALEN=56
MAXRDOM=89
DMTLOGDEV="/home/mylogin/creditapp/DMTLOG"
AUDITLOG="/home/mylogin/creditapp/AUDITLOG"
QDOM2   GWGRP=BANKB3
TYPE=TDOMAIN
DOMAINID=QDOM2
BLOCKTIME=10
MAXDATALEN=56
MAXRDOM=89
DMTLOGDEV="/home/mylogin/creditapp/DMTLOG"
AUDITLOG="/home/mylogin/creditapp/AUDITLOG"
DMTLOGNAME="DMTLOG_TDOM2"
QDOM3 GWGRP=BANKB4
TYPE=TDOMAIN
DOMAINID=QDOM3
BLOCKTIME=10
MAXDATALEN=56
MAXRDOM=89
DMTLOGDEV="/home/mylogin/creditapp/DMTLOG"
AUDITLOG="/home/mylogin/creditapp/AUDITLOG"
DMTLOGNAME="DMTLOG_TDOM3"
#
*DM_REMOTE_DOMAINS
#
#
TDOM1 TYPE=TDOMAIN
DOMAINID=TDOM1
TDOM2   TYPE=TDOMAIN
DOMAINID=TDOM2
TDOM3   TYPE=TDOMAIN
DOMAINID=TDOM3
#
#
*DM_TDOMAIN
#
QDOM1 NWADDR="0x0002DEEF93026927"
NWDEVICE="/dev/tcp"
QDOM2 NWADDR="0x0002BEEF93026927"
NWDEVICE="/dev/tcp"
QDOM3 NWADDR="0x0002CEEF93026927"
NWDEVICE="/dev/tcp"
TDOM1 NWADDR="0x0002DEEF93026947"
NWDEVICE="/dev/null"
TDOM2 NWADDR="0x0002BEEF9302691D"
NWDEVICE="/dev/tcp"
TDOM3 NWADDR="0x0002CEEF9302690E"
NWDEVICE="/dev/tcp"
#
#
#
*DM_LOCAL_SERVICES
#
#
WITHDRAWALA
INQUIRYA
OPENCA
CLOSECA

Sample /TDOMAIN Application: creditapp

A sample application, creditapp, is distributed with the software. creditapp is a runnable version of the hypothetical application that was the basis for the discussion above.

The application is located in $TUXDIR/apps/creditapp. It includes the files shown in Listing 4-4.

Listing 4-4 creditapp Files
ACCT.ec       ACCTA.ec      AUDITC.c      BAL.ec       BALANCE.m
BALANCEA.m BALC.ec BTADD.ec CBALANCE.m CCLOSE.m
CDEPOSIT.m CLOSE.m COPEN.m CRDT.ec CRDTA.ec
CRMENU.m CRMENU2.m CTRANSFER.m CWITHDRAW.m DEPOSIT.m
DEPOSITA.m FILES HCBALANCE.m HCCLOSE.m HCLOSE.m
HCOPEN.m HCWITHDRAW.m HELP.m HOPEN.m OPEN.m
README RUNME RUNME.sh SETUP.sh TLR.ec
TLR1.ec TLR2.ec TLR3.ec TLRA.ec TRANSFER.m
WITHDRAW.m WITHDRAWA.m XFER.c appinit.c aud.h
aud.v audit.c auditcon.c bank.flds bank.flds.h
bank.h cleanup.sh crbank.sh crbankdb.sh crdt_app.mk
crdt_app2.mk crdt_app3.mk crdt_app4.mk crdt_flds.h crdtvar
crdtvar2 credit.flds crtlog.sh crtlog2 crtlog2.sh
domcon1 domcon2 domcon3 domcon4 driver.sh
envfile.sh gendata.c gentran.c hostmk listnr
populate.sh run.sh setenv ubbdom1 ubbdom2
ubbdom3 ubbdom4 util.c

Listing 4-5 is a version of the README file from the creditapp directory. The README file documents a script that installs and runs creditapp. It has been edited to include a few things that are not in the original script.

Listing 4-5 README File for creditapp
SIMPLE BUILD PROCEDURE
The creditapp application is an enhancement of the
bankapp and hostapp applications.
The creditapp application is designed to be a four domain application,
so the software must be built on four machines. The RUNME.sh
script will lead you through the necessary steps.
 
Step 1: Copy the Software for creditapp.
Make a new directory under your $HOME directory and copy all of
the source files from <TUXDIR>/apps/creditapp into that directory.
TUXDIR is the root directory under which your BEA TUXEDO System
software is installed. We call the new directory
$HOME /creditapp. The rest of the steps in this procedure are
done in the directory $HOME/creditapp.
 
Step 2: On each of the remaining three machines:
Make a directory creditapp in a directory that can be used for the application.
We call this directory $HOME/creditapp.
Make a note of the full directory path for $HOME/creditapp and TUXDIR
for each machine. These will be needed by the RUNME.sh script.
 
Step 3: On the "master site" execute the "RUNME.sh" script.
The shell script "RUNME.sh" is an interactive program designed to
lead you through initialization, booting, shutdown and cleanup
of the four domain creditapp application. The shell is interactive
and requires no command line arguments. All you need in the directory
is the source from the TUXDIR/apps/creditapp directory that you
copied in Step 1.
You will be prompted to enter values for RSH and RCP
environment variables, or accept the defaults.
IT IS VERY IMPORTANT THAT VALUES FOR RSH AND RCP BE ENTERED AS THEY ARE
USED TO REMOTE COPY AND EXECUTE THE NECESSARY SCRIPTS.
The following environment variables are important. The script picks up
the values for TUXDIR and APPDIR from your environment and
prompts you (in OPTION 4) for BLKSIZE:
TUXDIR         Root directory of the BEA TUXEDO System where you have
installed the software.
APPDIR          Directory in which the creditapp application resides.
crdtvar.dm1 initially is set to allow this to default
to the current working directory, which agrees with
our intention to use $HOME/creditapp. This is the
directory into which you copied the creditapp files in
Step 1.
BLKSIZE         Logical blocksize for the database in bytes.
Must be an integral multiple of the physical
page size of the computer (for example, 512 bytes or 4096 bytes).
When you invoke RUNME.sh you are shown a menu with 10 options (11 counting "quit").
Here is the list of choices:
          1) Initialize configuration files and makefiles.
2) Copy files to remote sites.
3) Build crdtapp clients and servers.
4) Create databases.
5) Generate binary tuxconfig and bdmconfig files.
6) Create Transaction Log file.
7) Boot the application.
8) Populate the database.
9) Shutdown the application.
10) Cleanup IPC Resources, database files and log files.
q) Quit.
To go through the complete process of building and running the sample
application, start with choice No. 1. When the script completes a step,
the menu is displayed for your next choice.
 
OPTION 1. Initialize configuration files and makefiles.
This option sets up makefiles, UBBCONFIG and DMCONFIG files that are
necessary for the application.
          All questions must be answered.
          ENTER the system name: enter uname for machines you are using
beginning with the current machine you are on.
 
ENTER TUXDIR for each machine.
          ENTER APPDIR for each machine.
 
Continue to answer all queries.
 
An example of 4 hexadecimal digits may be (beef, cfff, 6774, aeef). NOTE: EACH MACHINE MUST HAVE A UNIQUE HEX SEQUENCE.
 
OPTION 2. Copies the files to the other domains in the configuration.
 
OPTION 3. Builds clients and servers on all machines.
          NOTE: CAREFULLY CHECK THAT THE BUILDS ARE COMPLETED SUCCESSFULLY ON
EACH SITE. IF NECESSARY YOU MAY RUN THE BUILD YOURSELF.
                ON THE SPECIFIC SITE ENTER
nohup make -f CRDT{$MACH}.mk2
                where ${MACH} is the uname for the machine you are building on.
For example,
                        nohup make -f CRDTtux1.mk2
 
OPTION 4. Builds the databases on each site.
          NOTE: ON EACH SITE MAKE SURE THE BLKSIZE VALUE IN files
                crdt${MACH}.dm1 for the primary site
                or crdt${MACH}.dm2 for the remote sites
                where ${MACH} is the uname for the machine you are building on
                ARE CORRECT FOR THAT SPECIFIC MACHINE
 
OPTION 5. Generates the tuxconfig and bdmconfig files.
 
All other options are similar to bankapp.
 
After OPTION 8 : Populate the database
                  Enter q to Quit the menu.
RUNNING CREDITAPP.
__________________
 
On each machine a script run.sh exists.
            Execute run.sh.
            run
At the response :
               Is this machine the Credit Card Authorization Center(y/n)?
               If machine is the primary machine answer y .
If machine is any other answer n.
On the primary machine a different menu will be seen than the other 3 machines.
All Credit accounts exist on primary machine and all machines can access any
account.
 
ACCOUNTS 10000000 - 120000000
Machines 2,3,4 are the enhanced bankapp application.
            ACCOUNTS 10000 - 39999 exist on machine 2
ACCOUNTS 40000 - 79999 exist on machine 3
ACCOUNTS 80000 - 109999 exist on machine 4
All processing is done using the /DOMAIN software.
A tail -f of the ULOG###### will show the actual processing of the requests.
On the machine that will process the request enter :
           tail -f ULOG###### where ###### is today's date.



[Top] [Prev]