WildFly (JBoss Application Server) Basic Concepts
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.
- WildFly – A New Improved JBoss Application Server Installation
- Manage WildFly (JBoss AS) Server Using GUI version of CLI
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.
Below are the some of the basic terms used in WildFly:
Wildfly have introduced new startup modes. It have two modes of operations used are managing all server operations.
- Standalone Mode
- Domain Mode
Both these modes are handled by the two different scripts provided within “bin” directory of WildFly installation.
[[email protected] bin]# ll -m1 standalone.sh domain.sh domain.sh standalone.sh
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.
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).
We can also form different HA clusters as we were doing with earlier version i.e. 4, 5 or 6.
Starting WildFly in Standalone Mode
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.
[[email protected] bin]# ./standalone.sh
tecmint-VGN-Z13GN bin # ./standalone.sh ========================================================================= JBoss Bootstrap Environment JBOSS_HOME: "/data/wildfly-8.0.0.Final" JAVA: java JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true ========================================================================= 13:25:22,168 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.0.Final 13:25:22,717 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.0.Final 13:25:22,818 INFO [org.jboss.as] (MSC service thread 1-3) JBAS015899: WildFly 8.0.0.Final "WildFly" starting 13:25:24,287 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http) 13:25:24,310 INFO [org.xnio] (MSC service thread 1-1) XNIO version 3.2.0.Final 13:25:24,332 INFO [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.2.0.Final 13:25:24,486 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 33) JBAS010280: Activating Infinispan subsystem. 13: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) 13:25:24,514 INFO [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 4.0.0.Final 13:25:24,573 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 39) JBAS012615: Activated the following JSF Implementations: [main] 13:25:24,575 INFO [org.jboss.as.connector.logging] (MSC service thread 1-3) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.3.Final) 13:25:24,587 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010417: Started Driver service with driver-name = h2 13:25:24,622 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 41) JBAS011800: Activating Naming Subsystem 13:25:24,691 INFO [org.jboss.as.security] (ServerService Thread Pool -- 46) JBAS013171: Activating Security Subsystem 13:25:24,707 INFO [org.jboss.as.naming] (MSC service thread 1-4) JBAS011802: Starting Naming Service 13:25:24,708 INFO [org.jboss.as.mail.extension] (MSC service thread 1-3) JBAS015400: Bound mail session [java:jboss/mail/Default] 13:25:24,737 INFO [org.jboss.as.security] (MSC service thread 1-1) JBAS013170: Current PicketBox version=4.0.20.Final 13:25:24,754 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 50) JBAS015537: Activating WebServices Extension 13:25:24,800 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017502: Undertow 1.0.0.Final starting 13:25:24,800 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 49) JBAS017502: Undertow 1.0.0.Final starting
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].
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.
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.
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.
Starting WildFly in Domain Mode
Move to $JBOSS_HOME/bin directory and launch domain.sh script from terminal as shown below.
[[email protected] bin]# ./domain.sh
========================================================================= JBoss Bootstrap Environment JBOSS_HOME: "/data/wildfly-8.0.0.Final" JAVA: java JAVA_OPTS: -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true ========================================================================= 13:30:33,939 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.0.Final 13:30:34,077 INFO [org.jboss.as.process.Host Controller.status] (main) JBAS012017: Starting process 'Host Controller' [Host Controller] 13:30:34,772 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.0.Final [Host Controller] 13:30:34,943 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.0.Final [Host Controller] 13:30:34,999 INFO [org.jboss.as] (MSC service thread 1-4) JBAS015899: WildFly 8.0.0.Final "WildFly" starting [Host Controller] 13:30:35,689 INFO [org.xnio] (MSC service thread 1-1) XNIO version 3.2.0.Final [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) [Host Controller] 13:30:35,701 INFO [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.2.0.Final [Host Controller] 13:30:35,747 INFO [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 4.0.0.Final [Host Controller] 13:30:35,817 INFO [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on 127.0.0.1:9999 ^C13:30:36,415 INFO [org.jboss.as.process] (Shutdown thread) JBAS012016: Shutting down process controller 13:30:36,416 INFO [org.jboss.as.process.Host Controller.status] (Shutdown thread) JBAS012018: Stopping process 'Host Controller' [Host Controller] 13:30:36,456 INFO [org.jboss.as] (MSC service thread 1-2) JBAS015950: WildFly 8.0.0.Final "WildFly" stopped in 19ms [Host Controller] 13: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 130 13:30:36,476 INFO [org.jboss.as.process] (Shutdown thread) JBAS012015: All processes finished; exiting
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).
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.
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.
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.