- Lab
- A Cloud Guru
Taking Configuration Snapshots in JBoss EAP
When making changes to a JBoss EAP server configuration, it's often worthwhile to ensure copies of these configurations exist, both to revert to a snapshot should a change fail or simply to save a successful configuration for use on other servers. To do this, we can work with JBoss EAP's native snapshot feature to take, manage, and remove configuration snapshots.
Path Info
Table of Contents
-
Challenge
Deploy a Standalone Server Based on the Provided Snapshot
-
Stop the current JBoss EAP server:
sudo systemctl stop jboss-eap-rhel
-
Move into the JBoss EAP home directory:
cd /opt/jboss-eap
-
Start a standalone server using the
20191121-201850161standalone.xml
snapshot:sudo ./bin/standalone.sh --server-config=standalone_xml_history/snapshot/20191121-201850161standalone.xml
-
Check that you can access the management console at
PUBLICIP:9990
. -
Shut down the server with CTRL+C.
-
-
Challenge
Take a Snapshot of the Current Deployment
Before replacing the configuration file, we want to take a snapshot of the current configuration located at
/opt/jboss-eap/standalone/configuration/standalone.xml
just in case something fails.Note: This is the configuration used by our service and the one used in the
/opt/jboss/bin/standalone.sh
script, unless we override it as we did in the previous task.-
Restart the JBoss service:
sudo systemctl start jboss-eap-rhel
-
Open the JBoss CLI:
sudo ./bin/jboss-cli.sh
-
Connect to the server:
connect
-
Take a snapshot of the current configuration:
:take-snapshot
-
Exit the CLI:
exit
-
-
Challenge
Replace the Standalone Configuration
-
We know the
20191121-201850161standalone.xml
configuration is the one we wish to use. Since we know ourjboss-eap-rhel
service relies on/opt/jboss-eap/standalone/configuration/standalone.xml
, we can just copy our snapshot there:sudo cp standalone/configuration/standalone_xml_history/snapshot/20191121-201850161standalone.xml standalone/configuration/standalone.xml
-
Restart the service:
sudo systemctl restart jboss-eap-rhel
-
Confirm you can access the management console.
-
-
Challenge
Delete the Old Snapshot
-
Access the JBoss CLI:
sudo ./bin/jboss-cli.sh
-
Connect to the server:
connect
-
List the available snapshots:
:list-snapshots
-
Remove the backup snapshot of the failing configuration:
:delete-snapshot(name=20191122-133032735standalone.xml)
-
Exit the CLI:
exit
-
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.