Shutting down and restarting an instance via the CLI

In this recipe, we will learn how to stop a WildFly instance via the CLI, or alternatively, restart it via the CLI.The restart option is in contrast to the reload command of the previous recipe.

Getting ready

Start up your WildFly so that we can directly connect to it via the CLI, as follows:

$ cd ~/WFC/wildfly
$ ./bin/standalone.sh

How to do it...

The command itself is pretty easy:

$ ./bin/jboss-cli.sh --connect
[standalone@localhost:9990 /] shutdown
[disconnected /]

How it works...

The preceding command stops everything and drops you off from the CLI. Hence, in case you need to restart your WildFly instance, you need to execute the standalone.sh script again, along with any parameter previously defined. ...

Get WildFly Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.