Execute a Command or Script on Grid Installations (installationExec)

The installationExec command runs a command (such as a system command or TimesTen command) or a script on installations in the grid, as specified.

ttGridAdmin installationExec [-only hostname[.installname]]
                             [-exclude hostname[.installname]]
                             [-parallel n]
                             command | -script filepath

As the command or script runs, the TIMESTEN_INSTALL environment variable is set to contain the fully qualified path name of the installation as defined in the model.

Options

The installationExec command has the options:

Option Description

-only hostname[.installname]

The command or script is run only on the specified installations. Specify just one installation with -only, but you can use -only multiple times on the command line.

Use host names and installation names as defined in the model. You do not have to include the installation name if it is the only installation on the host.

-exclude hostname[.installname]

The command or script is run on all installations in the grid except for those specified. Specify just one installation with -exclude, but you can use -exclude multiple times on the command line.

Use host names and installation names as defined in the model. You do not have to include the installation name if it is the only installation on the host.

-parallel n

Specifies that the command or script runs on no more than n installations simultaneously. The default is 10. A value of 1 results in serial execution.

command | -script filepath

command specifies a command to run.

Or:

-script filepath specifies the path and name of a shell script to run. The script must be on the local system, then is copied to each installation.

Examples

This example checks the disk space usage on the file system of each installation.

% ttGridAdmin installationExec df '$TIMESTEN_INSTALL'
Commands executed on:
  mysys2host.installation1 rc 0
  mysys4host.installadc rc 0
  mysys1host.installation1 rc 0
  mysys3host.installslc rc 0
Return code from mysys2host.installation1: 0
Output from mysys2host.installation1:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/xvda2           117144964  42660228  68534120  39% /
Return code from mysys4host.installadc: 0
Output from mysys4host.installadc:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/xvda2           117144964  42660228  68534120  39% /
Return code from mysys1host1.installation1: 0
Output from mysys1host.installation1:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/xvda2           173483816  57971304 106700020  36% /
Return code from mysys3host.installslc: 0
Output from mysys3host.installslc:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/xvda2           173483816  57971312 106700012  36% /

Notes

  • The command or script is run as the instance administrator on each installation, through passwordless SSH.

  • The command returns 2000 if execution did not complete prior to the timeout.

  • During execution, stdout and stderr output is displayed as part of the stdout and stderr output from the installationExec command. Because output is buffered, the output from different commands is not intermingled.