Guide to Setting Up a Multi‑Host JVM Monitoring Tool with Spring Boot
This tutorial explains how to deploy a Spring Boot‑based monitoring solution that tracks multiple remote JVMs, covering repository cloning, configuration of server and client properties, Maven installation of the starter jar, and running the monitor‑server with example code snippets and screenshots.
Introduction – The project provides a convenient way for developers to monitor multiple remote JVMs. It can be easily integrated into Spring Boot applications by adding a starter jar, and it also works for non‑Spring Boot projects after manual initialization.
Effect Display – (Images omitted) show the monitoring UI after deployment.
Overall Architecture – (Images omitted) illustrate the system components: a monitor‑server that aggregates JVM metrics and monitor‑clients deployed on each host.
Git Repositories
https://github.com/xk4848123/monitor
https://github.com/xk4848123/monitor-server
Prerequisites – Java JDK must be installed and accessible via the system PATH because the program uses ExecuteCmd to locate JDK commands.
Step‑by‑step Setup
Clone monitor‑server
git clone https://github.com/xk4848123/monitor-server.gitImport the project into IDEA (Project from Existing Sources…) and select the pom.xml file.
Modify resources/application.properties to define the monitored servers:
monitor.serve[0].name=serve-1
monitor.serve[0].address=http://127.0.0.1:8081/monitor
monitor.serve[1].name=serve-2
monitor.serve[1].address=http://127.0.0.1:8082
...Each entry must follow the format address=http://ip:port/xxx and a unique name=server-1 .
Run monitor-server . If the client is not yet deployed, you can start it later.
Installation of the Starter Jar
Download the release JAR from the GitHub releases page and install it to the local Maven repository:
mvn install:install-file -DgroupId=com.github.xk4848123 -DartifactId=monitor-spring-boot-starter -Dversion=2.3.1 -Dpackaging=jar -Dfile=C:\Users\Administrator\Downloads\monitor-spring-boot-starter.jarIn any Spring Boot project, add the following properties to resources/application.properties :
# Define the access path (customizable)
monitor.path=monitor
# Enable the monitoring client
monitor.enable=trueAdd the starter dependency to pom.xml (see screenshot in original article) and run the application.
Access the monitoring UI at http://127.0.0.1:8888 (or the address you configured).
Conclusion – Deploy a single monitor‑client on each host; the server aggregates metrics from all JVMs, providing a unified view of multiple applications.
Java Architect Essentials
Committed to sharing quality articles and tutorials to help Java programmers progress from junior to mid-level to senior architect. We curate high-quality learning resources, interview questions, videos, and projects from across the internet to help you systematically improve your Java architecture skills. Follow and reply '1024' to get Java programming resources. Learn together, grow together.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.