Configuring WildFly 9 from the CLI in offline mode

WildFly 9 has a new management mode for the Command Line Interface which allows varying your configuration without being connected to a WildFly instance.

This can be launched using the embed-server command. Here is the synopsis of the command:

   embed-server [--admin-only=true|false]
                [-c=config_file || --server=config=config_file]
                [--empty-config --remove-existing-config]
                [--jboss-home=rootdir]
                [--stdout=discard|echo]

Let's say you want to vary the server configuration named standalone2.xml:

 

embed-server --server-config=standalone2.xml --std-out=echo	

 

As you can see from the echo on the CLI, an embedded WildFly server will start, without binding any network interface, so you will not conflict with any running server.

wildfly 9 offline mode

You can check the status of the server by executing a simple "ls" on the application server root:

[standalone@embedded /] ls

core-service                 name=francesco-pc
deployment                   namespaces=[]
deployment-overlay           process-type=Server
extension                    product-name=WildFly Full
interface                    product-version=9.0.0.Beta2
path                         profile-name=undefined
socket-binding-group         release-codename=Kenny
subsystem                    release-version=1.0.0.Beta2
system-property              running-mode=ADMIN_ONLY
launch-type=EMBEDDED         schema-locations=[]
management-major-version=3   server-state=running
management-micro-version=0   suspend-state=RUNNING
management-minor-version=0

Try updating your configuration:

[standalone@embedded /] /subsystem=ejb3/thread-pool=default:write-attribute(name=max-threads,value=99)

Now check your server configuration XML file which has been updated accordingly.

Please note that the Offline mode enables you to start with an empty configuration file, which will be therefore created from scratch:

[disconnected /] embed-server --server-config=my-config.xml --empty-config

In order to stop the embedded server you can simply type:

[standalone@embedded /] stop-embedded-server
[disconnected /]

References: https://developer.jboss.org/docs/DOC-53050

Related articles available on mastertheboss.com

Wildfly 8 introduction

JBoss AS has a new name: as you probably know future versions of

Configuring Eclipse to use WildFly

This tutorial shows how to install JBoss Tools 4.3.1 plugin 

Maven configuration for Java EE 7 projects on WildFly

In this tutorial we will learn how to configure Maven Project Obj

Running WildFly with JDK 8

The JDK 1.8 early access is available for download at Oracle's si

Patching WildFly application server

The final version of WildFly 8.1.0 has been released and it conta

Configuring WildFly Batch Job Repository

WildFly ships with a subsystem named batch which is the administr

Follow us on Twitter