43

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.

Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
Thor
  • 6,607
  • 13
  • 62
  • 96

6 Answers6

79

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
Perception
  • 79,279
  • 19
  • 185
  • 195
  • 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. – davidryan Feb 20 '12 at 02: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 not ***that*** big of a deal. – Perception Feb 20 '12 at 02:29
  • Agreed. As long as we all get there in the end :) – davidryan Feb 21 '12 at 01:39
  • @Perception Can you also include the shutdown command on other OS like windows? Thanks – Prakash K Sep 04 '12 at 12:16
  • 2
    add --controller=:9999 between shell and --connect if your instance is not bound to localhost – Scott May 16 '13 at 22:09
  • Awesome, I did it like so, because i have multiple cluster instances on localhost: SET NOPAUSE=true&&./jboss-cli.bat --controller=127.0.0.1:10399 --connect command=:shutdown – djangofan May 22 '13 at 20:59
  • @Prakash K Its the same as on linux, but remove the .sh extension: – pussmun Jan 21 '15 at 13:11
23

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

If you have set security realm then use:

./jboss-cli.sh --connect --controller=<host>:<port> --user=<username> --password=<password> /host=master:shutdown
Indraraj
  • 255
  • 3
  • 13
Lai
  • 1,320
  • 2
  • 13
  • 24
6

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

Fulgencio Jara
  • 419
  • 1
  • 7
  • 12
2

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

Ravi Chandran
  • 131
  • 2
  • 10
-1
 ./jboss-cli.sh --connect command=:shutdown

when I use this command in standalone mode it off , but when I 'm in an ssh connection must exit and enter again and then run this command

Jorge Alberto
  • 167
  • 1
  • 6
-1

I just want to contribute the answer for Jboss 5.x server, because the question is relevant to JBoss shutdown.

For Windows, proper syntax is mentioned below:

${JBOSS_HOME}/bin/shutdown.bat -s jnp://applicationHostedEnvironment:portNumber -S

For example: If the application is hosted on local machine with the port 1099 then use:

${JBOSS_HOME}/bin/shutdown.bat -s jnp://localhost:1099 -S

For Linux, Syntax:

${JBOSS_HOME}/bin/shutdown.sh -s jnp://applicationHostedEnvironment:portNumber -S<br>

For example: If the application is hosted on local machine with the port 1099 then use:

${JBOSS_HOME}/bin/shutdown.sh -s jnp://localhost:1099 -S
User42
  • 970
  • 1
  • 16
  • 27