open

The open command is used to connect to a metaspace through the listen port of another metaspace member. Any Admin CLI commands issued while that connection is open will be executed on the other metaspace member. Use the close command to close this type of metaspace connection.

Syntax

open name <string> listen <string>

Parameters

The following table describes the parameters for this command.

open Parameters
Parameter Description
name Specifies the name of the metaspace to connect to.
listen Specifies the listen URL of the metaspace member to use for connecting to the metaspace. Has the format tcp://<IP address>:<port>.

Remarks

Note the following points regarding the open command:

  • After you have opened a connection to the listen port of a metaspace member, all Admin commands issued from as-admin are then sent to the metaspace member to be executed. This includes commands such as execute on member.
  • If you are already connected to a metaspace, you are not allowed to open a connection to the listen port of a metaspace member. You must first disconnect from the metaspace and then open the connection. Otherwise, you will receive an error when you try to use the open command.
  • If you have opened a connection to the listen port of a metaspace member, you cannot directly connect to a metaspace using the connect command. You must first close the connection to the metaspace listen port and then connect to the metaspace. Otherwise, you will receive an error when you try to run the connect command.
  • Only as-admin can be used to connect to a metaspace through another member’s listen port.
  • The open and close commands are not available through the Admin API.
  • The open and close commands are not available when as-agent -admin is invoked, because an as-agent is already connected to a metaspace and having it disconnect is not the purpose of an as-agent.
  • From as-admin you can repeatedly issue connect/disconnect and open/close commands. For example, you can connect to a metaspace, run some Admin commands, disconnect from the metaspace, open a connection to a metaspace member, run some Admin commands, close the connection, open a connection to another metaspace member, run some Admin commands, close the connection, connect to a metaspace, run some Admin commands, disconnect from the metaspace.
  • Connecting to a metaspace through a metaspace member's listen port is not supported when using security for opening the connection is required.
  • When the open command is run and a connection to the listen port is established, the show metaspaces command is run by the open command to ensure the connection is valid and to allow the user to see the metaspace information, which includes the listen port of the connected member. In this way the user can verify that they have connected to the desired metaspace member.