How to do Domain mode configurations through RPM installation?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Issue
-
How to setup a domain-mode environment with RPM installation of JBoss EAP 6?
-
The
datadirectory 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?
Resolution
-
After installing JBoss instances via yum, enable the
jbossas-domainservice 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 utilizehost-slave.xml. -
The domain controller's
/etc/sysconfig/jbossas-domainscript 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-domainservice 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 EAP6 in Domain Mode with Remote Host Controllers, Refer this KCS.
Note : The JBoss's home directory is installed to /usr/share/jbossas when using RPM install.
-
The data directory is installed at
/var/tmp/jbossas/domainlocation because/usr/share/jbossas/domain/datais 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, logandconfigurationdirectories as per requirement.- In the
/etc/sysconfig/jbossas-mydomainfile, add the following java options :
- In the
JAVA_OPTS="$JAVA_OPTS -Djboss.domain.data.dir=/your path"
JAVA_OPTS="$JAVA_OPTS -Djboss.domain.config.dir=/your path"
JAVA_OPTS="$JAVA_OPTS -Djboss.domain.log.dir=/your path"
JAVA_OPTS="$JAVA_OPTS -Djboss.domain.temp.dir=/your path"
- Changing this paths during RPM installation is not possible since this paths are configured in rpm packages itselt. Inorder 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.
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.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
