Bookmark this page

Chapter 2.  Configuring JBoss EAP as a Standalone Server

Abstract

Goal

Configure a standalone server instance of JBoss EAP.

Objectives
  • Configure an instance of JBoss EAP to run a standalone server.

  • Identify the configuration files for a standalone server and make configuration changes.

  • Configure JBoss EAP network interfaces and socket binding groups.

Sections
  • Running JBoss EAP Standalone Server (and Guided Exercise)

  • Configuring JBoss EAP as a Standalone Server (and Quiz)

  • Configuring Interfaces and Socket Binding Groups (and Quiz)

Lab
  • Configuring JBoss EAP in Standalone Mode

Running JBoss EAP Standalone Server

Objectives

  • Configure an instance of JBoss EAP to run as a standalone server.

  • List the characteristics of a JBoss EAP standalone server.

Overview of Standalone Server

Standalone servers are ideal for running a single instance of Red Hat JBoss Enterprise Application Platform (JBoss EAP) as a single server. In a standalone server, all settings appear in a single point: the JBOSS_HOME/standalone/configuration/standalone.xml configuration file. Within this file, you can configure different subsystems that comprise the features of this server, such as logging, messaging, and managing data sources.

Warning

It is not generally recommended to directly edit this file. Instead use the JBoss EAP management command-line interface (CLI) or the management console, which provide a safer outlet for making configurations. Changes made with the management CLI or management console happen immediately, whereas changes to the XML do not take place immediately and can be overwritten in runtime.

A standalone server only has one profile defined by default, whereas a managed domain has four defined by default. A profile refers to a set of subsystems and their configurations used by the server.

Running multiple instances of JBoss EAP standalone servers can create several complexities, such as requiring administrators to manage port conflicts, having multiple directories with repeated files, and keeping configuration in sync for each server. To resolve these issues, JBoss EAP can be run in a managed domain. Managed domains are discussed more in depth, later in this course.

Another approach is the use of an automation management tool, such as Ansible. You can centralize the management of a group of standalone servers, by maintaining each XML configuration file with Ansible. This approach is out of the scope of this course.

JBoss EAP standalone server provides the capabilities for clustering and high availability. These features can be configured by using several of the other configuration files provided by JBoss EAP, in addition to standalone.xml.

Note

The main difference between the standalone server and the managed domain modes is the method to manage and configure the JBoss EAP instances, not the capabilities that those instances have.

The Standalone Directory Structure

After installing a JBoss EAP distribution, the standalone directory initially contains the following subdirectories:

configuration/
deployments/
lib/
configuration

Contains the configuration files for a standalone server, along with a standalone_xml_history subdirectory that maintains a version history of the configuration files. This directory also contains the logging.properties file for configuring loggers, a mgmt-users.properties users file, which defines login credentials for securing the management interfaces, and a mgmt-groups.properties file, which defines login roles.

deployments

Contains application deployment files used by Jakarta EE, such as EAR, WAR, and JAR files. Marker files, discussed later in this section, also appear in this directory.

lib

Contains common JAR files.

Note

it is a recommended practice to install Java libraries (JAR files) as modules, so this directory is often empty.

These directories are essential to start JBoss EAP. Without any of them, JBoss EAP does not start.

After running JBoss EAP the first time, the following subdirectories of standalone are created:

data/
log/
tmp/
data

a location available to subsystems that store content in the file system, such as message queue, an in-memory database, or information about distributed transactions.

log

the default location for the server log files.

tmp

for temporary files, such as the shared-key mechanism used by the command-line interface (CLI), to authenticate local users to the server.

The JBoss EAP Base Directory

The configuration and data directories of a JBoss EAP instance can be separated from the directory where JBoss EAP is installed. This allows users to maintain configurations separate from the installation, making it easier to upgrade to a newer version of JBoss EAP. The separation of the configuration and the data directories allows you to install JBoss EAP binaries just in one location, and run it multiple times on the same machine.

There are two command-line properties that enable users to create this separation between the install directory and the directories used by the running instance:

  1. jboss.home.dir: Root directory where JBoss EAP binaries are installed. If this property is not defined, then it defaults to JBOSS_HOME.

  2. jboss.server.base.dir: Base directory for the server's configuration files. If this property is not defined, then it defaults to the JBOSS_HOME/standalone directory.

For example, these properties can be set when running the standalone.sh script to start the JBoss EAP server:

$ ./standalone.sh -Djboss.server.base.dir=/path/to/base/directory \
-Djboss.home.dir=/path/to/home/directory

The port-offset attribute can be changed without editing standalone.xml, by using the jboss.socket.binding.port-offset property on the command line. For example:

$ ./standalone.sh -Djboss.socket.binding.port-offset=10000

The port-offset attribute adds the offset to all the JBoss EAP default ports. Thus, a JBoss EAP instance with a port-offset of 10000, serves the HTTP port through 18080, instead of the regular 8080 port.

Using a Customized Configuration File

By default, JBoss EAP uses the BASE_DIR/configuration/standalone.xml to start up a standalone server. However, an alternative configuration file can be used by passing the file name as a parameter of the standalone.sh script. This approach is useful to customize the configuration file without touching the default configuration files. To use a different configuration file, the --server-config parameter can be used as follows:

$ ./standalone.sh ---server-config standalone-full.xml

You can also use the -c alternative parameter:

$ ./standalone.sh -c standalone-full.xml

References

For more information about the full list of command-line parameters, when starting JBoss EAP, refer to the Server Runtime Arguments section in the Configuration Guide in the Red Hat JBoss EAP 7 documentation at https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html-single/configuration_guide/index#reference_of_switches_and_arguments_to_pass_at_server_runtime

Revision: ad248-7.4-18a9db2