From: http://www.zdnet.com.cn/server/2008/0411/804284.shtml
Introduction
Deliver only one high-quality application with a rich set of functions under any circumstancesProgramIt is not enough. In more and more cases, it must meet high availability standards. Is it because the cluster technology seems too advanced, hard to understand and use, and you have not made the application a new level? With Microsoft's cluster service in Windows NT? 4 introduced and officially provided in the Windows Server 2003 series. developers can use some simple tools to deploy applications in the cluster environment. These tools can register applications in the cluster as general applications and control application configurations by writing windows scripts.
The cluster connects two or more servers to present them to a single computer on the client. Connecting to the server in a group can share the workload and achieve single-point operations/management, and provide a way to meet the increasing needs for corresponding adjustments. Therefore, clusters can generate highly available applications.
This article focuses on one of the three Microsoft server technologies that support clusters: cluster service. We will explain how to easily perform performance checks on applications in a cluster environment without changing the applicationCode.
Three cluster technologies
Microsoft Server provides three clustering technologies: network load balancing (NLB), Component Load Balancing (CLB), and Microsoft cluster service (MSC ).
Network Load Balancing
Network load balancing acts as a front-end cluster to distribute incoming IP traffic in the entire server group. It is an ideal choice for e-commerce web sites to achieve incremental scalability and outstanding availability. You can connect up to 32 computers running Windows Server 2003 series to share a virtual IP address. NLB enhances scalability by allocating client requests among multiple servers in the cluster. As traffic increases, you can add more servers to the cluster. Each cluster can accommodate up to 32 servers. While providing continuous services to users, NLB also provides high availability, that is, it automatically detects server faults and re-allocates client traffic to other servers within 10 seconds.
Component Load Balancing
Server Load balancer allows you to allocate loads between servers running the business logic of multiple sites. It dynamically balances COM + components in a server group containing up to eight equivalent servers. In CLB, the COM + component is located on a server in a separate COM + cluster. The call to activate the COM + component balances the load on different servers in the COM + cluster. CLB works with NLB and cluster services by acting on the intermediate layer of the multi-layer cluster network. CLB is provided as a feature of Application Center 2000 and can run on the same group of computers as Microsoft cluster services.
Cluster Service
The cluster Service acts as a backend cluster and provides high availability for applications such as databases, message passing, and file and print services. When any node (the server in the cluster) fails or is offline, the MSC attempts to minimize the impact of the fault on the system.
Figure 1. Three Microsoft server technologies supporting clusters
Failover through Microsoft cluster service
The MnS failover function is implemented through redundancy among multiple computers connected in a group. Each computer has an independent fault state. To achieve redundancy, you need to install applications on multiple servers in the cluster. However, at any time, the application is online only on one node. When the application fails or the server is down, the application restarts on another node. Windows Server 2003 data center supports a maximum of eight nodes in a group.
Each node has its own memory, system disk, operating system, and a subset of cluster resources. If a node fails, the other node takes over the resources of the faulty node (this process is called "failover "). Microsoft cluster service then registers the network address of the resource on the new node to route the client traffic to the available system that currently owns the resource. When the faulty resource is restored to the online status, the MSC can be configured to allocate resources and client requests appropriately (this process is called "fault recovery "). To restore an application to the point where a Failover occurs, the node must be able to access the shared storage area that maintains the application state.
Note that the Microsoft cluster service is designed to provide high availability rather than true fault tolerance. The word "Fault Tolerance" is generally used to describe technologies that provide higher-level recovery capabilities. Fault Tolerant servers typically use advanced hardware or data redundancy combined with specific software to provide near-instantaneous recovery from single hardware or software faults. The cost of such solutions is much higher than that of cluster solutions because you must purchase redundant hardware, which is only idle for fault recovery. The Microsoft cluster service uses affordable standard hardware to provide outstanding high availability solutions while maximizing the use of computing resources.
Microsoft cluster service is based on a non-shared cluster model. No shared model stipulates that although multiple nodes in the cluster can access devices or resources, the resources can only be occupied and managed by one system at a time. (In the MSC cluster, A resource is a physical or logical component that can be online or offline, managed in a group, and can only be hosted by one node at a time and moved between nodes.
Figure 2. Microsoft cluster service
Cluster service structure
The Microsoft cluster service consists of three main components: cluster service, Resource Monitor, and resource DLL. You can also use the Cluster Manager to create an extended DLL that provides management functions.
Cluster Service
The cluster service is a core component and runs as a high-priority system service. The cluster service controls cluster activities and executes the following tasks: Coordinating Event Notifications, accelerating communication between cluster components, handling failover operations, and managing configurations. Each cluster node runs its own cluster service.
Resource Monitor
Resource Monitor is an interface between cluster services and cluster resources and runs as an independent process. The cluster Service uses the resource monitor to communicate with the resource DLL. Dll processes all communications with resources, so the DLL uses the resource monitor as the host to protect the cluster service from the impact of abnormal or stopped resources. Multiple copies of the Resource Monitor can run on a single node, thus isolating unpredictable resources from other resources.
When you need to perform operations on a resource, the cluster service sends a request to the resource monitor that is allocated to the resource. If the Resource Monitor process does not have a DLL that can process this type of resource, use the registration information to load the DLL associated with this resource type. Then, pass the cluster service request to the entry point function of one of the DLL. Resource dll processes operation details to meet specific resource needs.
Resource DLL
The third key Microsoft cluster service component is resource DLL. Resource Monitor and resource DLL use resource API for communication. Resource API is a collection of entry points, callback functions, related structures, and macros used to manage resources.
For cluster services, resources are any physical or logical components that can be managed, such as disks, network names, IP addresses, databases, web sites, applications, and any other entities that can be online or offline. Resources can be organized by type. Resource types include physical hardware (such as disk drives) and logical items (such as IP addresses, file sharing, and general applications ).
Every resource uses resource DLL, which is a passive conversion layer between resource monitor and resource. The Resource Monitor calls the resource DLL entry point function to view the resource status and bring the resource online and offline. Resource DLL is responsible for communicating with resources through any convenient IPC Mechanism to implement these methods.
Applications that implement the communication between their own resource DLL and the cluster service, and applications that use the cluster API to request and update cluster information are defined as application programs that recognize clusters. Applications and services that do not use clusters, resource APIs, and cluster control code functions do not recognize clusters, nor do they know that cluster services are running. Applications that do not recognize clusters are generally managed as common applications or services. Bbs.bitscn.com Network Management Forum
Both the application that identifies the cluster and the application that does not recognize the cluster can run on the cluster node, and can be managed as cluster resources. However, only the application that identifies the cluster can use the functions provided by the cluster service through the cluster API. To develop an application that identifies a cluster, you must create a custom resource type. By customizing the resource type, developers can make their applications have various events in the cluster (for example, the node is about to be offline, so the database connection is closed, respond and take necessary measures.
For most applications that need to be run in a group, it is best to invest some time and resources to develop custom resource types. However, you can test the application in the cluster environment without modifying the application code or creating a new resource type. In the Windows Server 2003 series, unmodified applications can run as "Unrecognized cluster" applications at the basic level. The cluster service provides general application resource types for this purpose.
Cluster Manager extension DLL
The Cluster Manager extension DLL provides application-specific management functions in the Cluster Manager, allowing users to manage their applications in the same way, whether the application is running inside the cluster or outside the cluster. Developers can provide application management functions within the framework of Cluster Manager, or simply link these functions to existing management tools.
Developers can compile extended DLL to extend the functions of the Cluster Manager. The Cluster Manager application communicates with the extended DLL through a set of defined com interfaces. The extension DLL must implement a specific set of interfaces and be registered on each node of the cluster.
Figure 3. Key components: cluster service, Resource Monitor, and resource DLL
Application that does not recognize the Cluster
Applications or services that do not provide their own resource dll can still be configured in the cluster environment. The cluster services in the Windows Server 2003 series include general resource DLL for this purpose only: general application resource DLL and general service resource DLL. The cluster Service regards these applications or services as general applications or services that do not recognize clusters.
Generally, resource DLL only provides the most basic control. For example, the application resource DLL checks whether the application fails by determining whether the application's process still exists, and takes the application offline by terminating the process. However, it does not depend on other resources, but provides a simple way to test applications in a cluster environment.
High Availability notepad
Not all applications work efficiently in a group. The most effective evaluation method is to apply