cleanest way to restart jboss using a script
38,782
Solution 1
You have to use CLI console. To restart, type
bin/jboss-cli.sh --connect --command=:reload
To shutdown, type
bin/jboss-cli.sh --connect --command=:shutdown
Solution 2
@Petr Mensik's solution works well if you need to shutdown the server. But if you need to restart it in a single operation you can use:
jboss-cli.sh -c ":shutdown(restart=true)"
Thanks to these excellent JBoss notes.
Related videos on Youtube
Comments
-
Saqib Ali almost 2 years
I am using " ./standalone.sh -c standalone-full.xml " to start JBOSS. What is the cleanest way to restart jboss in this case? Any scripts that you can share?
-
James R. Perkins over 11 yearsYou can also use
bin/jboss-cli.sh --connect --command=":reload"
if you just want to restart the server. -
Saqib Ali over 11 years@JamesR.Perkins does the "reload" wait for the pending transactions to finish before reloading?
-
James R. Perkins over 11 yearsMy guess would be yes, but to be honest I'm not sure.
-
Saqib Ali over 11 years@JamesR.Perkins I tried ":reload" but I get: Communication error: java.util.concurrent.ExecutionException: Operation failed
-
James R. Perkins over 11 yearsI've seen that from time to time and I think it's a known issue that looks like it's fixed upstream. issues.jboss.org/browse/AS7-1833