Jboss cli不适用于IP:9990

问题描述

我尝试在某些服务器上使用jboss cli客户端连接到jboss,它工作正常,但是从服务器外部显示错误消息:

Failed to connect to the controller: The controller is not available at ip:9990: java.net.ConnectException: WFLYPRT0023: Could not connect to http-remoting://ip:9990. The connection timed out: WFLYPRT0023: Could not connect to http-remoting://ip:9990 Connection refused

我启动此命令:

java -jar jboss-cli-client.jar --connect --controller = serverIp:9990 --user = userNameJboss --password = passwordJboss

文件standalone.xml

<interfaces>
        <interface name="management">
            <inet-address value="${jboss.bind.address.management:0.0.0.0}"/>
        </interface>
        <interface name="public">
            <inet-address value="${jboss.bind.address:0.0.0.0}"/>
        </interface>
    </interfaces>
    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
        <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
        <socket-binding name="http" port="${jboss.http.port:8080}"/>
        <socket-binding name="https" port="${jboss.https.port:8443}"/>
        <socket-binding name="txn-recovery-environment" port="4712"/>
        <socket-binding name="txn-status-manager" port="4713"/>
        <outbound-socket-binding name="mail-smtp">
            <remote-destination host="localhost" port="25"/>
        </outbound-socket-binding>
    </socket-binding-group>

jboos-cli.xml

<jboss-cli xmlns="urn:jboss:cli:3.3">

    <default-protocol use-legacy-override="true">remote+http</default-protocol>

    <!-- The default controller to connect to when 'connect' command is executed w/o arguments -->
    <default-controller>
        <protocol>remote+http</protocol>
        <host>localhost</host>
        <port>9990</port>
    </default-controller>

    <!-- Example controller alias named 'Test'
    <controllers>
        <controller name="Test">
            <protocol>remote+http</protocol>
            <host>localhost</host>
            <port>9990</port>
        </controller>
    </controllers>
    -->

    <validate-operation-requests>true</validate-operation-requests>

    <!-- Command and operation history log configuration -->
    <history>
        <enabled>true</enabled>
        <file-name>.jboss-cli-history</file-name>
        <file-dir>${user.home}</file-dir>
        <max-size>500</max-size>
    </history>

    <!-- whether to resolve system properties specified as command argument or operation parameter values
                  in the CLI VM before sending the operation requests to the controller -->
    <resolve-parameter-values>false</resolve-parameter-values>


    <!-- Whether to write info and error messages to the terminal output -->
    <silent>false</silent>

    <!-- Whether to filter out commands and attributes based on user's permissions -->
    <access-control>false</access-control>

    <!-- Include the prompt with the command into the output for each command executed in non-interactive mode -->
    <echo-command>false</echo-command>

    <!-- Uncomment to set the command timeout. Element value is in seconds -->
    <!-- <command-timeout>30</command-timeout> -->

    <!-- Uncomment to display operation responses using JSON syntax.
    By default responses are displayed using DMR string syntax. -->
    <!-- <output-json>true</output-json> -->

    <!-- Configuration of CLI colors. To disable,change <enabled> to false.
    Available colors: black,blue,cyan,green,magenta,red,white,yellow and default,which is the terminal's default
    foreground color-->
    <color-output>
        <enabled>true</enabled>
        <error-color>red</error-color>
        <warn-color>yellow</warn-color>
        <success-color>default</success-color>
        <required-color>magenta</required-color>
        <workflow-color>green</workflow-color>
        <prompt-color>blue</prompt-color>
    </color-output>

    <connection-timeout>30</connection-timeout>
</jboss-cli>

解决方法

尝试增加超时时间。 ./jboss-cli.sh --connect --controller=yourIP:managementHttpPort --timeout=2000

默认情况下,cli 配置为在 5 秒(500 毫秒)内连接,但有时由于防火墙和延迟需要更多时间,所以我建议您尝试 20 秒(20000)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...