如何shutdown JBoss AS 7 server

来源:互联网 发布:路旁的叶修写真集淘宝 编辑:程序博客网 时间:2024/06/06 04:47

在上一篇安装启动JBoss的博客http://blog.csdn.net/huluedeai/article/details/50639149中,发现启动jboss后并不是在后台运行 (windows),所以当你想要关闭jboss服务的时候,必须要CTRL+C 或单独打开一个再开一个cmd窗口,进入Jbossbin目录,运行

 Jboss-cli.bat --connect  command=:shutdown 


在解决这个问题时大多说看到的都是要用到jboss-admin.sh ,但是在jboss-as.7.1.0.Final中没有jboss-admin.sh(bat)文件。 在stackoverflow上看到了很好解释。http://stackoverflow.com/questions/9327233/how-do-i-shutdown-jboss-as-7-server

How do I shutdown JBoss AS 7 server?

up vote33down votefavorite
9

I recently updated from jboss-as.7.1.0.CR1b to jboss-as.7.1.0.Final and want to shutdown running instance from the console. In previous versions the command

$JBOSS_HOME/bin/jboss-admin.sh --connect command=:shutdown

was available, but I do not see jboss-admin.sh in the bin directory or other shell scripts for shutting down the server.

shareimprove this question
 

4 Answers

activeoldestvotes
up vote65down voteaccepted

For some reason the JBoss team decided to reorganize the scripts between minor revision upgrades. In any case, jboss-cli.sh is the replacement for jboss-admin.sh (they are for all intents and purposes the exact same script). So your new shutdown command is:

 ./jboss-cli.sh --connect command=:shutdown
shareimprove this answer
 
 
The script has been renamed in a way that makes it more accurately reflect the purpose of the script. The word "admin" can be confusing, where AS7 offers both a Management CLI and a Management Console. – ddriFeb 20 '12 at 2:18
 
Hey @ddri. I don't have a problem with the new name, so much as the timing of the change. In the end its notthat big of a deal. – Perception Feb 20 '12 at 2:29
 
Agreed. As long as we all get there in the end :) – ddri Feb 21 '12 at 1:39
 
@Perception Can you also include the shutdown command on other OS like windows? Thanks – Prakash KSep 4 '12 at 12:16
2 
add --controller=<your machine IP, eg 10.0.2.12>:9999 between shell and --connect if your instance is not bound to localhost – Scott May 16 '13 at 22:09
up vote15down vote

For standalone mode,

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

For domain mode, hostname should be specified like this:

./jboss-cli.sh --connect  /host=master:shutdown

'master' is the default hostname. The server hostname could be found in $JBOSS_HOME/domain/configuration/host.xml

shareimprove this answer
 
up vote5down vote

If your server has the controller listening in a different URL than localhost:

${JBOSS_HOME}/bin/jboss-cli.sh --connect --controller=<host>:<port> command=:shutdown

Only for your information. ;)

shareimprove this answer
 
up vote1down vote

In Windows ......jboss-eap-6.1\bin\jboss-cli.bat Double click or run by cmd prompt.

shareimprove this answer
 

Your Answer


0 0
原创粉丝点击