Windows Cluster Development-write Microsoft Cluster Server (MSC) Resource DLL: 4) Resource and resource DLL

Source: Internet
Author: User

Resource and resource DLL

For cluster services, a cluster is a manageable hardware or software component. For example, resources can be disks, network names, IP addresses, databases, WEB sites, applications, and any other entities that can be online or offline. Resources are organized by type. Resource types include physical hardware (such as disk drives) and logical items (such as IP addresses, file sharing, and common applications ). Each resource uses a resource DLL. Resource DLL is a large passive conversion layer between resource monitor and resource. The Resource Monitor calls the resource DLL entry function to check the resource status and bring the resource online or offline. Resource DLL is responsible for communication with its resources. It can be implemented through any convenient IPC Mechanism. Note:Applications and services that do not provide their own resource DLL can still be configured in the Cluster Environment-MSC provides a common resource DLL for this situation, the cluster service uses such applications or services as common and unperceptible applications or services. However, any application or service that needs to take advantage of the cluster environment should implement a Custom Resource DLL that can interact with the cluster service to obtain the advantages brought by the rich functions provided by MSC. Why write a custom DLL? A frequently asked question is: Why do developers need to write resource DLL since the MSC comes with a DLL for common applications and services? The main reason is that the DLL provided by MSC is quite basic and "Yangchun" DLL, which only provides basic failover/fault recovery capabilities. For example, if an application has opened some files and the cluster service decides to move the application to another node for some reason, the application cannot be closed cleanly on the original node before it is moved. Resource DLL specific to the application can provide a clean shutdown function. The cluster service can benefit from better controlled resource round robin (see the descriptions of LooksAlive and IsAlive routines in subsequent chapters ). In addition, some resources need to input or enter a set of specific parameters or attributes (public and private) to bring the resources online or offline, and so on. These parameters or attributes added when implementing cluster management extensions are closely integrated with the resource type (combined with the resource DLL. Applications and services that do not implement resource DLL must restrict their parameters and attributes according to general extension requirements. Finally, the most important reason is that the resource DLL provided for the application will support the "Active/Active" type of failover and recovery. This allows instances of the same type of resources to run on different nodes. Each instance uses different datasets on disks on the shared SCSI bus. (This means that although data is not shared, the resource type is active on both nodes. According to the definition, a resource can only have one instance; however, a resource type can have multiple instances .) If an instance of the resource type fails on one of the nodes, the instance will be moved or "fail over" to the next available node. For example, if the resource type is a database management program, you can run a copy of the program on each node. You can define a special database (db1) as a resource. Based on the "activity/activity" mode, you can move db1 back and forth between node 1 and node 2 by releasing and requesting the database on each node. This communication method cannot occur on the resource types of common applications and services. Arbitration ResourcesIn addition to the above applications, services, and other resources, MSC also allows a special resource, called a "quorum resource", to play a key role in cluster operations. The arbitration resource must provide a persistent and exclusive mechanism (that is, a single node is allowed to control the arbitration resource and the control is exclusive to other nodes ), you must also provide physical storage space that can be accessed by any node in the cluster (although only one node can access the physical storage space at any time ). The latest version of the cluster database is maintained for arbitration resources. If the database fails, the changes will be saved to the cluster database. MSC contains the standard quorum resource DLL for specific cluster resources. Of course, custom arbitration resources may also be implemented. This article does not include the process and guidelines for compiling custom arbitration resource DLL.

The following describes the programming tools required for creating clusters to perceive applications, as well as guidelines for creating new resource types and compiling Custom Resource DLL.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.