Java Reference
In-Depth Information
Creating CLI scripts
As a program developer, you might be interested to know that a CLI can execute com-
mands in a non-interactive way by adding them to a file, just as a shell script. In order to
execute the script, you can launch the CLI with the --file parameter as in the following
example (for Windows):
jboss-cli.bat --file=test.cli
The equivalent command for Unix users will be as follows:
./jboss-cli.sh --file=test.cli
In the next section, we will look at some useful scripts that can be added to your adminis-
trator toolbox.
Deploying an application to several WildFly nodes
The earlier JBoss AS releases used to ship with a farm folder, which would trigger a de-
ployment to all the nodes that are part of a JBoss cluster. This option is not included any-
more with JBoss AS7 and WildFly, but resurrecting a farm deployment is just a matter of
following a few CLI instructions.
In the following example, we are deploying an application to the default server address
( 127.0.0.1 and port 9990 ) and to another server instance that is bound to the same ad-
dress but to port 10190 :
connect
deploy /usr/data/example.war
connect 127.0.0.1:10190
deploy /usr/data/example.war
Restarting servers in a domain
A common requirement for the domain administrator is to restart the application server
nodes, for example, when some server libraries are updated. CLI provides a handy shortcut
to stop and start all the servers that are part of a server group:
Search WWH ::




Custom Search