I"m使用带有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工具的方法。
我怀疑它有时无法连接,因为我可以在telnet上看到localhost首先解析到ipv6。你试过了吗:
./bin/jboss-cli.sh --connect controller=127.0.0.1:9990 command=:shutdown
除此之外,你总是可以杀死PID:
pgrep -d" " -f "wildfly" | xargs kill;
要停止Wildfly:
$ ./jboss-cli.sh --connect command=:shutdown