The Deployment Framework command utility (dfw)

The main utility for working with the Caplin Deployment Framework is called dfw; you can perform any Framework operation by running the dfw utility with the appropriate command parameter.

Getting started

Before entering any dfw command as ./dfw <command-name>, make sure your current (working) directory is set to the Deployment Framework’s topmost directory.
  • To get a list of all the possible Framework commands, type:

    ./dfw help
  • To get help on how to use a particular Framework command, type:

    ./dfw help <command-name>
  • To run a Framework command, type:

    ./dfw <command-name> <parameters>
  • When you run a dfw command that changes the configuration of any of the components and blades, it displays a message reminding you to restart everything:

The configuration has been updated. The new configuration will not be active
until the Framework is restarted.

Completing dfw commands using the <tab> key

In release 6.2 of the Deployment Framework and later, you can use the <tab> key to complete dfw commands. For how to enable this facility, see Setting up dfw command completion.

When you type

./dfw <tab><tab>

a list of all the dfw commands is displayed.

When you enter a particular command, you can use <tab><tab> to complete the command name. For example:

./dfw star<tab><tab>

echoes as

./dfw start

You can use <tab><tab> to complete a command’s parameters too. For example:

./dfw start Li<tab><tab>

echoes as

./dfw start Liberator

To start Liberator and Transformer ( if they are deployed), you can enter:

./dfw star<tab> Lib<tab> Trans<tab>

You can also use <tab> to complete filenames in dfw commands that take files as parameters

such as deploy and java.

Running dfw in debug mode

If a dfw command returns an error whose cause isn’t immediately apparent from the error messages it displays, you can obtain more information by running the command with the debug option -x. This displays all the commands that are run in the script underlying the dfw command.

-x must be the first option on the command line after ./dfw

For example, say you run the command:

./dfw start <Blade name>

and there’s an error. To obtain more information, run the command again as:

./dfw -x start <Blade name>
When in debug (-x) mode, you can’t complete the command using the <tab> key.

dfw commands

Here are the dfw commands (in alphabetical order).

This list is for release 6.2 of the Deployment Framework. Some commands aren’t available in earlier releases.

Command parameters shown inside square brackets [] are optional.

Click on a command name to get more detail about it:

  • activate <bladename1> <bladename2> …​

  • clean [Liberator] [Transformer] [<AdapterBladename1> <AdapterBladename2> …​] [servers]

  • cleanstart [Liberator] [Transformer] [<AdapterBladename1> <AdapterBladename2> …​] [servers]

  • cmc

  • deactivate [<bladename1> <bladename2> …​]

  • delete [<bladename1> <bladename2> …​]

  • deploy [-f] [<kitname1> <kitname2> …​]

  • dump [Liberator] [Transformer] [<AdapterBladename1> <AdapterBladename2> …​] servers]

  • hosts

  • hosts [<AdapterBladename1>|<AdapterBladename2>|…​|Liberator|Transformer] <primary-host> [<secondary-host>]

  • hosts [all] <primary host> [<secondary host>]

  • info

  • java <JVM-location>

  • java32 <JVM32-location>

  • killAll

  • logs [Liberator] [Transformer] [<AdapterBladename1> <AdapterBladename2> …​] [servers]

  • mon

  • redeploy [-f] [<kitname1> <kitname2> …​]

  • rollback [<kitname1> <kitname2> …​]

  • start [Liberator] [Transformer] [<bladename1> <bladename2> …​] [servers]

  • status

  • stop [Liberator] [Transformer] [<bladename1> <bladename2> …​] [servers]

  • validate

  • versions

  • veryclean [Liberator] [Transformer] [<AdapterBladename1> <AdapterBladename2> …​] [servers]

activate

./dfw activate <bladename1> <bladename2> …​

Activates a blade or blades.

This command stops all the deployed components.

You won’t see the effects of activating the blade(s) until you restart the system (see ./dfw start).

To get the names of all the available blades, use the command ./dfw versions

clean

./dfw clean [Liberator] [Transformer] [<AdapterBladename1> <AdapterBladename2> …​] [servers]

Removes all log files that have been produced by the deployed core components (Liberator and/or Transformer) and active Adapter blades.

This command also stops the specified components.
  • If you don’t give the command any parameters, it stops all the deployed components and active Adapter blades and cleans them.

  • If you specify one or more items (Liberator and/or Transformer and/or one or more Adapter blades) the command just stops and cleans those.

  • If you supply only the parameter called servers, the command just stops the deployed core components (Liberator or Transformer or both) and cleans them.

In Deployment Framework release 6.1 and earlier, when you explicitly or implicitly include Liberator in the command parameters, the command also removes the database files containing information about the Liberator users' licence usage. To do the same in Deployment Framework release 6.2 and later, use the command ./dfw veryclean instead.

cleanstart

./dfw cleanstart [Liberator] [Transformer] [<AdapterBladename1> <AdapterBladename2> …​] [servers]

Stops all the deployed components, removes log files (as for ./dfw clean), and starts the system again.

  • If you don’t give the command any parameters, it stops, cleans, and starts everything.

  • If you specify one or more items (Liberator and/or Transformer and/or one or more Adapter blades) it just stops, cleans, and starts those.

  • If you supply only the parameter called servers, the command stops, cleans, and starts just the deployed core components (Liberator or Transfomer or both).

  • In Deployment Framework release 6.2 and later, the command stops all currently running items first, before restarting them.

    In releases 6.1 and earlier, it stops a running item and immediately restarts it, before moving on to stop and start the next item.

To (re)start the system without removing the log files, use the command ./dfw start

cmc

./dfw cmc

Starts the Caplin Management Console (CMC) if it’s installed and there’s a CMC configuration file available. (Use the command ./dfw mon to create the configuration file.)

If you’re accessing your Deployment Framework on Windows via a Remote Desktop connection to either Cygwin or a Git Bash shell, you must set the correct session name before running the cmc command, as follows:
  1. Run the command

    export SESSIONNAME=Console
  2. If you’ve done that correctly then

    echo "$SESSIONNAME"

    gives the response

    Console

If you forget to do this, the cmc command responds with these error messages:

Error: Cannot start CMC from this terminal
Error: Command <cmc> failed with code <141>

This happens because the default session name when you use Remote Desktop is something like RDP-Tcp#0 whereas the CMC startup command expects it to be Console

If you’re using ssh to access your Deployment Framework on Linux or Mac, you’ll need to make the necessary configuration changes to run X11 apps before running the cmc command.

deactivate

./dfw deactivate [<bladename1> <bladename2> …​]

Deactivates a blade or blades.

This command also stops all the deployed components.

You won’t see the effects of deactivating the blade(s) until you restart the system (see ./dfw start).

To get the names of all the available blades, use the command ./dfw versions

delete

./dfw delete [<bladename1> <bladename2> …​]

Deactivates and deletes a blade or blades.

  • The blade kit isn’t deleted from the archive directory (<Framework-root>/kits/archive/), so you can subsequently retrieve and redeploy the blade if you need to.

  • If a deleted blade has configuration overrides, they’re deactivated but aren’t removed.

This command also stops all the deployed components.

deploy

./dfw deploy [-f] [<kitname1> <kitname2> …​]

Use this command to deploy core components and blade kits. The core components and all blades supplied by Caplin Systems are delivered in kit form. This command unpacks any kits that are in the Framework’s kits directory and any kits provided on the command line, and activates each unpacked blade. When a kit has been deployed from the kits directory, the command moves the kit file to <Framework-root>/kits/archive/ directory.

This command also stops all the deployed components.

If any kit location provided on the command line has spaces in the path, enclose the whole thing in double quotes ("). You can use wildcards in the pathnames.

Use the -f parameter to remove the Framework files relating to older kit versions without the command prompting you. However, if you do remove the files for an older kit version (either using -f or in response to a prompt), you can’t subsequently revert to that kit using the rollback command - you’ll have to redeploy the kit instead.

Also see the redeploy and rollback commands.

dump

./dfw dump [Liberator] [Transformer] [<AdapterBladename1> <AdapterBladename2> …​] [servers]

Stops the system (all the deployed components) and dumps configuration information for each deployed core component (Liberator and/or Transformer) and Adapter blade. The dumped information is in files in directories under global_config/dump. Each dumped file contains every original configuration line with its filename and line number, followed by the same lines with any configuration macros translated to their actual values. All the configuration within any included files is listed in the same way.

Only run the dump command when the Deployment Framework is not in use. This is because the command stops the binaries and then runs them to read the configuration information. It’s particularly important that you don’t use dump on a production system when it’s running.
  • If you don’t give the command any parameters, all the deployed core components and Adapter blades are stopped and their configuration is dumped.

  • If you supply a list of core components and/or Adapter blades, just those components and/or blades are stopped and their configuration is dumped.

  • If you specify the servers parameter, only the deployed core components are stopped and their configuration is dumped.

When you’ve changed the configuration of a production system, we recommend that you run the dump command immediately, before restarting the system. The most up-to-date configuration data will then be readily available if Caplin Support need it to help fix a problem with your running system. If you don’t run dump before restarting, you’ll have to stop the running system to get the configuration needed to diagnose a fault, or copy the configuration manually from the various directories where it’s located.
To dump the configuration to another location, define an environment variable called DFW_DUMP_DIR that specifies the location’s path.

hosts

./dfw hosts

./dfw hosts [<AdapterBladename1>|<AdapterBladename2>|Liberator|Transformer] <primary-host> [<secondary-host>]

./dfw hosts [all] <primary host> [<secondary host>]

Sets the hosts that you want Liberator and/or Transformer and/or particular Adapter blades to run on.

The hosts command updates the hosts-defns.conf file in the Framework’s global_config directory. Use this command rather than editing hosts-defns.conf directly.
  • <primary-host> is the hostname of the server machine in which the specified Adapter blades and/or Liberator and/or Transformer will run. In a simple deployment with no failover, you only need to specify a <primary-host>.

  • <secondary-host> is the hostname of the server machine on which the failover instances of the specified components run. You need to specify a <secondary-host> when you’re setting up a Platform deployment that incorporates failover and/or load balancing.

  • If you don’t supply any parameters, the command displays a list of the currently configured hosts.

  • If the first parameter is all, then the supplied host names are applied to the Liberator, Transformer and all the deployed Adapter blades.

Example:

./dfw all localhost

This sets all your Adapter blades, Liberator and (if deployed) Transformer to start on your machine.

For more about using the hosts command, see Change server hostnames in How Can I…​ Change server-specific configuration.

info

./dfw info

Displays information about the core components (Transformer and/or Liberator) and the currently active blades. This includes:

  • The port numbers used by the core components

  • The port numbers used by the active blades

  • Java configuration information

java

./dfw java <JVM-location-and-name>

Sets up the location and name of the JVM (Java Virtual Machine) for use by Liberator and Transformer and any C-based Adapter blades. It defines this as a configuration macro called JVM_LOCATION (see Configuration macros and items).

The <JVM-location-and-name> parameter must be a Linux style pathname with forward slash (/) separators, even if it’s a Windows path. Don’t use Windows-style backslash (\) separators - the command won’t find the path.

Example (for Windows):

./dfw java "C:/Program Files (x86)/Java/jre7/bin/client/jvm.dll"

If the path name in <JVM-location-and-name> contains spaces, enclose the whole thing in double quotes ("), or escape the spaces.

If you’re using Deployment Framework release 6.2 or later, and you need to use a 32 bit JVM on Linux (for example, when you have a 32 bit C-Based Adapter blade that uses Java), set the JVM location using the command ./dfw java32.
To set up the location and name of the JVM (Java Virtual Machine) for use by Java-based Adapter blades, you need to explicitly define the configuration item jvm-location in the blade’s configuration; see How can I…​ Configure a DataSource application’s JVM

java32

./dfw java32 <JVM32-location-and-name>

This command is only available in Deployment Framework release 6.2 and later. It only applies to Linux environments (not Windows).

Sets up the location and name of the 32 bitJVM (Java Virtual Machine) in Linux environments, for use by 32 bit C-Based Adapter blades. It defines this as a configuration macro called JVM_LOCATION32 (see Configuration macros and items).

Example:

./dfw java32 /usr/local/java/jre/lib/i386/server/libjvm.so

If the path name in <JVM32-location-and-name> contains spaces, enclose the whole thing in double quotes ("), or escape the spaces.

killAll

./dfw killAll

This command is only available in Deployment Framework release 6.2 and later. It isn’t available in the Git bash shell.

Kills all processes that were started from the dfw directory. Run this command if ./dfw stop didn’t stop all of the processes that were started by the ./dfw start or ./dfw cleanstart command.

logs

./dfw logs [Liberator] [Transformer] [<AdapterBladename1> <AdapterBladename2> …​] [servers]

This command is only available in Deployment Framework release 6.2 and later.

Copies all log files produced by the Framework components to directories under <Framework-root>/global_config/logs/, removing any existing logs at the target location.

  • If you don’t give the command any parameters, the log files of all the deployed core components (Transformer and/or Liberator) and Adapter blades are copied.

  • If you supply a list of core components and/or Adapter blades, the log files for just those components and/or blades are copied.

  • If you specify the servers parameter, only the log files of the deployed core components are copied.

To copy the log files to a different target location, define an environment variable called DFW_LOGS_DIR that specifies the location’s path.

mon

./dfw mon

Creates a configuration file for the Caplin Management Console (CMC). The file includes configuration relating to all the JMX-enabled DataSource peers that are currently deployed.

We recommend that if the CMC is running, you exit it before running the ./dfw mon command. This is because when you exit from the CMC, it saves its current configuration. So if the CMC’s running when you run the mon command, when you subsequently exit the CMC it overwrites the configuration changes that you’d previously made using mon.

redeploy

./dfw redeploy [-f] [<kitname1> <kitname2> …​]

This convenience command re-deploys one or more core components and/or blade kits that were previously deployed (see the deploy command). redploy obtains the kit(s) from the Deployment Framework’s kits archive directory (<Framework-root>/kits/archive/); it saves you from having to look in the archive, find the full file names of the required kits and then supply these names to the deploy command.

The most convenient way to use this command is with tab completion to select each archived kit that you want to redeploy.

To revert to using another previously deployed kit without redeploying it, use the rollback command.

Use the -f parameter to remove the Framework files relating to older kit versions without the command prompting you. However, if you do remove the files for an older kit version (either using -f or in response to a prompt), you can’t subsequently revert to that kit using the rollback command - you’ll have to redeploy the kit instead.

This command also stops all the deployed components.

redeploy is only available in Deployment Framework release 6.2.1 and later.

rollback

./dfw rollback [<kitname1> <kitname2> …​]

Rolls back one or more core components and/or blades to previously unpacked (deployed) kits. This command is useful when you’ve deployed a Platform component or blade that turns out to be faulty and you want to revert to a previous good version without having to redeploy it.

For example, assume that you originally deployed Liberator 6.2.5 and Transformer 6.2.4 and you then upgraded both these components by deploying the newer versions Liberator 6.2.6 and Transformer 6.2.5, keeping in place the files for the older versions. If you subsequently decide that you need to roll back to using the older versions, you would run the command:

./dfw rollback  Liberator-6.2.5-<build-no> Transformer-6.2.4-<build-no>

Note that unlike the deploy and redeploy commands, you don’t supply a file extension in the kit name parameter (Liberator-6.2.5-<build-no> not Liberator-6.2.5-<build-no>.zip)

The rollback command doesn’t unpack the selected kits again; it just changes the links that point to the currently deployed kits. In the above example, the link called Latest in <Framework-root>/kits/Liberator/ is changed, and so is the Latest link in <Framework-root>/kits/Transformer/

You can use the command to roll forwards as well as back. Following on from the previous example, to roll forward to the latest Liberator and Transformer that was previously deployed, you would run the command:

./dfw rollback  Liberator-6.2.6-<build-no> Transformer-6.2.5-<build-no>

The most convenient way to use this command is with tab completion, which will allow you to easily select the unpacked kits you want to restore.

If you want to revert to a kit for which you had previously removed the Framework files (for example, by running deploy or redeploy with the -f option), the kit won’t be available to the rollback command; you’ll have to redeploy it instead.

If there’s only one version of a particular kit deployed, the command presents this kit as available to rollback to, but the rollback is a "null" operation.

This command also stops all the deployed components.

rollback is only available in Deployment Framework release 6.2.1 and later.

start

./dfw start [Liberator] [Transformer] [<AdapterBladename1> <AdapterBladename2> …​] [servers]

Stops the core components (Transformer and/or Liberator) and Adapter blades and starts them up again.

  • If you don’t give the command any parameters, it stops and starts all the running components and Adapter blades.

  • If you specify one or more items (Liberator and/or Transformer and/or one or more Adapter blades) it just stops and starts those.

  • If you supply only the parameter called servers, the command stops and starts just the deployed core components (Liberator or Transfomer or both).

  • In Deployment Framework release 6.2 and later, the command stops all the specified currently running items first, before restarting them.

    In releases 6.1 and earlier, it stops a running item and immediately restarts it, before moving on to stop and start the next item.

To (re)start the system, cleaning it up first, use the command ./dfw cleanstart.
When you’ve changed the configuration of a production system, we recommend that you run the ./dfw dump command immediately, before restarting the system. The most up-to-date configuration data will then be readily available if Caplin Support need it to help fix a problem with your running system. If you don’t run dump before restarting, you’ll have to stop the running system to get the configuration needed to diagnose a fault, or copy the configuration manually from the various directories where it’s located.

status

./dfw status

Reports the status of the core components (Transformer and/or Liberator) and Adapter blades, showing the process id of each process running under the Framework.

stop

./dfw stop [Liberator] [Transformer] [<AdapterBladename1> <AdapterBladename2> …​] [servers]

Stops the core components (Transformer and/or Liberator) and Adapter blades.

  • If you don’t give the command any parameters, it stops all the running components and Adapter blades.

  • If you specify one or more items (Liberator and/or Transformer and/or one or more Adapter blades) it just stops those.

  • If you supply only the parameter called servers, the command stops just the deployed core components (Liberator or Transfomer or both).

validate

./dfw validate

Checks that the currently active blades are consistent with the list of active blades maintained by the Framework. This command also reports on any blades that have been copied directly into the <Framework-root>/active_blades/ directory instead of being activated using the command ./dfw activate.

versions

./dfw versions

Displays the versions of every deployed kit (including the Deployment Framework itself), and also which blades are active and inactive.

If multiple versions of the same kit have been deployed only the version of the most recent deployment is reported.

Note that the kit name for a blade includes the blade name but is not not necessarily identical to it. For example, the Caplin Permissioning Service blade is called PermissioningService but the associated kit is called CPB_PermissioningService-<version>.zip.

veryclean

./dfw veryclean [Liberator] [Transformer] [<AdapterBladename1> <AdapterBladename2> …​] [servers]

This command is only available in Deployment Framework release 6.2 and later.

Removes all log files that have been produced by the deployed components and active Adapter blades. When you explicitly or implicitly include Liberator in the command parameters, the command also removes the database files containing information about the Liberator users' licence usage. When you explicitly or implicitly include Transformer in the command parameters, the command also cleans up Transformer’s memory file.

This command also stops the specified components.

If you don’t want the licence database files to be removed, or Transformer’s memory file to be cleaned up, use the command ./dfw clean instead:

  • If you don’t give the command any parameters, it stops all the deployed components and active Adapter blades and cleans them.

  • If you specify one or more items (Liberator and/or Transformer and/or one or more Adapter blades) the command just stops and cleans those.

  • If you supply only the parameter called servers, the command just stops and the deployed core components (Liberator or Transformer or both) and cleans them.