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:

    1. JBOSS_HOME/standalone/configuration/standalone.xml file

    2. JBOSS_HOME/standalone/configuration/standalone-ha.xml file

    3. JBOSS_HOME/standalone/configuration/standalone-full.xml file

    4. JBOSS_HOME/standalone/configuration/standalone-full-ha.xml file

  • 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 standalone.xml file, opt for the JBoss EAP management CLI or console for safer configuration adjustments. Changes via these interfaces take effect immediately, unlike XML edits, which may not apply instantly and can be overwritten at runtime.

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:

    1. configuration: This directory holds:

      1. Standalone server configuration files

      2. standalone_xml_history subdirectory for version control

      3. logging.properties for logger configuration

      4. mgmt-users.properties for login credentials

      5. mgmt-groups.properties for login roles.

    2. deployments: This directory holds:

      1. Application deployment files used by Jakarta EE, such as EAR, WAR, and JAR files.

      2. Marker files

    3. 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:

    1. data: A storage location for subsystems handling file system content, like message queues, in-memory databases, or distributed transaction information.

    2. log: The default location for the server log files.

    3. 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:

    1. jboss.home.dir: Installation directory for JBoss EAP binaries.

    2. jboss.server.base.dir: Base directory for server configuration files.

  • You can override runtime properties at the command line by using the -D option when starting the server. Some important command-line properties using -D option:

    1. jboss.server.base.dir:

      1. Specifies the base directory for the server instance.

      2. It points to the directory where configuration files, logs, deployments, and other server-related data are stored.

    2. jboss.socket.binding.port-offset:

      1. This option allows you to offset the port numbers used by the server.

      2. It’s useful when you want to run multiple instances of JBoss on the same host without port conflicts.

      3. 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.

    3. jboss.bind.address:

      1. This option specifies the IP address that the JBoss server binds to for incoming network connections.

      2. By default, it binds to all available network interfaces (0.0.0.0).

    4. jboss.bind.address.management:

      1. 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 -D option 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.

    1. Run the following command to start the JBoss EAP server by using the standalone.sh script in the original JBoss EAP installation, but using the new configuration files. Change the port-offset attribute to 10000 using the jboss.socket.binding.port-offset property on the command line. Also modify the IP address that the JBoss server binds to for incoming network connections using the jboss.bind.address and jboss.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
    2. 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-running in 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+C in the terminal window in which the server is running.