如何shutdown JBoss AS 7 server

在上一篇安装启动JBoss的博客http://blog.youkuaiyun.com/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

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.

share improve this question
 

4 Answers

up vote 65 down vote accepted

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
share improve 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. –  ddri Feb 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 K Sep 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

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

share improve this answer
 

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. ;)

share improve this answer
 

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

share improve this answer
 

Your Answer


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值