2015-12-02 103 views
5

我「米使用Wildfly 10.0.0.CR2與Java 8.我有Wildfly監聽8080端口,並在過去的HTTP連接都用這個命令來關閉服務器...我無法訪問CLI工具時如何關閉JBoss Wildfly?

./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工具的方法。

回答

13

我懷疑它有時無法連接,因爲我可以在telnet上看到localhost先解析爲ipv6。你嘗試過:

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

短的,你可以永遠只是殺PID:

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

要停止Wildfly:

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

的問題是:*如何關閉*和不*如何開始*。標記爲NAA。在win10命令行中輸入 –

+0

:jboss-cli.bat --connect command =:shutdown –