Ich verwende Wildfly 10.0.0.CR2 mit Java 8. Ich habe Wildfly auf Port 8080 für HTTP-Verbindungen und habe diesen Befehl in der Vergangenheit benutzt, um den Server herunterzufahren.
./jboss-cli.sh --connect command=:shutdown
Gelegentlich kann ich jedoch nicht auf dieses Tool zugreifen, obwohl der Server noch läuft. Beachten Sie die Interaktion unten auf meinem 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 '^]'.
Meine Frage ist: Was ist eine narrensichere Methode, um den JBoss-Server herunterzufahren? Hinweis: Ich würde eine Methode vorziehen, die nicht auf das CLI-Tool angewiesen ist.
Ich vermute, dass es manchmal nicht möglich ist, eine Verbindung herzustellen, da ich im Telnet sehen kann, dass localhost zuerst in ipv6 aufgelöst wird. Hast du es versucht:
./bin/jboss-cli.sh --connect controller=127.0.0.1:9990 command=:shutdown
Abgesehen davon können Sie die PID einfach töten:
pgrep -d" " -f "wildfly" | xargs kill;
Wildfly stoppen:
$ ./jboss-cli.sh --connect command=:shutdown