04 December 2022

GigaSpaces CLI

GigaSpaces provides an interactive command line tool as part of the product. This can be started using gs.sh/bat command (referred to as GigaSpaces CLI).

This tool provides many commands that can be used to manage and gather information about the various GigaSpaces runtime components. This section describes the commands supported by the GigaSpaces CLI.

This CLI is deprecated as of version 14.0, as noted in the Release Notes. Use the new CLI instead.

help

Syntax

gs> help [command-name]

Description

The help command displays the syntax of a specified CLI command, or a list of all available commands.

Options

Option Description
command-name The name of any one of the GigaSpaces CLI commands. Default: List all commands, without their arguments.

cd

Syntax

gs> cd directory

Description

The cd command moves to a different working directory, like the Unix cd command.

directory accepts an absolute or relative file-system path.

Options

Option Description
None

gsa

Syntax

gs> gsa <command> [-host<host name/ip address>]

Description

The following gsa CLI commands are available:

Command Description
shutdown shutdown gsa
start-gsc starts gsc agent within specific gsa service
start-gsm starts gsm agent within specific gsa service
start-lookup starts lus agent within specific gsa service

Options

Option Description Value Format
help / h Prints help – the command's usage and options.
host / h Host name, optional parameter, allows to locate gsa that is running on specific machine.
Example

jconsole

Syntax

gs> jconsole [jmx-connection-string]

Description

The jconsole command launches the Service Grid Admin UI, allowing you to browse the JMX instance associated with a specific Grid Service Container (GSC).

JMX provides remote management capabilities for monitoring memory utilization, VM system configuration, performance and garbage collection characteristics etc. By default, each GSC is set to run a JMX enabled VM. For more details on monitoring and management using JMX, refer to the JMX Management section.

Options

Option Description
jmx-connection-string The JMX connection string to be used for starting the Java Management Console. If not provided, a selection list of all GSCs is displayed. You can select the appropriate instance from the list.
h / help Prints help
Example

list

Syntax

gs> list [type] [options]

Description

The list command lists information about active Service Grid services.

The following values are allowed for type. Only one type can be specified.

Type Description
gsm Grid Service Monitor
gsc Grid Service Container
lus Lists all active Jini Lookup Service instances and their attributes.
Default (none) List all types of services, but in less detail than when the types are specified individually: only service name, group, and machine.

Options

Each option adds to (or subtracts from) the default information listed. You can specify one option, more than one, or none.

The following options are available for types gsm, gsc, and default:

Option Description
cpu Lists the CPU utilization of each machine.
jmx Lists the jmx connection entry, if any.
codeserver Lists the IP addresses to which the service has been exported.
timeout Available for type lus only (new in GigaSpaces 6.0.2 and onwards) – the discovery timeout (in milliseconds). Usage example: timeout=20000. Default value is 30000 msec.
Example

Troubleshooting: terminated services are still listed

The list command uses the lookup service to extract the information regarding the services.

A service's entry in the lookup is leased and kept until the next renewal attempt fails. If the service is not properly shutdown, i.e. abruptly terminated, it doesn't un register itself from the lookup service. Thus, attempts to call list will still display the service until its lease expires.

For defaults and configuration options, refer to Jini Lookup Service configuration settings for minMaxServiceLease property.

login

Syntax

gs> login gs> login -user xxx -password yyy

Description

This CLI command allows you to login to secured services: GSM, GSC and Sspaces. Each time you invoke this command, you are required afterwards to type in the user name and password (if not supplied in the command). The user name and password are used in order to attempt to authenticate secured services before invoking any operation for them ( e.g. pudeploy, undeploy, space clear, space connections ... ).

Example

ls

Syntax

gs> ls [-l]

Description

The ls command lists the contents of the current working directory, like the Unix ls command.

Options

Option Description
-l List the contents in more detail.

pwd

Syntax

gs> pwd

Description

The pwd command displays the full path of the current working directory, like the Unix pwd command.

Options

None.

quit

Syntax

gs> quit

Description

The quit command ends the CLI session.

A shortcut for this command is q.

Options

None.

set

Syntax

gs> set [variable [value]]

Description

The set command sets the Service Grid system environment variables.

Options

Option Description Value Format
groups The Jini lookup groups value. The group filters the specific group of services that should be managed by the current shell context. * List of comma-delimited names: group1,group2,...
- all_groups assigns the current context to all available GridService elements in the network.
locators A list of Jini locators hosts. The locators provide an alternate discovery mechanism, if multicast is not working. The locator points to the location of Jini lookup hosts. Normally a lookup service is running as an embedded instance with the Grid Service Monitor (GSM). jini://<hostname1>
To set several locators you have to execute:
set locators jini://<hostname1>
set locators jini://<hostname2>
...
To empty the locators variable you have to execute:
set locators null
system-props Should be one of the properties used by the system. Omit this parameter to view a list of the available properties. <system property name>=<property value>
disco-timeout Jini discovery timeout [in ms]. Defines the time for waiting for service discovery announcements. Relevant for multicast discovery only.
wait-on-deploy Timeout [in ms] for finding deployable servers.
deploy-timeout Timeout [in ms] for blocking for deployment status.

Make sure your network and machines running GigaSpaces are configured to have multicast enabled. See the How to Configure Multicast section for details on how to enable multicast.

Example

stats

Syntax

gs> stats

Description

The stats command provides statistics from the Grid Service Container (GSC) and Grid Service Monitor (GSM) of the local machine. The following statistics are reported:

Statistic Decription
User name Current user name in local operating system.
Home directory Service Grid installation directory.
Time of login Time the Service Grid CLI was started.
Elapsed time since login Elapsed time since the Service Grid CLI was started.
Pathname of log file Where advertised, the group advertised, and the time when the service was found to be discarded.
HTTP Address (plus roots) if any HTTP server has been started under this session .
Lookup service discovery statistics Statistics on discovered lookup instances, including IP address and port, group, and time elapsed. At the end, statistics are shown for discarded lookup services, if any.

Options

None.

Example

version

Syntax

gs> version [-verbose]

Description

The version command displays the product's version information.

Options

Option Description
-verbose Displays additional environment information (OS, JVM, network, system properties, etc).