Server clusters are commonly used to provide failover and high availability of information to clients. Clusters typically have a cluster service that performs functions for managing cluster failover and load balancing. The cluster service typically provides fast failure detection to provide maximal service availability. From the client perspective, however, most failure detection is performed via network timeouts. If a client initiates a request to a cluster, such as a file access request or database access request, using transmission control protocol (TCP) the failure is not detected until a timeout is reached. The client waits for an acknowledgement from the server for a predefined period of time, or if the client has issued an operation and received an acknowledgement, it waits for a response from the server for a predefined period of time. The time required to detect a server failure can therefore vary from relatively fast to 30 seconds or longer. For the client to detect the failure more quickly, it has to be active (i.e., sending requests frequently) to determine that the server has failed. One way to ensure quick detection is for the client to constantly send keep-alive packets to help prevent the case of an idle client not receiving a network disconnect if the server fails. However, keep-alive packets consume network bandwidth.
It is with respect to these and other considerations that embodiments have been made. Also, although relatively specific problems have been discussed, it should be understood that the embodiments should not be limited to solving the specific problems identified in the background.
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detail Description section. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
Described are embodiments for providing a witness service that sends notifications of a resource state to registered clients. Embodiments provide a protocol that includes various messages for registering and receiving notifications regarding the state of a resource, e.g., a resource in a cluster or a network. In one embodiment, the protocol includes a message for a client to request witness information from a node in a cluster. The witness information identifies nodes in the cluster that provide the witness service. The protocol additionally includes a message that is used to register with the witness service for notifications regarding a state, or state change, of a network or cluster resource. In one embodiment, the message is used to register for a notification of a node failure. The protocol also includes messages for the witness service to send notifications with state information of the resource. Embodiments also provide a message for unregistering from the witness service.
Embodiments may be implemented as a computer process, a computing system or as an article of manufacture such as a computer program product or computer readable media. The computer program product may be a computer storage media readable by a computer system and encoding a computer program of instructions for executing a computer process. The computer program product may also be a propagated signal on a carrier readable by a computing system and encoding a computer program of instructions for executing a computer process.
Non-limiting and non-exhaustive embodiments are described with reference to the following figures.
Various embodiments are described more fully below with reference to the accompanying drawings, which form a part hereof, and which show specific exemplary embodiments. However, embodiments may be implemented in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the embodiments to those skilled in the art. Embodiments may be practiced as methods, systems or devices. Accordingly, embodiments may take the form of a hardware implementation, an entirely software implementation or an implementation combining software and hardware aspects. The following detailed description is, therefore, not to be taken in a limiting sense.
As shown in
In accordance with one embodiment, in addition to storing information accessed by the clients 102 and 104, cluster 106 also provides a witness service. The witness service allows clients 102 and 104 to receive notifications regarding the state of resources monitored by cluster 106. The resources may be cluster resources or network resources. In one embodiment, each of servers 106A, 106B, and 106C is capable of providing the witness service. That is, clients 102 and 104 may register with any of servers 106A, 106B, or 106C for the witness service as long as the client is not using the server to access the cluster resources. In other embodiments, there may be only a portion of the servers of cluster 106 that provide the witness service. For example, in this embodiment only servers 106B and 106C would be running the witness service. In yet other embodiments, cluster 106 may include servers that are dedicated to providing the witness service. For these embodiments, although not show, cluster 106 may include servers that are specifically configured to run the witness service and would not provide access to clients 102 and 104.
The servers from cluster 106 that provide the witness service receive events from resources in cluster 106 and/or from network resources. The servers process and store information from these events to keep track of the state of these resources. In response to these events, the servers will also send out notifications to clients that have registered with the witness service to receive state information regarding the resources. As one example, the events may be generated by a cluster service that is running on cluster 106 to provide load balancing and failure detection.
As noted above, clients 102 and 104 communicate with cluster 106 to request notifications from the witness service. In embodiments, a witness protocol is provided that is used by the witness service and by clients 102 and 104. The protocol includes messages for allowing clients 102 and 104 to request information about the witness service from a server in cluster 106. The information may identify which servers in cluster 106 provide the witness service. The protocol also includes messages for registering for notifications from the witness service. The messages, sent by the witness service to the clients 102 and 104 regarding the state of a resource, are also formatted according to the witness protocol.
To illustrate one embodiment, client 102 establishes a session with a server of cluster 106. For example, client 102 may establish a session with server 106A to access a database stored on server 106A. Because client 102 is accessing information from server 106A, it may want to have an early indication of any failures on server 106A. Early detection of a failure will allow early recovery, which reduces the amount of time an application on client 102 may have to wait. Early detection and recovery also reduces the window of time where resources being reserved for client 102 to reconnect to are unavailable to other clients.
To register with the witness service, client 102 first sends a message formatted according to a witness protocol to server 106A for information regarding which server, or servers, on cluster 106 is running the witness service. Server 106A responds with the information including the identification of servers 106B and 106C as running the witness service and any information necessary to connect to any one of those servers. In this example, based on the information received from server 106A, client 102 sends a registration request to server 106B to receive notifications of the state, or state changes, of the resources on server 106A. The client will be notified when a resource on server 106A has failed, and later when the server is available for reconnection. The state can be as simple as whether server 106A is online or off-line. In other embodiments, the notifications may have a finer granularity such as whether disks or network adaptor on server 106A have failed or will be taken offline.
In some embodiments, the client 102 may have a predetermined method for selecting the specific server to contact for registering with the witness service. For example, the client can select a server at random, in a round-robin fashion, or based on information it receives from the cluster.
After client 102 has registered with server 106B for notifications regarding resources on server 106A, a change in the state of the resources detected by server 106B, results in a notification being sent to client 102 with the information indicating a change in the state of the resource. For example, the notification may indicate that server 106A is off-line. In response to the notification, client 102 may stop sending requests for information to server 106A and attempt to connect to another server in cluster 106. Alternatively, client 102 may wait for a subsequent notification that server 106A is back online so that it can reconnect and again begin accessing information from server 106A.
The following description is merely one example of how the embodiment shown in
Turning now to
As shown in
In the embodiment shown in
In the embodiment shown in
In
Similarly, client 204 has established a session with node 2 and is sending access requests over channel 212 to the client access component of node 2. Client 204 has also registered for a witness service and is communicating using channel 214 with the witness management component of node 3.
In one embodiment, the witness management components provide additional functionality. In some embodiments, the components provide a load balancing functionality. That is, in addition to sending notifications regarding state of resources, the witness management components may also send notifications that request that clients 202 and 204 connect to different resources based on an algorithm for load-balancing on the node 206. For example, as shown in
The description of
Referring to
After receiving response message 404, client 302 sends an access request message 406 to server cluster 306. The access request may be sent by the redirector on client 302. As shown in
It is to be noted that although
The witness management component on client 302 detects that server 1 is part of cluster 306. This detection may occur in embodiments as part of processing the response message 408 or by some other out of bounds means. As a result of determining that server 1 is part of cluster 306, the witness management component on client 302 is configured in embodiments to register for the witness service provided by cluster 306. As a result, the witness management component on client 302 uses a new channel 310 (
In embodiments, the request is formatted according to a witness protocol that is configured specifically for the witness service. The witness protocol may include a number of messages related to the witness service. For example, in embodiments, the witness protocol includes at least: a witness request message to request witness information, a witness register message for registering for notifications about a resource in a cluster, and a witness resource change message for notifying clients of a change in state of a resource (e.g., online or offline status of a resource.). These are merely some examples and in embodiments, the witness service may include other messages. In one embodiment, the witness protocol uses Remote Procedure Call (RPC) with Transmission Control Protocol (TCP) as the transport.
Referring again to
In some embodiments, the witness information is structured in a particular format. For example, the witness information may be ranked. That is, the servers that provide the witness service may be listed in a particular order. Client 302 can then start with the first server in the list, and if that server is unavailable to provide the witness service, the client can then try the next server on the list. The ranking can be based on a number of different algorithms that take into account parameters some non-limiting examples including: the number of clients that have registered for the witness service, the servers that are providing the witness service, as well as the hardware and software characteristics of particular servers and network connections, which may indicate an ability to handle larger amounts of clients.
In response to the witness information received from server 1, client 302 will use channel 310 (
In some embodiments, after operation 416, the witness server (server 2) might experience a failure, server failure 417 shown in dashed lines. In this case, the client 302 would have to re-select an alternate server, including in some embodiments sending another message similar to messages 410 and receiving another message similar to message 412 (from server 1 or a different server). Client 302 would also send a witness registration request similar to request 414 to register for the witness service from the alternate server.
In other embodiments, the client could establish multiple witness server connections. That is, the client can register with more than one server in cluster 306 for the witness service. The multiple connections would allow the client to continually have access to the witness service even if one of the servers fails. The client may in embodiments designate one of the connections as a primary connection and use the other connections only secondarily, if the primary connection should fail.
If at some point there is a server failure 418 of server 1, server 2 will detect the failure. As noted above, server 2 may detect the failure by receiving events generated by a cluster service running on cluster 306. Once server 2 detects the server failure 418, server 2 will send a notification 420 of the failure to client 302. In response to the failure, client 302 is in this embodiment configured to pause any further file access requests 422. As can be appreciated, if client 302 were to send any additional access requests, they would not be processed because of the failure of server 1. The witness service of server 2 is also in embodiments configured to send a message 424 to client 302 indicating that there is a resource available at server 3 for processing access requests from client 302. After receipt of message 424, client 302 will resume sending file access requests 426 to server 3. The redirector on client 302 sends the file access requests 426 through channel 312 (
In other embodiments, client 302 is configured to pause file access requests until server 1 is back online. The witness service of server 2 would be configured to send a message 424 to client 302 indicating that server 1 is available for processing access requests from client 302, when server 1 becomes available.
Although not shown, in some embodiments, when client 302 begins to send file access requests to server 3, it will also change the server from which it is receiving the witness service. For example, after sending file access requests to server 3, client 302 may begin the process of sending a request for witness information to server 3. Server 3 may respond with information similar to response 412 sent by server 1, including information regarding which servers are providing the witness service. The information may be different, for example it may identify different servers. Servers that were previously identified as providing the witness service may have since failed and are no longer available, or other servers have come online. Also, in some embodiments, the witness management components are configured to provide the witness information with rankings of the servers that are available for providing the witness service. The witness information provided by server 3 may therefore be different than the witness information previously provided by server 2. In response to the witness information sent by server 3, client 302 may decide whether to request registration for the witness service from a different server.
Furthermore, although operational flows 500, 550, 600, and 650 are illustrated and described sequentially in a particular order, in other embodiments, the operations may be performed in different orders, multiple times, and/or in parallel. Further, one or more operations may be omitted or combined in some embodiments.
Operational flows 500 and 550 are illustrated together in
Flow 500 begins at operation 502 where a request to connect to a first node is sent. The first node is part of a node cluster that stores information that is accessed. In some embodiments, the request sent at operation 502 is a request to establish a session with the first node in order to access information stored on the node cluster. After operation 502, flow 500 passes to operation 504 where a response is received indicating that a session with the first node has been established. Although not shown in flow 500, in embodiments, after operation 504 access requests are sent to the first node to access information stored on the first node.
As shown in the embodiment in
At operation 508 the witness information is received. The witness information can then be used to determine what node in the cluster provides the witness service. The witness information is used at operation 510 to send a registration request to register for notifications regarding a resource. In one embodiment, the resource may be the first node from which information is being accessed. The request may be to receive notifications regarding the state of the first node, or resources on the first node. For example, the notifications may indicate whether the first node is online or off-line.
Flow 500 passes from operation 510 to operation 512 where a notification is received regarding the resource. Flow 500 then ends at operation 514. In some embodiments, there may be additional steps performed in response to receipt of the notification at step 512, such as a pausing of access requests, reconnection to another node in the cluster, and resumption of access requests to the other node in the cluster.
In embodiments, the notification received at operation 512 is not a state notification but rather a load balancing notification. The load balancing notification may indicate that future access requests should be sent to a different server. In some embodiments, the notification may specifically identify a different network, network resource, or cluster resource that should be used. In these embodiments, a number of operations would be performed in response to receipt of the notification at operation 512.
Flow 550 has corresponding steps to those described above with respect to flow 500. As noted above, in embodiments, node 1, node 2, and node 3 shown in
After operation 554, a second request for witness information is received at operation 556. The witness information may include information that identifies what nodes in the node cluster provide a witness service. Flow 550 passes to operation 558 where a response is sent that includes the witness information. In embodiments, the witness information is structured so that not only does it include indications of the nodes in the node cluster that provide the witness service but also is ranked to indicate a preference for some nodes.
At operation 560, a registration request to register for state notifications for a resource is received. In embodiments, the request is for state notifications for network resources. In other embodiments, the request is for state notifications for cluster resources such as whether or not a node in the cluster is online or off-line. It is to be understood that the request received at operation 560 is in embodiments received from a client that is different than the client sending the first request (operation 552) and the second request (operation 556). Although the requests received during flow 550 may be sent by different clients, operations 552-564 is in embodiments performed by a single node.
After operation 560, flow passes to operation 562 where a resource is monitored. Operation 562 may include monitoring a number of resources including cluster resources and network resources. The resources may be monitored even if there is no current request to receive notifications about the resource. Operation 562 may include receiving and processing events from network resources or from a cluster service.
After operation 562, flow passes to operation 564 where a notification regarding the resource is sent. The notification provides information regarding the state of the resource that was indicated in the registration request received at operation 560. In one embodiment, the notification may indicate that the first node is off-line. After operation 564, flow ends at operation 514. In embodiments, flow 550 may include additional steps performed after operation 564. As one example, there may be an additional message sent indicating that the resource that was previously off-line is now online and available for access or that another resource is available.
It should be noted that in some embodiments, operations 552-558 are performed in one location and operations 560-564 are performed in a different location. For example, operations 552-558 may be performed on a different node of a node cluster then the node that performs operations 560-564. In other embodiments, a single node may perform all of operations 552-564 however, operations 552-558 may be performed with respect to a first client and operations 560-564 may be performed with respect to a second client. In other words, a node may be servicing requests to access information from a first client and also provide the witness service to a second client.
Operational flow 600 illustrates steps for receiving state notifications for a cluster resource from a cluster providing a distributed file system to clients. Operational flow 650 illustrates steps for providing state notifications for a cluster resource on a cluster providing a file system. In embodiments, clients such as clients 102 and 104 (
Flow 600 begins at operation 602 where a request to connect to the file system on a server cluster is sent. The server cluster includes more than one server and stores file information that is accessed by clients. In some embodiments, the request sent at operation 602 is a request to establish a session with a server in the server cluster in order to access files on the cluster. The session is in embodiments established with a file access protocol such as a version of SMB or NFS. After operation 602, flow passes to operation 604 where a response is received indicating that a session with a server in the cluster has been established. Operations 602 and 604 may be only two operations in a series of operations that are performed to negotiate the session. That is, in other embodiments there may be a number of operations that are performed between operation 602 and 604.
After operation 604, access requests are sent at operation 606 to the server to access information from the file system stored in the server cluster. The access requests may include for example read/write requests that are formatted according to a particular file access protocols such as a version of SMB or a version of NFS.
As shown in the embodiment in
At operation 610 the witness service information is received. The witness service information can then be used to determine what server in the cluster provides the witness service. The witness service information is used at operation 612 to send a registration request to register for notifications regarding a cluster resource. In one embodiment, the resource may be the server with which the session was established at operation 604 and from which information is being accessed using the requests sent at operation 606. The registration request may indicate that the client wishes to receive notifications regarding the state of the server.
Flow 600 passes from operation 612 to operation 614 where a notification is received regarding the resource. In some embodiments, there may be additional steps performed in response to receipt of the notification at step 614, such as a pausing of the access requests, reconnection to another server in the cluster, and resumption of access requests to the other server in the cluster. After operation 614, a request to unregister is sent at operation 616. Flow 600 then ends at operation 618.
Flow 650 has corresponding steps to those described above with respect to flow 600. Flow 650 begins at operation 652 where a request to connect to a server cluster is received. The request is in embodiments a request to establish a session for accessing file information stored on the server cluster. The operation occurs on a file server of the server cluster. Flow passes from operation 652 to operation 654 where a response is sent indicating that a session has been established to allow access to the files stored on the file server in the server cluster. As noted above, operation 652 and operation 654 may merely be two operations that are performed to establish a session. In some embodiments, there may be a number of other operations that are performed between operation 652 and operation 654 for establishing the session.
Operation 654 is followed by operation 656 where file access requests are received. The file access requests may be requests to read or write file information stored on the server. In embodiments, the messages sent and received at operations 652-656 are formatted according to a file access protocol, such as a version of SMB or a version of NFS.
After operation 656, a request for witness information is received at operation 658. The request is for witness information regarding what servers in the server cluster provide a witness service. Flow 650 passes to operation 660 where a response is sent that includes the witness information with indications of the servers in the server cluster that provide the witness service. It is to be understood that the request received at operation 658 is in embodiments received from a client that is different than the client sending the first request (operation 652) and the second request (operation 658). Although the requests received during flow 650 are sent by different clients, operations 652-668 is in embodiments performed by a single node.
At operation 662, a registration request to register for state notifications for a cluster resource is received. In embodiments, the request is for state notifications for cluster resources such as whether or not the server, that is servicing the file access requests and with which the session has been established, is online or off-line. After operation 662, flow passes to operation 664 where a resource is monitored. Operation 664 may include utilizing APIs provided by a cluster service running on the cluster. Operation 664 may include receiving and processing events received from the cluster service.
After operation 664, flow passes to operation 666 where a notification regarding the resource is sent. The notification provides information regarding the state of the resource that was indicated in the registration request received at operation 662. In one embodiment, the notification may indicate that the server is now off-line. After operation 666, flow passes to operation 668 where a request to unregistered is received. The request received at operation 668 indicates that a previous registration, such as the registration request received at operation 662, should be unregistered. Flow 650 ends at operation 618.
It should be noted that in embodiments, operations 652-658 are performed on one server and operations 660-664 are performed on a different server. For example, operations 652-658 may be performed on a first server of a server cluster and operations 660-664 on a second server of the server cluster. In other embodiments, a single server may perform all of operations 652-664 however, operations 652-658 may be performed with respect to a first client and operations 660-664 may be performed with respect to a second client. In other words, a server may be servicing requests to access information from a first client and also provide the witness service to a second client.
In its most basic configuration, system 700 typically includes at least one processing unit 702 and memory 704. Depending on the exact configuration and type of computing device, memory 704 may be volatile (such as RAM), non-volatile (such as ROM, flash memory, etc.) or some combination of the two. This most basic configuration is illustrated in
The term computer readable media as used herein may include computer storage media. Computer storage media may include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. System memory 704, removable storage, and non-removable storage 708 are all computer storage media examples (i.e. memory storage.) Computer storage media may include, but is not limited to, RAM, ROM, electrically erasable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store information and which can be accessed by computing device 700. Any such computer storage media may be part of device 700. Computing device 700 may also have input device(s) 714 such as a keyboard, a mouse, a pen, a sound input device, a touch input device, etc. Output device(s) 716 such as a display, speakers, a printer, etc. may also be included. The aforementioned devices are examples and others may be used.
The term computer readable media as used herein may also include communication media. Communication media may be embodied by computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and includes any information delivery media. The term “modulated data signal” may describe a signal that has one or more characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media may include wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, radio frequency (RF), infrared, and other wireless media.
Reference has been made throughout this specification to “one embodiment” or “an embodiment,” meaning that a particular described feature, structure, or characteristic is included in at least one embodiment. Thus, usage of such phrases may refer to more than just one embodiment. Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
One skilled in the relevant art may recognize, however, that the embodiments may be practiced without one or more of the specific details, or with other methods, resources, materials, etc. In other instances, well known structures, resources, or operations have not been shown or described in detail merely to avoid obscuring aspects of the embodiments.
While example embodiments and applications have been illustrated and described, it is to be understood that the embodiments are not limited to the precise configuration and resources described above. Various modifications, changes, and variations apparent to those skilled in the art may be made in the arrangement, operation, and details of the methods and systems disclosed herein without departing from the scope of the claimed embodiments.
Number | Date | Country | |
---|---|---|---|
Parent | 13074920 | Mar 2011 | US |
Child | 13945066 | US |