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.

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.

Cluster Architecture
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.

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
Open the environment wizard
Click New Environment in the platform dashboard.
Select GlassFish
Open the Java tab and choose GlassFish as the application server.
Increase the node count
Use the horizontal-scaling control to add the required number of GlassFish instances.
Enable High Availability
Turn on the High Availability option so the platform pairs the nodes into clusters.
Create the environment
Click Create. The platform provisions a clustered environment with instance replication inside each cluster and cluster-level redundancy across 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.
