- Lab
- A Cloud Guru
Troubleshooting a JBoss EAP Installation
Red Hat JBoss Enterprise Application Platform (EAP) is a Java EE-based cross-application platform built around deploying and managing Java applications and services. This hands-on lab explores troubleshooting common things that can go wrong during the installation of JBoss EAP on Red Hat Enterprise Linux 8.
Path Info
Table of Contents
-
Challenge
Install JBoss
-
Run the installer located in the
cloud_user
's home directory:sudo java -jar jboss-eap-7.2.0-installer.jar -console
-
Review installer:
- Set the language.
- Accept terms.
- Set path (use
/opt/jboss-eap
to match default configuration). - Install all packages.
- Set admin name (
admin
). - Set admin password.
- Use the default configuration.
- Choose whether to save an automatic installation script based on this install.
-
Create the service user:
sudo useradd --no-create-home --shell /bin/false/ jboss-eap
-
Open the configuration file and uncomment the
JBOSS_HOME
andJBOSS_USER
settings; save and exit.cd /opt/jboss-eap sudo vim bin/init.d/jboss-eap.conf
-
Copy service files to the appropriate locations:
sudo cp bin/init.d/jboss-eap.conf /etc/default/ sudo cp bin/init.d/jboss-eap-rhel.sh /etc/init.d/
-
Set script as an executable:
sudo chmod +x /etc/init.d/jboss-eap-rhel.sh
-
Set the service to start automatically:
sudo chkconfig --add jboss-eap-rhel.sh sudo chkconfig jboss-eap-rhel.sh on
-
Attempt to start JBoss EAP:
sudo systemctl start jboss-eap-rhel
The service start should fail.
-
-
Challenge
Determine Cause of Failure (SELinux)
-
Begin troubleshooting by viewing the
journalctl
log, as suggested in the output:journalctl -xe | less
-
Scroll towards the bottom of the logs. Look for a line stating:
SELinux is preventing jboss-eap-rhel. from create access on the file console.log.
-
We'll need to update SELinux to allow JBoss. Luckily, instructions for this are included in the log itself. Note that we'll have to adjust the commands to use
sudo
:sudo ausearch -c 'jboss-eap-rhel.' --raw | sudo audit2allow -M jboss-eap-rhel sudo semodule -X 300 -i jboss-eap-rhel.pp
-
Attempt to start JBoss once more:
sudo systemctl start jboss-eap-rhel
Once more, it will fail.
-
-
Challenge
Determine Cause of Failure (Permissions)
-
Rerun the
journalctl
command:journalctl -xe | less
-
Once more, scroll towards the bottom. Here we can see a permissions error:
Starting jboss-eap: chown: missing operand after ‘/var/run/jboss-eap’
-
We'll need to ensure our
jboss-eap
user can access the/var/run/jboss-eap
directory:sudo chown -R jboss-eap:jboss-eap /var/run/jboss-eap
-
Attempt another service start:
sudo systemctl start jboss-eap-rhel
Yet again, it fails.
-
-
Challenge
Determine Cause of Failure (JBoss Logs)
-
Should we check the logs this time, what we're given is not very helpful. Instead, we want to look at JBoss's logs themselves, found at
/var/log/jboss-eap
:cat /var/log/jboss-eap/console.log
Note that not all log content will be here. This is because our
jboss-eap
user doesn't have permissions for this directory:ls -al /var/log/jboss-eap/
-
Change the ownership for this directory:
sudo chown -R jboss-eap:jboss-eap /var/log/jboss-eap
-
Rerun the
start
command:sudo systemctl start jboss-eap-rhel
-
Now we can review our logs:
less /var/log/jboss-eap/console.log
-
Notice that we cannot create a directory in
/opt/jboss-eap
— this also needs to have its ownership updated:sudo chown -R jboss-eap:jboss-eap /opt/jboss-eap
-
Start the service:
sudo systemctl start jboss-eap-rhel
-
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.