이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 2. Getting Started with the Management CLI


The management CLI is included with the JBoss EAP distribution. Once you launch the management CLI, you can connect to a running server instance or managed domains to perform management operations.

2.1. Launch the Management CLI

You can launch the management CLI by running the jboss-cli script provided with JBoss EAP.

$ EAP_HOME/bin/jboss-cli.sh
Copy to Clipboard Toggle word wrap
Note

For Windows Server, use the EAP_HOME\bin\jboss-cli.bat script to launch the management CLI.

See Connect to the Server for details on launching the management CLI and connecting to the server in one step using the --connect argument.

For a complete listing of all available jboss-cli script arguments and their purposes, use the --help argument or see the Management CLI Startup Arguments section.

2.2. Connect to the Server

You can connect to a running standalone server or managed domain by using the connect command.

connect
Copy to Clipboard Toggle word wrap

The default host and port configuration is localhost:9990. If the server is listening on a different host and port, then these need to be provided to the connect command.

connect 192.168.0.1:9991
Copy to Clipboard Toggle word wrap

You can also launch the management CLI and connect to the server in one step using the --connect argument (and the --controller argument if necessary).

$ EAP_HOME/bin/jboss-cli.sh --connect --controller=192.168.0.1:9991
Copy to Clipboard Toggle word wrap

In JBoss EAP 7.0, to connect using the http-remoting protocol, use:

connect http-remoting://192.168.0.1:9999
Copy to Clipboard Toggle word wrap

2.3. Change the Current Path

You can change to a different node path by using the cd command and providing the desired path. When the management CLI is first launched, it is at the root level (/).

cd /subsystem=datasources
cd data-source=ExampleDS
Copy to Clipboard Toggle word wrap

You can show the full path of the current node using the pwd command.

pwd
Copy to Clipboard Toggle word wrap
/subsystem=datasources/data-source=ExampleDS
Copy to Clipboard Toggle word wrap

2.4. List Contents

You can list the contents of a particular node path by using the ls command. If the path ends on a node name, that resource’s attributes will be listed as well.

The below example navigates the standard-sockets socket binding group and then lists its contents.

cd /socket-binding-group=standard-sockets
ls -l
Copy to Clipboard Toggle word wrap
ATTRIBUTE         VALUE                                 TYPE
default-interface public                                STRING
name              standard-sockets                      STRING
port-offset       ${jboss.socket.binding.port-offset:0} INT

CHILD                                      MIN-OCCURS MAX-OCCURS
local-destination-outbound-socket-binding  n/a        n/a
remote-destination-outbound-socket-binding n/a        n/a
socket-binding                             n/a        n/a
Copy to Clipboard Toggle word wrap

The same result can be achieved from anywhere in the resource tree hierarchy by specifying the node path to the ls command.

ls -l /socket-binding-group=standard-sockets
Copy to Clipboard Toggle word wrap
ATTRIBUTE         VALUE                                 TYPE
default-interface public                                STRING
name              standard-sockets                      STRING
port-offset       ${jboss.socket.binding.port-offset:0} INT

CHILD                                      MIN-OCCURS MAX-OCCURS
local-destination-outbound-socket-binding  n/a        n/a
remote-destination-outbound-socket-binding n/a        n/a
socket-binding                             n/a        n/a
Copy to Clipboard Toggle word wrap

You can also use the --resolve-expressions parameter to resolve the expressions of the returned attributes to their value on the server.

ls -l /socket-binding-group=standard-sockets --resolve-expressions
Copy to Clipboard Toggle word wrap
ATTRIBUTE         VALUE            TYPE
default-interface public           STRING
name              standard-sockets STRING
port-offset       0                INT

CHILD                                      MIN-OCCURS MAX-OCCURS
local-destination-outbound-socket-binding  n/a        n/a
remote-destination-outbound-socket-binding n/a        n/a
socket-binding                             n/a        n/a
Copy to Clipboard Toggle word wrap

In this example, the port-offset attribute shows its resolved value (0) instead of the expression (${jboss.socket.binding.port-offset:0}).

2.5. Getting Help

The management CLI provides several ways for you to get help with using the management CLI.

  • View general help on using the management CLI.

    help
    Copy to Clipboard Toggle word wrap

    This provides detailed help with launching, navigating, and generating operation requests.

  • View help for a particular command.

    COMMAND_NAME --help
    Copy to Clipboard Toggle word wrap

    This provides the usage, description, and arguments for the particular command.

  • View the list of available commands,

    help --commands
    Copy to Clipboard Toggle word wrap
    Note

    Commands that require a connection to either a standalone server or domain controller will not appear in the list unless the connection has been established.

See the Management CLI Commands section for a listing of management CLI commands.

2.6. Quit the Management CLI

You can quit the management CLI by entering the quit command.

quit
Copy to Clipboard Toggle word wrap

2.7. Run in Non-Interactive Mode

You can issue management CLI commands without launching and interacting with the management CLI. This is useful for processing batches of commands and executing commands from scripts. You can either pass in the commands or pass in a file that contains commands to the jboss-cli startup script.

Pass in Commands

You can use the --command argument to provide a single CLI command to execute. The management CLI will terminate once the commands have completed.

$ EAP_HOME/bin/jboss-cli.sh --connect --command="/interface=public:read-attribute(name=inet-address,resolve-expressions=true)"
Copy to Clipboard Toggle word wrap

The output from each command provided is displayed as it executes.

{
    "outcome" => "success",
    "result" => "127.0.0.1"
}
Copy to Clipboard Toggle word wrap

You can also use the --commands argument to provide a comma-separated list of CLI commands to execute.

Pass in a File of Commands

You can use the --file argument to pass in a text file of CLI commands to execute, with each command on a separate line in the file.

$ EAP_HOME/bin/jboss-cli.sh --connect --file=/path/to/cli_commands.txt
Copy to Clipboard Toggle word wrap
Note

In this example, cli_commands.txt has the following CLI commands.

:read-attribute(name=running-mode)
ls /deployment
Copy to Clipboard Toggle word wrap

The output from each command in the file is displayed as it executes.

Example Output

{
    "outcome" => "success",
    "result" => "NORMAL"
}
jboss-helloworld.war
Copy to Clipboard Toggle word wrap

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat