Connect to a jmx-manager either directly or via a locator.

If connecting via a locator, and a jmx-manager does not already exist, the locator will start one.

gfsh connects as a discovery client to the locator service and asks where the JMX Manager is. Locator knows that there is no member currently configured as the JMX manager and simply starts up the JMX manager service within itself. gfsh connects as a JMX client to locator JMX RMI port.

Availability: Offline. You will receive a notification "Already connected to: host[port]" if you are already connected.

connect [--locator=value] [--jmx-manager=value] [--user=value] 
[--password=value] [--key-store=value] [--key-store-password=value] 
[--trust-store=value] [--trust-store-password=value] [--ciphers=value] 
[--protocols=value] [--security-properties-file=value] [--use-ssl=(value)?]
locator Network address of the Locator in the form: host[port]. The default if the parameter is not specified: localhost[10334]
jmx-manager Network address of the jmx-manager in the form: host[port].
user User name to securely connect to the jmx-manager. If the --password parameter is not specified then it will be prompted for.
password Password to be used as credential which is required to connect to a jmx-manager securely.
key-store Java keystore file containing this application's certificate and private key. If the --key-store-password parameter is not specified then it will be prompted for.
key-store-password Password to access the private key from the keystore file specified by --key-store.
trust-store Java keystore file containing the collection of CA certificates trusted by this application. If the --trust-store-password parameter is not specified then it will be prompted for.
trust-store-password Password to unlock the keystore file specified by --trust-store.
ciphers SSL/TLS ciphers used when encrypting the connection. The default is "any".
ssl-protocols SSL/TLS protocol versions to enable when encrypting the connection. The default is "any".
security-properties-file The file for configuring gfsh to connect to the Locator/Manager. The file's path can be absolute or relative to the current gfsh directory.
use-ssl Whether to use SSL for communication with Locator and/or JMX Manager. If set to "true", the connect command will also read SSL Options take precedence over properties file. If none are specified, defaults will be used. The default value for this options is "false". If the parameter is specified without a value, the default value is true. Default value if the parameter is not specified is false.

Example Commands:

If you do not specify a locator or jmx-manager, gfsh connects to the locator on the localhost at the default port.
Sample Output:
Connecting to Locator at [host=localhost, port=10334] ..
Connecting to Manager at [host=GemFireStymon, port=1099] ..
Successfully connected to: [host=GemFireStymon, port=1099]

Error Messages:

"Locator could not find a JMX Manager";
"jmx password must be specified.";
"Could not connect to : {0}. {1}";
"Could not find a GemFire jmx-manager service running at {0}.";
"Could not connect to GemFire Locator service at {0}."