How to do domain mode configurations through JBoss EAP RPM installation?

Solution Verified - Updated -

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x
    • 7.x

Issue

  • How to setup a domain-mode environment with RPM installation of JBoss EAP 6?

  • The data directory of domain is created at the following location :

/var/tmp/jbossas/domain

Why is it configured by default in this path in rpm installation? Is it possible to change it?

  • Also, how to change the path of the following directories :

    • /etc/jbossas/domain/configuration
    • /var/log/jbossas/domain/log
    • /var/cache/jbossas/domain/tmp
  • Is it possible to configure this path during yum installation by default?

  • Would like to change the EAP_HOME for rpm based installation of JBoss, is there this possibility

Resolution

EAP 6

After installing JBoss EAP instances via yum, enable the jbossas-domain service on machines (via command line or service configuration UI). One can further configure the service via the /etc/sysconfig/jbossas-domain script.

For this particular setup, first configure one service (domain controller) to utilize the host-master.xml. Corresponding services (host controllers) will utilize host-slave.xml.

The domain controller's /etc/sysconfig/jbossas-domain script would look like such (changes only):

...
# Define where jboss is - this is the directory containing directories appclient, bin, bundles, docs, domain etc
JBOSS_HOME="/usr/share/jbossas"
#
# Make sure java is on your path
# JAVAPTH="$JAVA_HOME/bin"
#
# Define jboss configuration to start
JBOSSCONF="domain"
#
# Define the script to use to start jboss
JBOSSSH="$JBOSS_HOME/bin/$JBOSSCONF.sh"
#
# Define server configuration to start, eg. standalone.xml
# JBOSS_SERVER_CONFIG=""
#
# Define host configuration to start, eg. host.xml
JBOSS_HOST_CONFIG="host-master.xml"
#

The host controller jbossas-domain service would look like such (changes only):

...
# Define where jboss is - this is the directory containing directories appclient, bin, bundles, docs, domain etc
JBOSS_HOME="/usr/share/jbossas"
#
# Make sure java is on your path
# JAVAPTH="$JAVA_HOME/bin"
#
# Define jboss configuration to start
JBOSSCONF="domain"
#
# Define the script to use to start jboss
JBOSSSH="$JBOSS_HOME/bin/$JBOSSCONF.sh"
#
# Define server configuration to start, eg. standalone.xml
# JBOSS_SERVER_CONFIG=""
#
# Define host configuration to start, eg. host.xml
JBOSS_HOST_CONFIG="host-slave.xml"
#

This service configures 1 instance as a domain controller and 1 instance as a host controller.

To setup EAP 6 in Domain Mode with Remote Host Controllers, Refer this KCS.

Note : The JBoss EAP's home directory is installed to /usr/share/jbossas when using RPM install.

The data directory is installed at /var/tmp/jbossas/domain location because /usr/share/jbossas/domain/data is a symlink to /var/tmp/jbossas/domain. This is a bug with the RPM installation Bz-998319 which has been resolved in EAP 6.2.0.

  • However, it is possible to change the path of data,tmp, log and configuration directories as per requirement.
    • In the /etc/sysconfig/jbossas-mydomain file, add the following java options :
  JAVA_OPTS="$JAVA_OPTS -Djboss.domain.data.dir=/path"
 JAVA_OPTS="$JAVA_OPTS -Djboss.domain.config.dir=/path"
 JAVA_OPTS="$JAVA_OPTS -Djboss.domain.log.dir=/path"
 JAVA_OPTS="$JAVA_OPTS -Djboss.domain.temp.dir=/path"

Changing this paths during RPM installation is not possible since this paths are configured in rpm packages itself. In order to change that, all the RPM packages will have to be re-built. So if customization is required than it is always suggested to go for the Zipped installation of EAP.

EAP 7

This is very similar to EAP 6, but the files placement are different.

After installing the RPM with 'yum' it should create a service with name eap7-domain. Use systemctl start eap7-domain to start the process.

The equivalent configuration file to EAP 6 is /etc/opt/rh/eap7/wildfly/eap7-domain.conf. In there it's possible to configure as required everything needed

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.