- WildFly Cookbook
- Luigi Fugaro
- 276字
- 2021-07-16 13:38:15
Checking the server-state via the CLI
In this recipe, we will learn how to check the server status. WildFly may have different status depending on its phase: starting, stopping, started, and stopped. Sometimes, just checking its status at the OS level by looking for its process might not be enough.
Getting ready
As the CLI is a management tool, you will need to have your WildFly instance up and running. Also for this recipe, we will rely on the default standalone configuration.
Open a terminal window and start WildFly:
$ cd $WILDFLY_HOME $ ./bin/standalone.sh ... 22:12:23,600 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 9.0.0.Beta2 (WildFly Core 1.0.0.Beta2) started in 3226ms - Started 202 of 379 services (210 services are lazy, passive or on-demand)
How to do it…
In a new terminal window, type in the following:
$ ./bin/jboss-cli.sh You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands. [disconnected /] connect [standalone@localhost:9990 /] :read-attribute(name=server-state) { "outcome" => "success", "result" => "running" } [standalone@localhost:9990 /]
How it works…
As you connect to the host-controller, you are just in the root of your configuration. Thus, you can invoke an operation on it, and to do that, you need to start with the :
(colon) symbol.
In our example we used the read-attribute
method, but you could have any of the available ones. To see them is as easy as hitting the Tab key right after the colon symbol, as follows:

Getting back to our server state, we received two responses: one saying that our invocation was successful, and the second one reporting the result, running.
- Python網(wǎng)絡(luò)爬蟲從入門到實(shí)踐(第2版)
- Hands-On Full Stack Development with Go
- jQuery Mobile移動應(yīng)用開發(fā)實(shí)戰(zhàn)(第3版)
- Visual Basic程序設(shè)計(jì)教程
- C語言程序設(shè)計(jì)
- 小程序從0到1:微信全棧工程師一本通
- Fastdata Processing with Spark
- UI設(shè)計(jì)基礎(chǔ)培訓(xùn)教程(全彩版)
- Visual Basic 程序設(shè)計(jì)實(shí)踐教程
- 和孩子一起學(xué)編程:用Scratch玩Minecraft我的世界
- Scratch 3.0少兒積木式編程(6~10歲)
- C#開發(fā)之道
- 交互設(shè)計(jì)語言:與萬物對話的藝術(shù)(全兩冊)
- Vue.js從入門到精通
- Building Data Streaming Applications with Apache Kafka