A single server is a single point of failure. For clients requiring 99.9% uptime we need a cluster. GlassFish 3.1 has clustering built in.
Architecture¶
2× GlassFish instances on separate servers, 1× DAS for central management, Apache HTTP with mod_jk as load balancer, Oracle database.
Session replication¶
In-memory replication via GMS for transparent failover. All objects in the HTTP session must implement Serializable — otherwise replication silently fails.
Load balancing¶
mod_jk with sticky_session=1. The user is routed to the same node. Replication is a safety net in case of node failure.
Failover testing¶
We test: graceful shutdown, kill -9, network partition. Each scenario behaves differently. A cluster without testing is worthless.
Conclusion¶
GlassFish clustering works, but requires careful configuration and thorough testing. With a cluster you have more components that can fail.
Need help with implementation?
Our experts can help with design, implementation, and operations. From architecture to production.
Contact us