WildFly (JBoss Application Server) Basic Concepts

[‘

n

In our last two articles, we had gone through the WildFly Installation and then managing server using GUI version of CLI. Today, we’ll discuss about the basic concepts or you can say terms used within WildFly. You can go through our last published articles at.

n

    n

  1. WildFly – A New Improved JBoss Application Server Installation
  2. n

  3. Manage WildFly (JBoss AS) Server Using GUI version of CLI
  4. n

n

Basic Concepts in WildFly
Basic Concepts in WildFly

n

Those who are already familiar with Jboss AS, will be aware of the big change introduced to Jboss AS 7.* and hence WildFly. The change was the modular design, means it will load the classes needed by application instead of loading all classes.

n

Below are the some of the basic terms used in WildFly:

n

Startup Modes

n

Wildfly have introduced new startup modes. It have two modes of operations used are managing all server operations.

n

    n

  1. Standalone Mode
  2. n

  3. Domain Mode
  4. n

n

Both these modes are handled by the two different scripts provided within “bin” directory of WildFly installation.

n

[[emailxa0protected] bin]# ll -m1 standalone.sh domain.shrnrndomain.shrnstandalone.sh

n

Standalone Mode

n

In prior version of Jboss AS 7.* i.e. Jboss Application Server 3, 4, 5 or 6, all running jboss instance have their individual process. Every instance will have its own admin console and other functions for controlling the same.

n

In very similar way standalone mode works. We can launch standalone server using “standalone.sh“ script and passing different parameters as per requirements. We can launch as many instances as we want (all should have been configured to be run on different ports).

n

We can also form different HA clusters as we were doing with earlier version i.e. 4, 5 or 6.

n

Starting WildFly in Standalone Mode

n

Move to $JBOSS_HOME/bin directory and launch standalone.sh script from terminal as shown below. If we don’t specify any parameter, then by default it’ll get bound to loopback address and use standalone.xml file.

n

[[emailxa0protected] bin]# ./standalone.sh

n

Sample Output

n

tecmint-VGN-Z13GN bin # ./standalone.shrn=========================================================================rnrn  JBoss Bootstrap Environmentrnrn  JBOSS_HOME: "/data/wildfly-8.0.0.Final"rnrn  JAVA: javarnrn  JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=truernrn=========================================================================rnrn13:25:22,168 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.0.Finalrn13:25:22,717 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.0.Finalrn13:25:22,818 INFO  [org.jboss.as] (MSC service thread 1-3) JBAS015899: WildFly 8.0.0.Final "WildFly" startingrn13:25:24,287 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)rn13:25:24,310 INFO  [org.xnio] (MSC service thread 1-1) XNIO version 3.2.0.Finalrn13:25:24,332 INFO  [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.2.0.Finalrn13:25:24,486 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 33) JBAS010280: Activating Infinispan subsystem.rn13:25:24,491 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 28) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)rn13:25:24,514 INFO  [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 4.0.0.Finalrn13:25:24,573 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 39) JBAS012615: Activated the following JSF Implementations: [main]rn13:25:24,575 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-3) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.3.Final)rn13:25:24,587 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010417: Started Driver service with driver-name = h2rn13:25:24,622 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 41) JBAS011800: Activating Naming Subsystemrn13:25:24,691 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 46) JBAS013171: Activating Security Subsystemrn13:25:24,707 INFO  [org.jboss.as.naming] (MSC service thread 1-4) JBAS011802: Starting Naming Servicern13:25:24,708 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-3) JBAS015400: Bound mail session [java:jboss/mail/Default]rn13:25:24,737 INFO  [org.jboss.as.security] (MSC service thread 1-1) JBAS013170: Current PicketBox version=4.0.20.Finalrn13:25:24,754 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 50) JBAS015537: Activating WebServices Extensionrn13:25:24,800 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017502: Undertow 1.0.0.Final startingrn13:25:24,800 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 49) JBAS017502: Undertow 1.0.0.Final starting

n

Note : You can use –b [IP] option to start server with some other IP and to load some other config file use -c [configuration file name].

n

Domain Mode

n

This is new concept which gets introduced in AS-7.* . With this new feature in WildFly-8, we can manage different instances from a single point. This really helps us to shrink down to one control point instead of managing multiple standalone servers.

n

All the servers managed by Domain are known as members of domain. All the members of domain can share same configuration/deployments. This is really handy and helpful for clustering environment.

n

In Domain mode we can create a server group and then can add number of servers to that group. With this whatever we do on this Server Group, everything will get replicated to each server in Server Groups.

n

Starting WildFly in Domain Mode

n

Move to $JBOSS_HOME/bin directory and launch domain.sh script from terminal as shown below.

n

[[emailxa0protected] bin]# ./domain.sh

n

Sample Output

n

=========================================================================rnrn  JBoss Bootstrap Environmentrnrn JBOSS_HOME: "/data/wildfly-8.0.0.Final"rnrn  JAVA: javarnrn  JAVA_OPTS: -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=truernrn=========================================================================rnrn13:30:33,939 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.0.Finalrn13:30:34,077 INFO  [org.jboss.as.process.Host Controller.status] (main) JBAS012017: Starting process 'Host Controller'rn[Host Controller] 13:30:34,772 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.0.Finalrn[Host Controller] 13:30:34,943 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.0.Finalrn[Host Controller] 13:30:34,999 INFO  [org.jboss.as] (MSC service thread 1-4) JBAS015899: WildFly 8.0.0.Final "WildFly" startingrn[Host Controller] 13:30:35,689 INFO  [org.xnio] (MSC service thread 1-1) XNIO version 3.2.0.Finalrn[Host Controller] 13:30:35,692 INFO  [org.jboss.as] (Controller Boot Thread) JBAS010902: Creating http management service using network interface (management) port (9990) securePort (-1)rn[Host Controller] 13:30:35,701 INFO  [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.2.0.Finalrn[Host Controller] 13:30:35,747 INFO  [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 4.0.0.Finalrn[Host Controller] 13:30:35,817 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on 127.0.0.1:9999rn^C13:30:36,415 INFO  [org.jboss.as.process] (Shutdown thread) JBAS012016: Shutting down process controllerrn13:30:36,416 INFO  [org.jboss.as.process.Host Controller.status] (Shutdown thread) JBAS012018: Stopping process 'Host Controller'rn[Host Controller] 13:30:36,456 INFO  [org.jboss.as] (MSC service thread 1-2) JBAS015950: WildFly 8.0.0.Final "WildFly" stopped in 19msrn[Host Controller] rn13:30:36,476 INFO  [org.jboss.as.process.Host Controller.status] (reaper for Host Controller) JBAS012010: Process 'Host Controller' finished with an exit status of 130rn13:30:36,476 INFO  [org.jboss.as.process] (Shutdown thread) JBAS012015: All processes finished; exiting

n

Another thing that you will notice the difference between the number of services that got started in Standalone (183 out 0f 232) and Domain mode (207 out of 255).

n

Domain Mode Logical View
Domain Mode Logical View

n

Another most important difference between Standalone and Domain Mode is startup command used in startup script. In standalone, entry point is “org.jboss.as.standalone” whereas in domain mode entry point is “org.jboss.as.process-controller”. Below is the figure showing logical relationship between different processes.

n

Relationship Between Different Processes
Relationship Between Different Processes

n

In domain mode, first it will start process controller and it spawns a new process called Host Controller. This Host Controller process will be responsible for handling multiple servers within different server-groups. Another point that need to be note that every Server will have its own JVM process.

n

That’s all it for now! In our upcoming article we will show a different ways of doing deployments in WildFly. Till, then stay tuned and connected to Tecmint and don’t forget to give your valuable feedback in our comment section below.

n

‘]