{"id":3333,"date":"2011-10-28T12:53:15","date_gmt":"2011-10-28T17:53:15","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=3333"},"modified":"2011-10-28T12:53:15","modified_gmt":"2011-10-28T17:53:15","slug":"weblogic-11g-clustering-failover-and-replication-in-a-cluster","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=3333","title":{"rendered":"WebLogic 11g Clustering: Failover and Replication in a Cluster"},"content":{"rendered":"<span id=\"How_WebLogic_Server_Detects_Server_Failures\"><h2>How WebLogic Server Detects Server Failures<\/h2><\/span>\n<p>* By monitoring IP sockets between peer server instances.<br \/>\n&#8211; Unexpected IP socket closure marks server as &#8220;failed&#8221;.<br \/>\n* By monitoring server heartbeats.<br \/>\n&#8211; Each server instance broadcasts heartbeat messages to other members in the cluster.<br \/>\n&#8211; Heartbeat interval defaults to 10 second.<br \/>\n&#8211; Three missed heartbeats marked the server as &#8220;failed&#8221;.<\/p>\n<span id=\"Replication_and_Failover_for_Servlets_and_JSPs\"><h2>Replication and Failover for Servlets and JSPs<\/h2><\/span>\n<p>* Via hardware load balancers.<br \/>\n* Via proxy plug-ins.<\/p>\n<span id=\"HTTP_Session_State_Replication_Mechanisms\"><h3>HTTP Session State Replication Mechanisms<\/h3><\/span>\n<p>* In-memory replication:<br \/>\n&#8211; Session state is copies from one server instance to another.<br \/>\n&#8211; Primary server creates primary session state.<br \/>\n&#8211; A session state replica is copied to another server instance in the cluster.<br \/>\n&#8211; Replica is kept up-to-date so that it can be used in case of primary server failure.<br \/>\n&#8211; Requires web applications be deployed homogeneously on all nodes in a cluster.<br \/>\n* File-based or JDBC-based persistence:<br \/>\n&#8211; JDBC-based persistence is used for HTTP session state replication within a WAN.<br \/>\n* Coherence Web<br \/>\n&#8211; Not a replace ment for in-memory state replication.<br \/>\n&#8211; Use<br \/>\n~ when an application has large HTTP session state objects.<br \/>\n~ when running into memory constraints due to storing HTTP session object data.<br \/>\n~ have an existing Coherence cluster available and want to off-load HTTP session state to it.<\/p>\n<span id=\"Programming_Considerations_for_Clustered_Servlets_and_JSPs\"><h2>Programming Considerations for Clustered Servlets and JSPs<\/h2><\/span>\n<p>* Session data must be serializable.<br \/>\n* Use <em>setAttribute()<\/em> and <em>removeAttribute()<\/em> to change session state.<br \/>\n* Consider serialization overhead.<br \/>\n* Control frame access to session data.<br \/>\n&#8211; In a given frameset, ensure that only one frame creates and modifies session data.<br \/>\n&#8211; Always create the session in a frame of the first frameset your application uses.<br \/>\n&#8211; Access the session data only in framesets other than the first frameset.<\/p>\n<span id=\"Using_Replication_Groups\"><h2>Using Replication Groups<\/h2><\/span>\n<p>* A replication group is a preferred list of clustered servers to be used for storing session state <em>replicas<\/em>.<br \/>\n* Ranking server instances for session replication<\/p>\n<pre>\r\nRank    Is a member of preferred rep grp    Resides on same different machine\r\n1         yes                                              yes\r\n2         yes                                              no\r\n3         no                                               yes\r\n4         no                                               no\r\n<\/pre>\n<span id=\"Accessing_Clustered_Servlets_and_JSPs_Using_a_Proxy\"><h2>Accessing Clustered Servlets and JSPs Using a Proxy<\/h2><\/span>\n<p>* Use cookie if allowed.<br \/>\n* Use URL rewriting if cookie not allowed.<br \/>\n&#8211; Enable by setting url-rewriting-enabled parameter to <strong>true <\/strong>in weblogic.xml. This is <em>default <\/em>behavior.<\/p>\n<span id=\"Accessing_Clustered_Servlets_and_JSPs_with_Load_Balancing_Hardware\"><h2>Accessing Clustered Servlets and JSPs with Load Balancing Hardware<\/h2><\/span>\n<p>* Clients do not use the cookie information to actively locate a server after a failure. Load balancer does it for them.<br \/>\n&#8211; Client side cookies or URL rewriting is recorded for history use only.<\/p>\n<span id=\"Session_State_Replication_Across_Clusters_in_a_MANWAN\"><h2>Session State Replication Across Clusters in a MAN\/WAN<\/h2><\/span>\n<span id=\"\"><h4><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/09\/wl_cluster_loadbalancereqsxcluster.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/09\/wl_cluster_loadbalancereqsxcluster-240x300.gif\" alt=\"\" title=\"wl_cluster_loadbalancereqsxcluster\" width=\"240\" height=\"300\" class=\"aligncenter size-medium wp-image-3354\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/09\/wl_cluster_loadbalancereqsxcluster-240x300.gif 240w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/09\/wl_cluster_loadbalancereqsxcluster.gif 539w\" sizes=\"auto, (max-width: 240px) 100vw, 240px\" \/><\/a><\/h4><\/span>\n<span id=\"Network_Requirements_for_Cross-cluster_Replication\"><h3>Network Requirements for Cross-cluster Replication<\/h3><\/span>\n<p>* Must include global and local hardware load balancers.<br \/>\n&#8211; Global load balancer: responsible for cluster level load balancing and cluster affinity.<br \/>\n&#8211; Local load balancer: responsible for load balancing and server affinity within a cluster.<\/p>\n<span id=\"Configuration_Requirements_for_Cross-Cluster_Replication\"><h3>Configuration Requirements for Cross-Cluster Replication<\/h3><\/span>\n<p>* A replication channel must be configured to communicate session state information from the primary to the secondary cluster.<br \/>\n&#8211; replication channel is created on all cluster members and has the same name<br \/>\n* Cross-cluster replication requires that each cluster be assigned to a different domain.<br \/>\n* Each domain should be set up and configured identically:<br \/>\n&#8211; domain configuration<br \/>\n&#8211; cluster and server configuration<br \/>\n&#8211; number of servers in clusters<br \/>\n&#8211; Application deployment<br \/>\n* Must enable trust between both domains.<br \/>\n* for WAN cross-cluster replication, must create a data source to maintain session state.<\/p>\n<span id=\"Replication_and_Failover_for_EJBs_and_RMIs\"><h2>Replication and Failover for EJBs and RMIs<\/h2><\/span>\n<p>* Failover is accomplished using the object&#8217;s replica-aware stub.<\/p>\n<span id=\"Failover_and_JDBC_Connections\"><h2>Failover and JDBC Connections<\/h2><\/span>\n<p>* Failover of JDBC connections are not supported.<br \/>\n&#8211; server dies, then all JDBC connections also die.<br \/>\n* Use multi data source.<\/p>\n<span id=\"References\"><h2>References<\/h2><\/span>\n<p>* <a href=\"http:\/\/download.oracle.com\/docs\/cd\/E17904_01\/web.1111\/e13709\/failover.htm#CCHEJHCJ\">Application Failover and Replication in a Cluster<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How WebLogic Server Detects Server Failures * By monitoring IP sockets between peer server instances. &#8211; Unexpected IP socket closure marks server as &#8220;failed&#8221;. * By monitoring server heartbeats. &#8211; Each server instance broadcasts heartbeat messages to other members in &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=3333\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[104],"tags":[],"class_list":["post-3333","post","type-post","status-publish","format-standard","hentry","category-weblogic11g"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-RL","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/3333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3333"}],"version-history":[{"count":5,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/3333\/revisions"}],"predecessor-version":[{"id":3676,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/3333\/revisions\/3676"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}