Red Hat JBoss EAP 8 Configuration
Overview of Red Hat JBoss EAP 8 Standalone mode
-
Standalone servers are perfect for running a single instance of Red Hat JBoss EAP.
-
You can run multiple standalone instances on the same server or across different servers. Each server is managed "standalone", that is, individually.
-
The configurations for standalone server are:
-
JBOSS_HOME/standalone/configuration/standalone.xmlfile -
JBOSS_HOME/standalone/configuration/standalone-ha.xmlfile -
JBOSS_HOME/standalone/configuration/standalone-full.xmlfile -
JBOSS_HOME/standalone/configuration/standalone-full-ha.xmlfile
-
-
Various subsystems like logging, messaging, and data sources can be configured within this file.
-
Red Hat JBoss EAP 8 standalone server supports clustering and high availability, configurable through various files alongside
standalone.xml.
|
Avoid direct editing of |
|
The standalone server and managed domain modes differ primarily in how they manage and configure JBoss EAP instances, not in their capabilities. |
The Standalone Directory Structure
-
After installing a Red Hat JBoss EAP 8 distribution, the standalone directory initially contains the following subdirectories:
[vagrant@server standalone]$ pwd /opt/EAP-8.0.0/standalone [vagrant@server standalone]$ ls configuration/ deployments/ lib/
-
Brief description of these subdirectories:
-
configuration: This directory holds:
-
Standalone server configuration files
-
standalone_xml_historysubdirectory for version control -
logging.propertiesfor logger configuration -
mgmt-users.propertiesfor login credentials -
mgmt-groups.propertiesfor login roles.
-
-
deployments: This directory holds:
-
Application deployment files used by Jakarta EE, such as EAR, WAR, and JAR files.
-
Marker files
-
-
lib: Contains common JAR files.
-
-
After running the Red Hat JBoss EAP 8 the first time, the following subdirectories of standalone are created:
data/ log/ tmp/
-
Breif description of these subdirectories:
-
data: A storage location for subsystems handling file system content, like message queues, in-memory databases, or distributed transaction information.
-
log: The default location for the server log files.
-
tmp: For temporary files, like the shared-key mechanism for authenticating local users to the server’s command-line interface (CLI).
-
Red Hat JBoss EAP 8 Base Directory
-
Users can separate the configuration and data directories from the JBoss EAP 8 installation directory, aiding easier upgrades.
-
This allows the binaries to be installed once and run multiple times on the same machine.
-
Two command-line properties enable this:
-
jboss.home.dir: Installation directory for JBoss EAP binaries.
-
jboss.server.base.dir: Base directory for server configuration files.
-
-
You can override runtime properties at the command line by using the
-Doption when starting the server. Some important command-line properties using-Doption:-
jboss.server.base.dir:
-
Specifies the base directory for the server instance.
-
It points to the directory where configuration files, logs, deployments, and other server-related data are stored.
-
-
jboss.socket.binding.port-offset:
-
This option allows you to offset the port numbers used by the server.
-
It’s useful when you want to run multiple instances of JBoss on the same host without port conflicts.
-
For example, if the default HTTP port is 8080 and you set jboss.socket.binding.port-offset to 100, then the HTTP port for this instance would be 8180.
-
-
jboss.bind.address:
-
This option specifies the IP address that the JBoss server binds to for incoming network connections.
-
By default, it binds to all available network interfaces (0.0.0.0).
-
-
jboss.bind.address.management:
-
Similar to
jboss.bind.address, this option specifies the IP address that the JBoss management interfaces (like JMX, CLI, etc.) bind to.
-
-
-
For instance, when starting the server with standalone.sh, you can use
-Doption to specify the custom configuration using the command line options mentioned above as shown below.$ ./standalone.sh -Djboss.server.base.dir=/path/to/base/directory \ -Djboss.home.dir=/path/to/home/directory \ -Djboss.socket.binding.port-offset=100 \ -Djboss.bind.address=172.25.250.9 \ -Djboss.bind.address.management=172.25.250.9
Lab: Configure JBoss EAP 8 standalone server using a customised settings
Outcome: In this lab, you should be able to run two instances of JBoss EAP on the same server using using a custom location for the server base directory, custom port and a custom binding IP address.
-
Create a custom location for the server base directory using below command.
[vagrant@server ~]$ sudo mkdir -p /opt/standalone-running
-
Copy the configuration, deployments, and lib directories to the new location.
[vagrant@server ~]$ cd /opt/EAP-8.0.0/standalone/ [vagrant@server standalone]$ sudo cp -r configuration deployments lib \ /opt/standalone-running
-
Run and test the JBoss EAP Server.
-
Run the following command to start the JBoss EAP server by using the
standalone.shscript in the original JBoss EAP installation, but using the new configuration files. Change the port-offset attribute to10000using thejboss.socket.binding.port-offsetproperty on the command line. Also modify the IP address that the JBoss server binds to for incoming network connections using thejboss.bind.addressandjboss.bind.address.management.[vagrant@server ~]$ cd /opt/EAP-8.0.0/bin [vagrant@server bin]$ sudo ./standalone.sh \ -Djboss.server.base.dir=/opt/standalone-running/ \ -Djboss.socket.binding.port-offset=10000 \ -Djboss.bind.address=172.25.250.9 \ -Djboss.bind.address.management=172.25.250.9
-
The server starts up successfully with an output similar to the following:
10:24:24,663 INFO [org.jboss.ws.common.management] (MSC service thread 1-4) JBWS022052: Starting JBossWS 7.0.0.Final-redhat-00001 (Apache CXF 4.0.0.redhat-00002) 10:24:24,666 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) WFLYDS0013: Started FileSystemDeploymentService for directory /opt/standalone-running/deployments 10:24:24,793 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server 10:24:24,797 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://172.25.250.9:19990/management 10:24:24,797 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://172.25.250.9:19990
-
-
Navigate to http://172.25.250.9:18080 to see the JBoss EAP welcome page with the new port offset.
-
Navigate to http://172.25.250.9:19990 to see the JBoss EAP management console, which runs with the same port offset.
-
Explore the contents of the directory
/opt/standalone-runningin a new terminal window:[vagrant@server ~]$ ls /opt/standalone-running/ configuration data deployments lib log tmp
Notice the three data, log, and tmp new directories. These directories are automatically created when the JBoss EAP server starts.
-
Stop the running instance of JBoss EAP that was started in the previous step. Press
Ctrl+Cin the terminal window in which the server is running.