Search This Blog

Sunday 24 January 2021

Understanding of Cluster and Cluster Architecture

 Clustering

A Cluster is a group of WebLogic Server instances.

 A WebLogic Server cluster consists of multiple WebLogic Server server instances running simultaneously and working together to provide increased scalability and reliability.

Benefits of Cluster

  • High availability: WebLogic Clustering provides high availability features for the application. When you create a cluster and deploy application on cluster, it continues to serve the incoming requests even when one of the server instance of a cluster goes down because the other server instance can continue to serve the application processing.
  • Scalability: Scalability allows you to add and remove servers without disrupting current services.

Key Capabilities of Cluster

Failover:

a) Application Failover

Failover means that when an application component (typically referred to as an "object" in the following sections) doing a particular "job" some set of processing tasks becomes unavailable for any reason, a copy of the failed object finishes the job.

For the new object to be able to take over for the failed object:

  • There must be a copy of the failed object available to take over the job.
  • There must be information, available to other objects and the program that manages failover, defining the location and operational status of all objects so that it can be determined that the first object failed before finishing its job.
  • There must be information, available to other objects and the program that manages failover, about the progress of jobs in process so that an object taking over an interrupted job knows how much of the job was completed before the first object failed, for example, what data has been changed, and what steps in the process were completed.

WebLogic Server uses standards-based communication techniques and facilities including IP sockets and the Java Naming and Directory Interface (JNDI) to share and maintain information about the availability of objects in a cluster. These techniques allow WebLogic Server to determine that an object stopped before finishing its job, and where there is a copy of the object to complete the job that was interrupted.

b) Site Failover

When all the services and applications in a single site fail they can switch to a separate site and continue processing. 

c) Server Migration

When the server fails, pinned services can be migrated to another server in a cluster.

Load Balancing:

Load Balancing is an even distribution of the task and communication across multiple servers.  

For load balancing to occur:

  • There must be multiple copies of an object that can do a particular job.
  • Information about the location and operational status of all objects must be available.

WebLogic Server allows objects to be clustered—deployed on multiple server instances—so that there are alternative objects to do the same job. WebLogic Server shares and maintains the availability and location of deployed objects using unicast, IP sockets, and JNDI.

What Types of Objects Can Be Clustered?

  • Servlets
  • JSPs
  • EJBs
  • Remote Method Invocation (RMI) objects
  • Java Messaging Service (JMS) destinations
Communication in a Cluster

WebLogic Server instances in a cluster communicate with one another using two basic network technologies:

IP Sockets (peer to peer) : IP sockets, which are the conduits for peer-to-peer communication between clustered server instances.
IP Unicast or Multicast: Server instances use to broadcast availability of services and heartbeats that indicate continued availability.

Import Note: Default cluster messaging mode is unicast. When creating a new cluster, Oracle recommends that you use unicast for messaging within a cluster. Oracle fully supports both UDP multicast-based and TCP unicast-based clustering in WebLogic Server. Beginning in WebLogic Server 10.0, unicast-based clustering has been made the default, primarily because it simplifies out of the box cluster configuration.

IP Sockets (peer to peer) :
IP sockets provide a simple, high-performance mechanism for transferring messages and data between two applications. Clustered WebLogic Server instances use IP sockets for:
  • Accessing non-clustered objects deployed to another clustered server instance on a different machine.
  • Replicating HTTP session states and stateful session EJB states between a primary and secondary server instance.
  • Accessing clustered objects that reside on a remote server instance. ( In a multi-tier cluster architecture ). Multi-tier clusters will require more IP Sockets than a combined-tier Cluster; One socket for replicating session states. One socket for each WebLogic Server in the EJB cluster, for accessing remote objects.  
The use of IP sockets in WebLogic Server extends beyond the cluster scenario all RMI communication takes place using sockets, for example, when a remote Java client application accesses a remote object.

Cluster Communication Unicast vs Multicast:

IP Multicast: Multicast is a simple broadcast technology that enables to "subscribe" to a given IP address and port number and listen for messages. It uses UDP protocol for messaging communication. 
It sends heartbeat messages for every 10 seconds, after 3 consecutive attempts if it doesn't get any response then it mark the server as failed. Basically it take 3x10 = 30 sec to detect the server failure.

IP Unicast: WebLogic Server unicast protocol uses standard TCP/IP sockets to send messages between cluster members. Since TCP/IP sockets are a point-to-point mechanism, all cluster members receive messages directly. To limit the number of socket required as a cluster grows, WebLogic Server's unicast implementation uses a group leader mechanism.

With this mechanism:
  • WebLogic Server divides the server instances in a cluster into a fixed number of groups.
  • Each group includes one server instance that also functions as the group leader. If the group leader fails, the group elects another group leader.
  • To send and receive cluster messages, each server instance in a group makes a TCP/IP socket connection only to the group leader. The group leader connects to all its group members and all other group leaders in the cluster.
  • When a group leader receives a cluster message from a server instance in its group, it retransmits the message to all other members in the group and also to every other group leader in the cluster. The other group leaders then retransmit the message to all their group members. This enables each server instance to receive every message in a cluster without requiring that server to establish a connection to every other server instance in the cluster.
When using unicast, server instances send heartbeats to advertise their availability, similar to multicast. By monitoring heartbeat messages, server instances determine when another server instance fails. However, with unicast, the cluster heartbeat mechanism removes a server instance from the cluster if it misses a single heartbeat message, since TCP/IP is a reliable protocol.


Cluster Architecture 


Applications are generally broken into multiple tiers, each representing their distinct functionality:
  • Web Tier
  • Presentation Tier
  • Business or object Tier
WebLogic Provides clustering support for all three tiers. Other Services, such as JMS and JDBC, can take advantage of clustering but load-balancing and failover is a little different.

Deciding on a Cluster Architecture:

There are two primary cluster Architectures to chose from:
  1. Basic Cluster Architecture
  2. Multi Tier Architecture
1) Basic Cluster Architecture:

A basic cluster architecture combines static HTTP, presentation logic, business logic and objects into one cluster.

Advantages and Disadvantages of Basic Cluster Architecture: 

Advantages:
  • Easy Administration
  • Flexible load balancing
  • Robust security 
Disadvantages:
  • Can't load balance EJB method calls
  • Load Balancing across the tiers may become unbalanced



2) Multi-Tier Cluster Architecture:

The Web Tier and the business logic with service can be separated into two clusters.

Multi Tier is recommended for Web Applications that require:
  • Load Balancing for method class to clustered EJBs.
  • Flexibility for load balancing between server that provide HTTP content and servers that provide clustered objects.
  • High availability ( few single point of failure )
  • More flexible security 
Advantages and Disadvantages of Multi-Tier Cluster Architecture:

Advantages:
  • Improved load balancing
  • load balancing of EJB methods
  • Higher availability
  • Improved security options
Disadvantages:
  • Can create a bottleneck when presentation tier makes frequent calls to the business logic
  • increased licensing cost
  • Added firewall configuration complexity



Cluster Proxy Architecture

Proxy Servers are used to provide load balancing and failover for a cluster.

A proxy Server can be either software-based or hardware based. 

Software-base proxy Server: 
  • Internal to WebLogic Servlet. (WebLogic Server can act as a proxy server for WebLogic Cluster) 
  • Third Party applications: Apache webserver, IIS etc.
Hardware-based Proxy Servers: 
  • Typically a physical load balancer. Example: Big IP F5 load balancer.
Basic Cluster Proxy Architecture:

Here the static content is hosted on HTTP Servers. This is similar to basic cluster cluster Architecture except an additional Http Server.

Multi-Tier Cluster Proxy Architecture:

This is similar to multi-tier cluster architecture, except static content is hosted on non clustered HTTP Servers.







1 comment:

devops interview support said...

Devops Proxy Support, Aws Interview Support, Azure Interview Support, Devops Interview Support,, Devops Proxy Support, Aws Proxy Support, Devops Proxy Interview Support Provides DevOps Online Job Support From India and AWS DevOps, Azure DevOps Proxy.