GlassFish Cluster

GlassFish Clustering in the Cloud

GlassFish can run as a standalone Java EE application server or as a highly available clustered environment with full replication. The platform supports both an automated JPS deployment and a manually configured cluster.

Automatic Deployment via JPS Package

The automated option uses a one-click JPS package. It creates a predefined GlassFish cluster architecture in a few minutes without requiring the complete manual installation process.

Load balancerAn HAProxy Docker container distributes incoming requests.
Worker nodesGlassFish-based Docker containers run the Java application instances.
Domain Administration ServerA dedicated GlassFish container manages the administrative domain.
Isolated nodesEach component runs as a separate container for additional reliability.
JPS GlassFish Cluster on Docker
The JPS package deploys HAProxy, GlassFish worker nodes, and the Domain Administration Server as isolated containers.

Smaller workloads

For an application that does not yet require a clustered topology, use the non-clustered GlassFish JPS package.

Manual GlassFish Cluster Deployment

Manual deployment is suitable when complete control over the GlassFish topology and configuration is required. GlassFish uses an administrative-domain model, where clusters and server instances are managed by a Domain Administration Server.

GlassFish clustering architecture
GlassFish administrative domains contain clusters and instances managed by the Domain Administration Server.

Cluster Architecture

Admin ConsoleProvides a centralized graphical interface for GlassFish management.
Domain Administration ServerControls Java instances in the administrative domain.
Group Management ServiceSupplies information about clusters and their members.
NGINX load balancerDistributes requests between clusters and instances according to load and availability.

Session Replication

GlassFish instances are paired within each cluster. If the main instance fails, users are redirected to the paired instance, which contains replicated session data. If both instances in one cluster fail, users are routed to another available cluster.

GlassFish session replication
Paired GlassFish instances replicate sessions to preserve user continuity during failover.
i

Transparent failover

When replication is working correctly, end users should not notice the switch from a failed instance to its paired instance.

The environment can also be scaled vertically and horizontally. The size and number of clusters can be adjusted manually or automatically as application load changes.

Create a GlassFish Cluster Manually

1

Open the environment wizard

Click New Environment in the platform dashboard.

2

Select GlassFish

Open the Java tab and choose GlassFish as the application server.

3

Increase the node count

Use the horizontal-scaling control to add the required number of GlassFish instances.

4

Enable High Availability

Turn on the High Availability option so the platform pairs the nodes into clusters.

5

Create the environment

Click Create. The platform provisions a clustered environment with instance replication inside each cluster and cluster-level redundancy across the environment.

Create a GlassFish cluster in the topology wizard
Increase the GlassFish node count and enable High Availability before creating the environment.

Expected Result

A highly available GlassFish environment is created with load balancing, paired application instances, session replication, and cluster failover. The topology can be deployed automatically through JPS or configured manually for greater control.

Important Notes

  • The JPS package uses Docker containers for HAProxy, worker nodes, and DAS.
  • Manual deployment provides more control over the GlassFish architecture.
  • Enable High Availability to pair GlassFish nodes and activate replication.
  • Session replication depends on compatible application session data.
  • Use vertical and horizontal scaling to adjust resources and cluster size.
  • Monitor the load balancer, DAS, and worker-node health after deployment.

Common Issues and Solutions

High Availability is not enabledOpen the topology wizard, enable High Availability, and apply the environment change.
Sessions are lost after failoverCheck application session compatibility and confirm that replication is active between paired instances.
Traffic is not distributed correctlyReview the NGINX or HAProxy configuration, backend health, and load-balancer logs.
DAS cannot manage an instanceVerify the administrative-domain membership, node status, network connectivity, and DAS logs.
Cluster consumes too many resourcesReduce the node count or Cloudlet limits, or use the non-clustered GlassFish package for smaller workloads.