How WebLogic Server Detects Server Failures
* By monitoring IP sockets between peer server instances.
– Unexpected IP socket closure marks server as “failed”.
* By monitoring server heartbeats.
– Each server instance broadcasts heartbeat messages to other members in the cluster.
– Heartbeat interval defaults to 10 second.
– Three missed heartbeats marked the server as “failed”.
Replication and Failover for Servlets and JSPs
* Via hardware load balancers.
* Via proxy plug-ins.
HTTP Session State Replication Mechanisms
* In-memory replication:
– Session state is copies from one server instance to another.
– Primary server creates primary session state.
– A session state replica is copied to another server instance in the cluster.
– Replica is kept up-to-date so that it can be used in case of primary server failure.
– Requires web applications be deployed homogeneously on all nodes in a cluster.
* File-based or JDBC-based persistence:
– JDBC-based persistence is used for HTTP session state replication within a WAN.
* Coherence Web
– Not a replace ment for in-memory state replication.
– Use
~ when an application has large HTTP session state objects.
~ when running into memory constraints due to storing HTTP session object data.
~ have an existing Coherence cluster available and want to off-load HTTP session state to it.
Programming Considerations for Clustered Servlets and JSPs
* Session data must be serializable.
* Use setAttribute() and removeAttribute() to change session state.
* Consider serialization overhead.
* Control frame access to session data.
– In a given frameset, ensure that only one frame creates and modifies session data.
– Always create the session in a frame of the first frameset your application uses.
– Access the session data only in framesets other than the first frameset.
Using Replication Groups
* A replication group is a preferred list of clustered servers to be used for storing session state replicas.
* Ranking server instances for session replication
Rank Is a member of preferred rep grp Resides on same different machine 1 yes yes 2 yes no 3 no yes 4 no no
Accessing Clustered Servlets and JSPs Using a Proxy
* Use cookie if allowed.
* Use URL rewriting if cookie not allowed.
– Enable by setting url-rewriting-enabled parameter to true in weblogic.xml. This is default behavior.
Accessing Clustered Servlets and JSPs with Load Balancing Hardware
* Clients do not use the cookie information to actively locate a server after a failure. Load balancer does it for them.
– Client side cookies or URL rewriting is recorded for history use only.
Session State Replication Across Clusters in a MAN/WAN
Network Requirements for Cross-cluster Replication
* Must include global and local hardware load balancers.
– Global load balancer: responsible for cluster level load balancing and cluster affinity.
– Local load balancer: responsible for load balancing and server affinity within a cluster.
Configuration Requirements for Cross-Cluster Replication
* A replication channel must be configured to communicate session state information from the primary to the secondary cluster.
– replication channel is created on all cluster members and has the same name
* Cross-cluster replication requires that each cluster be assigned to a different domain.
* Each domain should be set up and configured identically:
– domain configuration
– cluster and server configuration
– number of servers in clusters
– Application deployment
* Must enable trust between both domains.
* for WAN cross-cluster replication, must create a data source to maintain session state.
Replication and Failover for EJBs and RMIs
* Failover is accomplished using the object’s replica-aware stub.
Failover and JDBC Connections
* Failover of JDBC connections are not supported.
– server dies, then all JDBC connections also die.
* Use multi data source.