A Spring Boot multi-module project for learning and experimenting with Apache Geode distributed caching system.
- Overview
- Architecture
- Modules
- Prerequisites
- Quick Start
- API Documentation
- Development
- Configuration
- Troubleshooting
- Repository Conventions
This lab provides a complete Apache Geode setup with:
- Embedded Locator: Service discovery and cluster coordination
- Data Server: Distributed cache server with management API
- Data Browser: Web-based GUI for browsing and managing Geode cluster data
- Spring Boot Integration: Automatic lifecycle management
- RESTful APIs: Easy-to-use HTTP endpoints for cluster and data management
βββββββββββββββββββ
β Locator β β Service discovery & cluster coordination
β (Port 10334) β
ββββββββββ¬βββββββββ
β
β connects to
β
ββββββββββΌβββββββββ ββββββββββββββββββββ
β Data Server ββββββββ€ Data Browser β
β (Port 8080) β β (Port 8081) β
β β β - Web UI β
β - Management β β - REST API β
β API β β - Jetty Server β
βββββββββββββββββββ ββββββββββββββββββββ
- Locator starts first and provides discovery service
- Data Server connects to Locator and joins the cluster, provides management API
- Data Browser connects to Locator as a client and provides Web UI + REST API
- Data Browser calls Data Server's management API for region creation/deletion
A Spring Boot application that runs an embedded Apache Geode Locator.
Key Features:
- Service discovery for cluster members
- Membership coordination
- Client discovery endpoints
See: locator/README.md for detailed documentation.
A Spring Boot application that provides an embedded Geode Data Server with management API.
Key Features:
- Connects to Locator automatically
- Management API for region operations (create/delete)
- Pure data server (no web interface)
See: data-server/README.md for detailed documentation.
A Spring Boot Web application (using Jetty) that provides a modern web interface for browsing and managing Geode cluster data.
Key Features:
- Web-based GUI similar to GemFire's native GUI
- Cluster status visualization
- Region browser and management
- Data viewer with pagination
- RESTful API for all operations
- Connects to cluster via Locator (ClientCache)
- Calls Data Server for region management operations
See: data-browser/README.md for detailed documentation.
- Java 21+ (tested with Java 21)
- Maven 3.6+ (or use included
mvnw) - IntelliJ IDEA (optional, for IDE support)
# From repository root
./mvnw -pl locator spring-boot:runWait for the locator to start (usually takes a few seconds). You should see:
Locator in /path/to/target/locator on localhost[10334] as locator is currently online.
In a new terminal:
./mvnw -pl data-server spring-boot:runThe data server will connect to the locator and start the management API on port 8080.
In a new terminal:
./mvnw -pl data-browser spring-boot:runThe data browser will connect to the locator and start the web interface on port 8081.
Open your browser and navigate to:
http://localhost:8081
You can now:
- View cluster status and members
- Browse regions
- Create new regions (with type descriptions)
- View and browse data in regions
Data Browser API (Port 8081):
# Check cluster status
curl http://localhost:8081/api/cluster/status
# Get all regions
curl http://localhost:8081/api/regions
# Create a region
curl -X POST "http://localhost:8081/api/regions/myRegion?type=PARTITION"
# Get region data
curl http://localhost:8081/api/data/myRegionData Server Management API (Port 8080):
# Create a region (called by data-browser)
curl -X POST "http://localhost:8080/management/regions/myRegion?type=PARTITION"GET /api/cluster/status
Get cluster status and member information.
Response:
{
"status": "connected",
"cacheName": "DEFAULT",
"memberCount": 2,
"members": [
{
"id": "...",
"name": "locator",
"host": "localhost",
"groups": []
},
{
"id": "...",
"name": "data-server",
"host": "localhost",
"groups": []
}
]
}GET /api/regions
Get all region names.
GET /api/regions/info
Get all regions with metadata.
GET /api/regions/{regionName}
Get detailed information about a specific region.
POST /api/regions/{regionName}?type=PARTITION
Create a new region. The request is forwarded to data-server.
Query Parameters:
type(optional): Region type (default:PARTITION)- Valid values:
PARTITION,REPLICATE,PARTITION_PERSISTENT,REPLICATE_PERSISTENT,PARTITION_REDUNDANT,REPLICATE_HEAP_LRU,PARTITION_HEAP_LRU
- Valid values:
DELETE /api/regions/{regionName}
Delete a region.
GET /api/data/{regionName}
Get all data in a region (with pagination: ?limit=100&offset=0).
GET /api/data/{regionName}/keys
Get all keys in a region.
GET /api/data/{regionName}/{key}
Get a specific key-value pair.
POST /api/data/{regionName}/{key}
Put data into a region.
DELETE /api/data/{regionName}/{key}
Delete data from a region.
POST /management/regions/{regionName}?type=PARTITION
Create a new region on the server.
DELETE /management/regions/{regionName}
Delete a region from the server.
-
Import Run Configurations
- Run configurations are in
.idea/runConfigurations/ - IDEA should automatically detect them
- If not: Run β Edit Configurations β Import from
.idea/runConfigurations/
- Run configurations are in
-
Start Locator
- Select "LocatorApplication" from run configuration dropdown
- Click Run (or press
Shift+F10) - Wait for startup to complete
-
Start Data Server
- Select "DataServerApplication" from run configuration dropdown
- Click Run (or press
Shift+F10)
-
Start Data Browser
- Select "DataBrowserApplication" from run configuration dropdown
- Click Run (or press
Shift+F10) - Open browser to http://localhost:8081
Note: JVM arguments for Java module system are pre-configured in the run configurations.
# Build all modules
./mvnw clean install
# Run tests
./mvnw test
# Build specific module
./mvnw -pl locator clean install
./mvnw -pl data-server clean install
./mvnw -pl data-browser clean installFor quick testing without starting actual Geode components:
# Run locator without starting Geode Locator
./mvnw -pl locator spring-boot:run \
-Dspring-boot.run.arguments="--geode.locator.enabled=false"
# Run data-server without connecting to Geode
./mvnw -pl data-server spring-boot:run \
-Dspring-boot.run.arguments="--geode.dataserver.enabled=false"Edit locator/src/main/resources/application.properties:
geode.locator.enabled=true
geode.locator.port=10334
geode.locator.member-name=locator
geode.locator.working-dir=target/locatorEdit data-server/src/main/resources/application.properties:
geode.dataserver.enabled=true
geode.dataserver.member-name=data-server
geode.dataserver.working-dir=target/data-server
geode.dataserver.locator-host=localhost
geode.dataserver.locator-port=10334
server.port=8080Edit data-browser/src/main/resources/application.properties:
geode.browser.locator-host=localhost
geode.browser.locator-port=10334
geode.browser.member-name=data-browser
geode.browser.data-server-url=http://localhost:8080
server.port=8081For Java 21+, the following JVM arguments are required (already configured in pom.xml and IDEA run configurations):
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
--add-opens java.base/java.lang.invoke=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/java.util.concurrent=ALL-UNNAMED
--add-opens java.base/java.net=ALL-UNNAMED
--add-opens java.base/java.text=ALL-UNNAMED
--add-opens java.desktop/java.awt.font=ALL-UNNAMEDSolution: Ensure JVM arguments are configured. They are automatically included when using Maven or IDEA run configurations.
Solutions:
- Ensure Locator is running first
- Check
geode.dataserver.locator-hostandgeode.dataserver.locator-portmatch Locator configuration - Verify Locator is listening on the correct port:
netstat -an | grep 10334
Solutions:
- Ensure Locator is running
- Check
geode.browser.locator-hostandgeode.browser.locator-portmatch Locator configuration - Verify Data Server is running (required for region management)
Solution: This has been fixed in the current implementation. Services use CacheFactory.getAnyInstance() directly instead of injected beans.
Solutions:
- Change port in
application.properties - Kill the process using the port:
# Find process lsof -i :10334 # for locator lsof -i :8080 # for data-server lsof -i :8081 # for data-browser # Kill process kill -9 <PID>
Solution: The Data Browser automatically creates a PROXY region after creation. If it doesn't appear, try refreshing the regions list or check the browser console for errors.
- All Markdown files must be written in English
- All code comments must be written in English
- Commit messages follow conventional commits format
tech-lab/
βββ locator/ # Locator module
β βββ src/
β βββ pom.xml
β βββ README.md
βββ data-server/ # Data Server module
β βββ src/
β βββ pom.xml
β βββ README.md
βββ data-browser/ # Data Browser module
β βββ src/
β β βββ main/
β β β βββ java/
β β β βββ resources/
β β β β βββ static/ # CSS, JS
β β β β βββ templates/ # HTML templates
β β β βββ ...
β βββ pom.xml
β βββ README.md
βββ .idea/
β βββ runConfigurations/ # IDEA run configurations
βββ pom.xml # Parent POM
βββ README.md # This file
- Apache Geode Documentation
- Spring Boot Documentation
- Module-specific READMEs | data-server/README.md | data-browser/README.md
See LICENSE file for details.
- Create a feature branch
- Make your changes
- Write tests
- Submit a pull request
Happy Learning! π