Using the Greenplum Workload Manager Command Line
The Greenplum Workload Manager command line utility, gp-wlm
, provides access to Workload Manager capabilities. The utility may be run by entering commands interactively or by specifying equivalent actions using command-line options. The command-line options are useful for scripting, since they require no interactive user input.
To get help in interactive mode, issue the command: help
To get help for command line invocation, issue the command: gp-wlm --help
Below is the gp-wlm
command syntax:
Usage: gp-wlm [-g | gptop]
[--rule-add=[transient] <name> <rule>]
[--rule-delete=all|<name>] [--rule-dump=<path>] [--rule-import=<path>]
[--rule-modify=[transient] <name> <rule>] [--rule-restore=<path>]
[--rule-show=all|<name> [<host> <domain>]]
[--describe=<metric>]
[--config-show <component> <setting>] [--config-describe <component> <setting>]
[--config-modify <component> <setting>=<value>]
[--set-domain=<domain>] [--set-host=<host>] [--schema-path=<path>]
[--version] [--help] [--usage]
The gp-wlm
command-line options have parallel commands in the gp-wlm
interactive mode. The option descriptions below link to the interactive mode commands for additional usage information and examples.
Options
-g
or --gptop
gptop
graphical user interface. See Using the Workload Manager Graphical Interface (gptop) for more about gptop
.
--rule-add
--rule-delete
all
, all current rules. See Deleting Rules for details and examples.
--rule-dump
--rule-import
--rule-modify
--rule-restore
--rule-show
all
, all current rules. See Displaying Rules for details and examples.
--config-show
--config-describe
--config-modify
--set-domain
gp-wlm
interactive session. It is recommended to use the default domain.
--set-host
gp-wlm
session runs. The default is the machine where you run gp-wlm
. It is recommended to only run gp-wlm
on the Greenplum master host.
--schema-path
INSTALLDIR/schema
, should not be changed.
--usage
gp-wlm
command.
--help
gp-wlm
command.
--describe
$ gp-wlm --describe=datid:numbackends
--version
or -v
gp-wlm
version.
Using gp-wlm in Interactive Mode
Start gp-wlm at the command line:
$ gp-wlm
The
gp-wlm
command prompt displays the name of the host wheregp-wlm
is running and the name of the Greenplum Database cluster or domain.Enter
help
at the interactive prompt for a usage message.
When using the gp-wlm
command-line:
- Enter each command on a single line. Commands are executed immediately.
- Enter the
help
command to view a list of Workload Manager commands. - Enter
describe <metric>
to view a description of a metric.
While entering a command, get help with command syntax by pressing the tab key to show valid options. This is especially useful when constructing a rule. In the following partial example, user entry is in bold.
mdw/gpdb-cluster> rule <tab>
add delete dump modify restore show
mdw/gpdb-cluster> rule add <tab>
<rule-name> transient
mdw/gpdb-cluster> rule add transient <tab>
<rule-name>
mdw/gpdb-cluster> rule add transient myrule <tab>
gpdb_record host: pg_terminate_backend
mdw/gpdb-cluster> rule add transient myrule gpdb_record(<tab>
<dt>) gpdb_segment_role message query_start usename </dt>
current_query host pid session_id
...
Enter the quit command at the prompt to exit the gp-wlm
interactive mode.
Setting the Workload Manager Target Host and Domain
Use the set host
and set domain
commands to set the default host and domain for the Workload Manager session.
It is recommended to only run the gp-wlm
tool on the Greenplum Database master node and to leave the host and domain at their default values.
The default host is the name of the machine where you execute gp-wlm
. The host name must be resolvable in DNS. You can specify different host and cluster names on the gp-wlm
command line by supplying the --set-host
and --set-domain
command line options.
Example:
mdw/gpdb-cluster> set host smdw
smdw/gpdb-cluster> set domain gpdbsys
smdw/gpdbsys>