Core Admin Sample Scripts

The sample scripts provide a simple and fast way to run the core Admin samples.

These are bash scripts. On Windows, install Cygwin64.

Admin scripts are located in the following folders: $BW_HOME/samples/core/admin and $BW_HOME/scripts/admin

For information about running the sample scripts, see the "Running Admin Sample Scripts" section in the TIBCO ActiveMatrix BusinessWorks™ Getting Started guide.

This sets the TIBCO_HOME, BW_HOME, TEA_HOME, EMS_HOME, and JAVA_HOME environment variables necessary to run the admin scripts.

All scripts support the -h and command-line argument with full documentation of what each script does.

Location of the Admin Scripts

The admin scripts are located in the following folders:

  • The sample scripts are located in $BW_HOME/samples/core/admin
  • The scripts that are generic for Activematrix BusinessWorks™ are located in $BW_HOME/scripts/admin

The scripts are updated to rely on the PATH setting to find the generic scripts. To make this easier to configure, after installation you can generate $BW_HOME/scripts/bashrc.sh that can be sourced from your ~/.bashrc.

Source the $BW_HOME/scripts/bashrc.sh to setup the following environment variables required to run the scripts mentioned in the table below:

Variable Required
TIBCO_HOME Yes
BW_HOME Yes
TEA_HOME No. But required if you run TIBCO® Enterprise Administrator on this machine.
EMS_HOME No. But required if Enterprise Message Service™ is configured on this machine.
PATH This variable is auto-populated based on the values set for the above variables.

Core Admin Scripts

The following table lists some of the available scripts; browse the folder to see the complete list.

Core Admin Scripts
Script Description Script Location
AppManage.sh This is a ActiveMatrix BusinessWorks™ 6.x utility program that emulates ActiveMatrix BusinessWorks™ 5.x AppManage commands.

The main purpose of this utility is to demonstrate how the AppManage commands from ActiveMatrix BusinessWorks™ 5.x translate to corresponding TIBCO ActiveMatrix BusinessWorks 6.x bwadmin commands.

This utility creates a cmd/AppManage_deploy.cmd folder that contains bwadmin commands and uses bwadmin -f cmd/AppManage_deploy.cmd to run it.
Note: Not all AppManage commands are implemented in this emulation utility.

ActiveMatrix BusinessWorks™ Augmented Options:

  • -appSpace or - a - AppSpace name to be used for Application lifecycle.
  • -profile or -p - Configuration Profile to use for deployment. This profile must be available in the EAR file.
  • -profileFile- Configuration Profile file to use for deployment.
  • -debug - Turn on debug tracing for this utility.
  • -sapp - Single Application per AppSpace deployment mode. Each AppSpace supports only one application deployment.
  • -mapp - Multiple Applications per AppSpace deployment mode. Each AppSpace supports one or more application deployments.
Note: ActiveMatrix BusinessWorks™ supports both -sapp and -mapp modes. The default is -mapp mode.
$BW_HOME/samples/core/admin
bootstrap.sh Usage: bootstrap.sh [-h|-help] [-clean] [-forceClean|-force|- forceclean]

This utility is a wrapper script around the following scripts:

  • killtea.sh
  • killbwagent.sh
  • teaclean.sh only if -clean or -forceClean options is used.
  • bwclean.sh if and only if -clean or -forceClean options is used.
  • genbwagentini.sh
  • tea.sh
  • bwagent.sh
  • registeragent.sh

[-h] or [-help] - Prints this usage message.

-clean Cleans TIBCO Enterprise Administrator Server Data Store and ActiveMatrix BusinessWorks™ Domain Data Store.

Note: The -clean command on the data store is not reversible, so back up your data stores before using the command. Use this option carefully, as you may lose all your configurations if you do not have a backup.

-forceClean Same as -clean, except it avoids prompting user to confirm with clean.

-force Same as -forceClean

-forceclean Same as -forceClean

This script assumes that the following products are installed correctly and the environment variables are set accordingly:

TIBCO_HOME = TIBCO_HOME directory where you installed ActiveMatrix Businessworks™.

TEA_HOME = Parent directory to TIBCO Enterprise Administrator's /bin directory.

Supports generation of bwagent.ini file for either Database/ TIBCO EMS™, or Database/ TIBCO FTL® as the technology type.

$BW_HOME/scripts/admin
bounce.sh This utility does the following:
  1. Stops TIBCO Enterprise Administrator Server and bwagent Processes.
  2. Restarts TIBCO Enterprise Administrator Server and bwagent Processes.
  3. Registers bwagent to TIBCO Enterprise Administrator Server.

[-h] or [-help] - Prints this help message and exits.

$BW_HOME/scripts/admin
bounceagent.sh Kills and restarts bwagent Process.

[-h] or [-help] - Prints this help message and exits.

$BW_HOME/scripts/admin
bwadmin.sh This is a utility script that wraps around the bwadmin executable.

[-h] or [-help] - Prints this help message and exits.

[-network <bwagent Network Name>] - Connects to a named bwagent Network. This is an optional argument.

By default, this script uses $BW_HOME/config/bwagent.ini

[<bwadminArgs> ...] - Use bwadmin to run commands found in the input files.

Start bwadmin in the interactive mode if cmdFile is not specified.

A bwagent Network Name is a named directory under ${TIBCO_HOME}/bw/networks and contains the corresponding bwagent.ini.

How to Set Up a Newly Named Network

  1. Obtain a bwagent.ini created for the named bwagent network. For example, a named network called "acmeNetwork"
  2. Create the acmeNetwork directory under ${TIBCO_HOME}/bw/networks. For example, mkdir ${TIBCO_HOME}/bw/networks/acmeNetwork
  3. Copy bwagent.ini to the above directory.
  4. Rerun bwadmin.sh -network acmeNetwork
$BW_HOME/scripts/admin
bwagent.sh This script starts bwagent in the background and waits until it is fully initialized, or the maxWait time (<n> * 2 sec) expires.

[-h] or [-help] - Prints this usage message.

[-network <Network>] - Starts up bwagent using the configuration of a named network.

[-maxWait <n>] - Maximum amount of wait time (2 sec increment) for bwagent start up success.

The dDefault value for <n> is 30, which means 30 * 2 sec = 60 seconds

$BW_HOME/scripts/admin
bwclean.sh This utility script cleans up ActiveMatrix BusinessWorks™ Domain Data and internal Data Store. The end effect of this clean up is similar to a fresh installation of ActiveMatrix BusinessWorks™.

[-force] or [-forceClean] - Proceeds with wiping ActiveMatrix BusinessWorks™ Domain Data and internal Data Store without prompting user reconfirmation.

By default, the script prompts user confirmation.

$BW_HOME/scripts/admin
configureBWEngineGroup.sh

This utility configures AppNodes in a Domain/AppSpace to form a fault-tolerant group and cross engine persistence

[-h] or [-help] - Prints this usage message.

[-c] or [-clean] - Cleans up and drops all the previously configured database tables.

Use this option carefully. This operation cannot be undone. Do not specify both -setup and -cleanup on the same run.

[-s] or [-setup] - Does the one time setup of bwengine Database. When this option is used, -domain and -appspace arguments are not needed and are not used even if specified. ${BW_HOME}/config/sqlscripts/<dbtype>/create.sql is used to set up the database tables and configuration.

[-b] or [-bootstrap] - Does clean up then setup.

[-t] or [-dbtype] - This is the default value is postgresql.

-cf <config.sh> - Sources configuration from the specified <config.sh> file.

By default, <$BW_HOME>/scripts/admin/config/bwengine-group-<dbtype>.sh

[-d] or [-domain] - Domain Name

[-a] or [-appspace <appspace>] - AppSpace Name. All AppNodes in the specified Domain and AppSpace will be configured to form a Fault-Tolerant group and across engine persistence.

$BW_HOME/scripts/admin
deploy.sh Usage: deploy.sh -ear <EARFile> [-h|-help] [-domain <DomainName>] [-appspace <AppSpaceName>] [-redeploy|-force] [-profile <Profile>]

Deploys the specified ActiveMatrix BusinessWorks™ EAR File into -domain <DomainName> -appspace <AppSpaceName>

[-h] or [-help]- Prints this help message.

-ear <EARFile> - Enterprise Archive file to deploy

[-domain <DomainName>] - Domain Name - Optional parameter

If it is not specified, DomainName is computed from ${USER}-Domain

This utility creates the Domain if it does not already exist.

[-appspace <AppSpaceName>] - AppSpace Name - Optional parameter

If it is not specified, AppSpaceName is computed from the name of the EAR file.

This utility creates the AppSpace and AppNode if they do not already exist.

[-redeploy|-force] - Redeploy if the application has been previously deployed.

The application is not redeployed if it already exists and this option is not specified.

[-profile <Profile>] : Profile name to use for this deployment.

If it is not specified, the default Profile as packaged in the Enterprise Archive file is used.

[-mapp] - Optional flag to set Multiple Applications per AppSpace Mode. This is the default mode for ActiveMatrix BusinessWorks™.

[-debug] - Prints debug tracing for this script ./deploy.sh

$BW_HOME/scripts/admin
genbwagentini.sh This script auto generates ${BW_HOME}/config/bwagent.ini based on configurations defined in ./config/bwadmin-default- config.sh

-h or -help - Prints this help message.

The following variables are required from ./config/bwadmin-default- config.sh:

  • BWAgentNetworkName - Name of BWAgent Network.
  • BWMachines - Defined as a list of machine names (as obtained through hostname -f). If you have only one machine to configure, do not add it to this list because this script auto-configures it as a standalone BWAgent Network.

This script uses hostname -f to determine the name of the machine it is run on. It then determines whether this machine is in the BWMachines list.

You can assume that the discoveryURL of the bwagent.ini is comparable to that of a Database Server's URL, and BWAgentNetworkName is then comparable to the Database Name. You can configure both to uniquely access the specific instance of the Database.

If the KEEP_BWAGENT_INI environment variable is defined, bwagent.ini generation is skipped.

You can edit either the ./config/bwadmin-default- config.sh file, or make a copy of it, edit it, and then set environment variable BWADMIN_CONFIG to point to it. For example, export BWADMIN_CONFIG=~/config/bwadmin-my-config.sh

Generates bwagent.ini file for either Database/EMS, or Database/ TIBCO FTL® as the technology type.

$BW_HOME/scripts/admin
kill.sh Kills all processes that match the specified <process name>

-h or -help - Prints this help message.

<process name> - name of the process you want to kill. This script kills all instances of the pid that matches this name.

$BW_HOME/scripts/admin
killall.sh This script finds and kills all instances of processes that match the following names:
  • tea
  • bwagent
  • bwappnode
  • bwadmin

-h or -help - Prints this help message.

$BW_HOME/scripts/admin
killbwagent.sh This script finds and kills all instances of processes that match "bwagent" .

-h or -help - Prints this help message.

$BW_HOME/scripts/admin
killbwappnodes.sh This script finds and kills all instances of processes that match "bwappnode".

-h or -help - Prints this help message.

$BW_HOME/scripts/admin
killtea.sh This script finds and kills all instance of processes that matches "tea".

-h or -help - Prints this help message.

$BW_HOME/scripts/admin
killtibemsd64.sh This script finds and kills all instances of processes that match "tibemsd".

-h or -help - Prints this help message.

$BW_HOME/scripts/admin
recreatedb.sh This script cleans up and recreates the Postgres DB needed by ActiveMatrix BusinessWorks™ BookStore REST sample located in: ${BW_HOME}/samples/binding/rest/BookStore

-h and -help - Prints this help message.

$BW_HOME/samples/core/admin
registeragent.sh This utility registers the local bwagent with TIBCO Enterprise Administrator server.

-h or -help - Prints this help message.

This utility assumes that the following environment variables have been set:

export TIBCO_HOME="<Where ActiveMatrix BusinessWorks™ is installed>"

At least one of the following environment variable is set:

export TEA_HOME="Where TIBCO Enterprise Administrator is installed in the form of $TIBCO_HOME/tea/<version>"

Or,

export TEA_HOSTNAME=<HostName>

If TEA_HOSTNAME environment variable is set, it assumes the TIBCO Enterprise Administrator server is running remotely from the local bwagent instance.

If TEA_HOSTNAME environment variable is not set, this script registers the local bwagent to the locally running TIBCO Enterprise Administrator server.

$BW_HOME/scripts/admin
runAcme.sh Creates <domain> and deploys all EAR files found under ${BW_HOME}/samples/core/admin/ears/acme.

-h or -help : Displays this usage message

<domain> - can be "Acme-QA-Domain" or "Acme-UAT-Domain". When not specified, the default is "Acme-QA-Domain"

<mode> - [-sapp ] or [-mapp]

-sapp- Single App AppSpace deployment mode. Each AppSpace supports only one application deployment.

-mapp - Multiple App AppSpace deployment mode. Each AppSpace supports one or more application deployment.
Note: ActiveMatrix BusinessWorks™ supports both -sapp and -mapp modes. The default is -mapp mode.
This script dynamically creates a bwadmin command file in cmd/<domain>-<mode>.cmd and executes it.
$BW_HOME/samples/core/admin
runAll.sh This utility is a wrapper script that performs the following:
  • bootstrap.sh - only if running in a single machine setup
  • runBookStore.sh
  • runSamples.sh
  • runAcme.sh -domain Acme-QA-Domain
  • runAcme.sh -domain Acme-UAT-Domain

-h or -help - Displays this usage message and exits

-clean - Cleans the TIBCO Enterprise Administrator Server Data Store and ActiveMatrix BusinessWorks™ Domain Data Store.

These data store clean is not reversible. Make sure you back up your data stores before running this command. Use this option with utmost care, otherwise you risk losing all your configurations.

-forceClean - Same as -clean, except it avoids prompting you to confirm with clean.

-force - Same as -forceClean

<mode> - [-sapp | -mapp]

-sapp - Single Application per AppSpace deployment mode. Each AppSpace supports only one application deployment.

-mapp - Multiple Applications per AppSpace deployment mode. Each AppSpace supports one or more application deployments.
Note: ActiveMatrix BusinessWorks™ supports both -sapp and -mapp modes. The default is -mapp mode.

Generates the bwagent.ini file for either Database/EMS™, or Database/FTL® technology type.

$BW_HOME/samples/core/admin
runBookStore.sh Creates BookStore-Domain and deploys all EAR files found under ${BW_HOME}/samples/core/admin/ ears/bookstore

-h or -help - Displays this usage message.

<mode> - [-sapp | -mapp]

-sapp - Single Application per AppSpace deployment mode. Each AppSpace supports only one application deployment.

-mapp - Multiple Application per AppSpace deployment mode. Each AppSpace supports one or more application deployments.

ActiveMatrix BusinessWorks™ supports both -sapp and -mapp modes. The default is -mapp mode.

Note: This script dynamically creates a bwadmin cmd file in cmd/Samples-Domain-<mode>.cmd and executes it.
$BW_HOME/samples/core/admin
runSamples.sh Creates Samples-Domain and deploys all EAR files found under ${BW_HOME}/samples/core/admin/ ears/samples

-h or -help - Displays this usage message.

<mode> : [-sapp] or [-mapp]

-sapp : Single Application per AppSpace deployment mode. Each AppSpace supports only one application deployment.

-mapp : Multiple Application per AppSpace deployment mode. Each AppSpace supports one or more application deployments.

Note: ActiveMatrix BusinessWorks™ supports both -sapp and -mapp modes. The default is -mapp mode. This script dynamically creates a bwadmin command file in cmd/Samples-Domain-<mode>.cmd and executes it.
$BW_HOME/samples/core/admin
showprocs.sh Shows process ID and complete binary path of all processes required in ActiveMatrix BusinessWorks™:
  • tibemsd
  • tea
  • bwagent
  • bwappnode
  • bwadmin
$BW_HOME/scripts/admin
tea.sh This script starts TIBCO Enterprise Administrator in the background and waits until it is completely initialized, or the maxWait time (<n> * 2 sec) expires.

-h or -help - Prints this usage message.

[-maxWait <n>] - Max number of wait time (2 sec increment) for TIBCO Enterprise Administrator Server startup success.

The default value for <n> is 30, which means 30 * 2 sec = 60 seconds.

$BW_HOME/scripts/admin
teaclean.sh This utility script cleans TIBCO Enterprise Administrator Server's configuration data store.

The end effect of this clean up is similar to a fresh installation of TIBCO Enterprise Administrator.

-h or -help - Prints this usage message

-force or -forceClean - Proceeds with wiping ActiveMatrix BusinessWorks™ Domain Data and internal data store without prompting user reconfirmation.

By default, the script prompts user confirmation.

$BW_HOME/scripts/admin
tibemsd64.sh This script starts tibemsd64 in the background and waits until it is completely initialized, or the maxWait time (<n> * 2 sec) expires.

-h or -help - Prints this usage message

[-maxWait <n>] - Max number of wait time (2 seconds increment) for tibemsd64 start up success.

The default value for <n> is 30, which means 30 * 2 sec = 60 seconds.

This script is only supported on UNIX based systems.

For Windows, use Windows Systems Services to start or stop tibemsd64.

$BW_HOME/scripts/admin
Note: Each runAcme.sh, runBookStore.sh, runSamples.sh, deploy.sh, and AppManage.sh generates bwadmin commands before execution.

The generated bwadmin command files are found under cmd subdirectory.