【问题标题】:How do I shutdown JBoss Wildfly when I can't access the CLI tool?当我无法访问 CLI 工具时,如何关闭 JBoss Wildfly?
【发布时间】:2016-03-07 07:32:32
【问题描述】:

我正在使用带有 Java 8 的 Wildfly 10.0.0.CR2。我让 Wildfly 在端口 8080 上侦听 http 连接,过去曾使用此命令关闭服务器...

./jboss-cli.sh --connect command=:shutdown

但是,有时,即使服务器仍在运行,我也无法访问此工具。请注意下面在我的 Mac 上的交互...

Daves-MacBook-Pro-2:bin davea$ ./jboss-cli.sh --connect command=:shutdown
Failed to connect to the controller: The controller is not available at localhost:9990: java.net.ConnectException: WFLYPRT0023: Could not connect to http-remoting://localhost:9990. The connection timed out: WFLYPRT0023: Could not connect to http-remoting://localhost:9990. The connection timed out
Daves-MacBook-Pro-2:bin davea$ telnet localhost 8080
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

我的问题是,什么是关闭 JBoss 服务器的万无一失的方法?注意我更喜欢不依赖 CLI 工具的方法。

【问题讨论】:

    标签: jboss wildfly shutdown


    【解决方案1】:

    停止 Wildfly:

    $ ./jboss-cli.sh --connect command=:shutdown
    

    【讨论】:

    • 问题是:如何关闭而不是如何开始。标记为 NAA。
    • 在win10命令行中:jboss-cli.bat --connect command=:shutdown
    【解决方案2】:

    我怀疑它有时无法连接,因为我可以在 telnet 上看到 localhost 首先解析为 ipv6。你试过了吗:

    ./bin/jboss-cli.sh --connect controller=127.0.0.1:9990 command=:shutdown
    

    除此之外,您总是可以杀死 PID:

    pgrep -d" " -f "wildfly" | xargs kill;
    

    【讨论】:

    • 在 Windows 中,我无法使用 pgrep -d" " -f "wildfly" | 停止服务器xargs 杀死;
    猜你喜欢
    • 2012-01-30
    • 2021-11-25
    • 2016-07-21
    • 1970-01-01
    • 1970-01-01
    • 2022-01-18
    • 2015-06-07
    • 2015-02-15
    • 1970-01-01
    相关资源
    最近更新 更多