Mobile agent based memory replication

Embodiments of the present invention disclose a method, computer program product, and system for memory replication. In one embodiment, in accordance with the present invention, the computer implemented method includes the steps of executing a mobile agent on a server node, wherein the server node is within a cluster of server nodes connected via network communications, capturing a memory state of the server node during operation of the server node, wherein the memory state includes session information stored on computer memory of the server node, which is captured and stored by the mobile agent, monitoring the server node to determine whether the server node has failed, and responsive to determining that the server node has failed, migrating the mobile agent to an active server node within the cluster of server nodes, wherein the mobile agent carries the captured memory state.

FIELD OF THE INVENTION

The present invention relates generally to the field of memory replication, and more particularly to mobile agent based memory replication.

BACKGROUND OF THE INVENTION

Replication involves sharing data so as to ensure consistency between redundant resources (e.g., hardware and software components), which can improve reliability, fault-tolerance, and accessibility. For example, data replication can occur between memories of server nodes, which can be in a cluster of server nodes. A server cluster includes a series of server nodes that are connected via a network. Some existing types of state replication for clusters of server nodes include: database persistence, synchronous memory replication, and asynchronous memory replication. In database persistence, the memory state is persisted to a database, and if a node fails, then another node can read the memory state from the database and continue the work. In synchronous memory replication, for any update to the memory state, the updated state is written to the memory of the server node. In asynchronous replication, at a given interval, the memory state is replicated.

A mobile agent is a software program that has the capability to migrate from one server node to another server node, within a cluster of server nodes. Mobile agents can directly interact with resources of each server node (e.g., memory) and can migrate from one server node to another server node, carrying along state information and continuing to execute on the new server node.

SUMMARY

Embodiments of the present invention disclose a method, computer program product, and system for memory replication. In one embodiment, in accordance with the present invention, the computer implemented method includes the steps of executing a mobile agent on a server node, wherein the server node is within a cluster of server nodes connected via network communications, capturing a memory state of the server node during operation of the server node, wherein the memory state includes session information stored on computer memory of the server node, which is captured and stored by the mobile agent, monitoring the server node to determine whether the server node has failed, and responsive to determining that the server node has failed, migrating the mobile agent to an active server node within the cluster of server nodes, wherein the mobile agent carries the captured memory state. In another embodiment, the method further includes the step of transferring the captured memory state from the mobile agent to computer memory of the active server node.

DETAILED DESCRIPTION

Embodiments of the present invention allow for replication of a memory state from one server node to another server node, within a cluster of server nodes. A mobile agent is able to detect the failure of a server node, and migrate to an active server node. The memory state of the failing server node is migrated and transferred to the active server node.

Embodiments of the present invention recognize that existing types of state replication for clusters of server nodes include: database persistence, synchronous memory replication, and asynchronous memory replication. Database persistence can be resource intensive, and therefore incur associated costs and delays. Synchronous replication involves keeping all server nodes in the cluster in the same state, which can negatively impact performance. Asynchronous replication is periodic, and therefore a possibility of a loss of state information exists. With existing solutions, a trade-off exists between application performance and fault tolerance.

The present invention will now be described in detail with reference to the Figures.FIG. 1is a functional block diagram illustrating a distributed data processing environment, generally designated100, in accordance with one embodiment of the present invention.

An embodiment of data processing environment100includes client device110, and server cluster125, which includes server nodes130and140, all interconnected over network120. In an example embodiment, client device110can communicate with server cluster125, having data (e.g., session information) stored on respective memories of server nodes130and140(e.g., memory132and142). For example, during an online shopping transaction, memory132of server node130stores information corresponding to the content of the shopping cart of client device110(i.e., session information of client device110).

In various embodiments of the present invention, client device110may be a workstation, personal computer, personal digital assistant, mobile phone, or any other device capable of executing program instructions in accordance with embodiments of the present invention. In general, client device110is representative of any electronic device or combination of electronic devices capable of executing machine-readable program instructions, as described in greater detail with regard toFIG. 3, in accordance with embodiments of the present invention. Client device110includes user interface112and application114. User interface112accepts input from individuals utilizing client device110. In example embodiments, an individual (through input via user interface112) utilizing client device110can utilize application114to communicate with server nodes130and140, via network120. In an example, application114can be a web browser that can be utilized for online shopping transactions.

In one embodiment, client device110and server nodes130and140(i.e., server cluster125) communicate through network120. Network120can be, for example, a local area network (LAN), a telecommunications network, a wide area network (WAN) such as the Internet, or a combination of the three, and include wired, wireless, or fiber optic connections. In general, network120can be any combination of connections and protocols that will support communications between client device110, and server nodes130and140in accordance with embodiments of the present invention.

In one embodiment, server nodes130and140are a series of servers (i.e., server cluster125) that are connected via network120. Components of a server cluster125(i.e., server nodes130and140) are traditionally connected through network communications (i.e., network120), with each server node running a respective instance of an operating system. Server nodes130and140, within server cluster125, communicate and work together, so that in various embodiments, the server nodes can be viewed as a single server system. In example embodiments, server nodes130and140can be desktop computers, computer servers, or any other computer systems known in the art capable of performing functions in accordance with embodiments of the present invention. In certain embodiments, server nodes130and140represent computer systems utilizing clustered computers and components (e.g., database server computers, application server computers, etc.), that act as a single pool of seamless resources when accessed by elements of data processing environment100(e.g., client device110). In general, server nodes130and140are representative of any electronic device or combination of electronic devices capable of executing machine-readable program instructions, as described in greater detail with regard toFIG. 3, in accordance with embodiments of the present invention. In various embodiments, server nodes130and140within server cluster125can include application server nodes within a cluster of application servers (e.g., for memory replication), database nodes within a cluster of databases (e.g., for database replication), and operating system nodes within a cluster of operating systems (e.g., for file replication).

In one embodiment, server nodes130and140include respective instances of memory132and142. In example embodiments, memory132and142can include random access memory (RAM)314and cache memory316(discussed in further detail with regard toFIG. 3). In general, memory132and142can include any suitable volatile or non-volatile computer-readable storage media. Memory132and142of respective server nodes130and140can store data that corresponds to communications between client device110and the server nodes (e.g., session information). For example, during an online shopping transaction, memory132of server node130stores information corresponding to the content of the shopping cart of client device110, and other information corresponding to the client device (i.e., session information of client device110).

In an embodiment, server nodes130and140include respective instances of agent containers135and145, which include respective instances of memory replication mobile agent200and215. In one embodiment, agent containers135and145have the capability to load or clone a mobile agent (e.g., memory replication mobile agents200and215) onto server nodes130and140. Agent containers135and145can clone and add mobile agents dynamically to server nodes130and140, during operation of the server nodes. In another embodiment, an instance of agent containers135and145are present on each respective server node130and140. While operating on server nodes130or140, agent containers135and145provide the server nodes with a runtime environment and software framework that allow mobile agents to operate. Agent containers135and145exist on respective instances of server nodes130and140, and can create mobile agents (e.g., memory replication mobile agents200and215) corresponding to user (e.g., client device110) sessions on server cluster125.

Memory replication mobile agents200and215are software programs that have the capability to migrate from one server node to another server node (e.g., from server node130to server node140), within a cluster of server nodes (i.e., server cluster125). In an example embodiment, memory replication mobile agents200and215are capable of monitoring a memory state of a server node that the mobile agent is present on (e.g., server nodes130and140). In various embodiments, memory replication mobile agents200and215are software programs that can automatically complete tasks, not only at an originating location (e.g., server node130), but even after moving to other positions (e.g., server node140). Memory replication mobile agents200and215can operate on a runtime environment and software framework provided by agent container135or145. For example, memory replication mobile agents200and215are state migration mobile agents that operate within a framework for running mobile agents on server nodes (e.g., agent containers135and145within respective server nodes130and140). In example embodiments, an itinerary of memory replication mobile agents200and215is set to migrate to other server nodes within server cluster125.

In an example embodiment, memory replication mobile agents200and215migrate and transfer memory states (i.e., memory states137and147) between server nodes, in accordance with embodiments of the present invention. In various embodiments, memory states137and147are the stored, most recent, memory state of the memory of the server node where the respective instance of memory replication mobile agent200or215is operating (e.g., memory132on server node130). Memory states137and147include session or state data that is stored in respective instances of memory132and142. Memory replication mobile agent200and215makes sure that the respective instance of memory state137and147is the most up to date memory state of memory132and142, respectively. For example, in an internet shopping session, memory state137can include information on the contents of the shopping cart (e.g., session information of client device110).

In various embodiments, each server node (server nodes130and140) can have one or more respective instances of mobile agent (memory replication mobile agents200and215). In an example embodiment, the number of mobile agents in the server cluster125(server nodes130and140) corresponds to the number of user sessions on the server cluster (i.e., an agent corresponding to each user). For example, agent container135on server node130includes a certain number of instances of memory replication mobile agent200. If the number of user sessions on server node130is greater than the number of instances of memory replication mobile agent200, then agent container135deploys additional instances of memory replication mobile agent200(until an instance of the memory replication mobile agent corresponds to each user session).

FIG. 2is flowchart201depicting operational steps of memory replication mobile agent200in accordance with an embodiment of the present invention. In one embodiment, memory replication mobile agent200operates on agent container135, monitoring memory132on server node130. In other embodiments, operational steps ofFIG. 2are a general depiction of operation of a memory replication mobile agent, and can also depict operation of memory replication mobile agent215, operating on agent container145and monitoring memory142on server node140.

In step202, memory replication mobile agent200receives an indication of a session initiating on a server node. In one embodiment, responsive to client device110initiating a session on server node130, agent container135deploys memory replication mobile agent200on the server node. Memory replication mobile agent200operates continuously during communication between client device110and server node130. In various embodiments, memory replication mobile agent200starts running at the time that a server node (e.g., server node130or140) starts running, and continues to run during operation of the server node. In another embodiment, if memory replication mobile agent200is operating on a server node without an association with a user session, then, responsive to client device110initiating a session on server node130, then agent container135associates the memory replication mobile agent with the session of the client device.

In step204, memory replication mobile agent200monitors the server node. In one embodiment, memory replication mobile agent200monitors the server node that the memory replication mobile agent is hosted on (i.e., server node130), within the server cluster125. Memory replication mobile agent200continuously monitors the respective server node (i.e., server node130), during the entirety of the session of client device110, or operation of the server node. In an example embodiment, memory replication mobile agent200is continuously capturing the updated memory state of memory132on server node130, and storing the most current memory state as memory state137. In various embodiments, if the memory of a server node is updated (e.g., memory132of server node130), then memory replication mobile agent200captures and stores the updated memory state as memory state137. In one example, client device110is utilizing server node130to perform an internet shopping transaction. During the online shopping transaction, memory132of server node130contains information on the contents of the shopping cart of client device110(i.e., the session information). In this example, memory replication mobile agent200captures and stores the memory state information in memory132as memory state137. Each time that information in memory132is updated (e.g., contents of shopping cart updated), memory replication mobile agent200captures an updated memory state137corresponding to the information in the memory.

In decision step206, memory replication mobile agent200determines whether the server node has failed. In one embodiment, memory replication mobile agent200monitors the respective server node of the mobile agent (e.g., server node130) for a “heartbeat.” A heartbeat of a server node is an indication that the server node is currently active and operating. Responsive to determining that the server node has not failed (decision step206, “no” branch), memory replication mobile agent200continues to monitor the server node (repeats step204).

In step208, memory replication mobile agent200migrates to an active server node. In one embodiment, responsive to determining that the server node has failed (decision step206, “yes” branch), memory replication mobile agent200migrates, including memory state137, to an active server node (e.g., server node140). Memory replication mobile agent200migrates to the agent container of an active server node in the server cluster125. Memory state137includes the stored, most currently updated, memory state of the memory of a server node (e.g., memory132of server node130). In an example embodiment, responsive to determining that the server node that memory replication mobile agent200is operating on has failed (i.e., server node130), memory replication mobile agent200identifies an active server node within the cluster of server nodes (i.e., server nodes130and140within server cluster125). Responsive to identifying an active server node, memory replication mobile agent200migrates, including memory state137, to the agent container of the identified active server node (i.e., agent container145on server node140).

In step210, memory replication mobile agent200transfers the memory state to the active server node. In one embodiment, memory replication mobile agent200transfers memory state137(migrated in step208) to the memory of the identified active server node (migrated to in step208). Memory state137, which is the stored, most currently updated memory state of the original server node of memory replication mobile agent200, is stored on the memory of the identified active server node (of step208). In an example embodiment, transferring memory state137to memory of an active server node allows client device110to continue the session (e.g., online shopping transaction or other communications) with server cluster125after the original server node has failed.

In the previously discussed example with regard to the internet shopping transaction, responsive to determining that server node130has failed (decision step206, “yes” branch), memory replication mobile agent200identifies server node140as an active server node. Memory replication mobile agent200then migrates, including memory state137, to agent container145on server node140. Memory state137includes the most current session information corresponding to client device110(e.g., contents of shopping cart, etc.), which was previously stored on memory132of server node130(before the server node failed). Memory replication mobile agent200then transfers memory state137to memory142of server node140, storing the most current session information of client device110to the memory, and allowing client device to continue the internet shopping transaction.

FIG. 3depicts a block diagram of components of computer300, which is representative of client device110, and server nodes130and140in accordance with an illustrative embodiment of the present invention. It should be appreciated thatFIG. 3provides only an illustration of one implementation and does not imply any limitations with regard to the environments in which different embodiments may be implemented. Many modifications to the depicted environment may be made.

Computer300includes communications fabric302, which provides communications between computer processor(s)304, memory306, persistent storage308, communications unit310, and input/output (I/O) interface(s)312. Communications fabric302can be implemented with any architecture designed for passing data and/or control information between processors (such as microprocessors, communications and network processors, etc.), system memory, peripheral devices, and any other hardware components within a system. For example, communications fabric302can be implemented with one or more buses.

Memory306and persistent storage308are examples of computer-readable tangible storage devices. A storage device is any piece of hardware that is capable of storing information, such as, data, program code in functional form, and/or other suitable information on a temporary basis and/or permanent basis. In this embodiment, memory306includes random access memory (RAM)314and cache memory316. In general, memory306can include any suitable volatile or non-volatile computer-readable storage device. Software and data322are stored in persistent storage308for access and/or execution by processors304via one or more memories of memory306. With respect to client device110, software and data322represents application114. With respect to server node130, software and data322represents agent container135and memory replication mobile agent200. With respect to server node140, software and data322represents agent container145and memory replication mobile agent215.

In this embodiment, persistent storage308includes a magnetic hard disk drive. Alternatively, or in addition to a magnetic hard disk drive, persistent storage308can include a solid state hard drive, a semiconductor storage device, read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, or any other computer-readable storage media that is capable of storing program instructions or digital information.

The media used by persistent storage308may also be removable. For example, a removable hard drive may be used for persistent storage308. Other examples include optical and magnetic disks, thumb drives, and smart cards that are inserted into a drive for transfer onto another computer-readable storage medium that is also part of persistent storage308.

Communications unit310, in these examples, provides for communications with other data processing systems or devices. In these examples, communications unit310may include one or more network interface cards. Communications unit310may provide communications through the use of either or both physical and wireless communications links. Software and data322may be downloaded to persistent storage308through communications unit310.

I/O interface(s)312allows for input and output of data with other devices that may be connected to computer300. For example, I/O interface312may provide a connection to external devices318such as a keyboard, keypad, a touch screen, and/or some other suitable input device. External devices318can also include portable computer-readable storage media such as, for example, thumb drives, portable optical or magnetic disks, and memory cards. Software and data322can be stored on such portable computer-readable storage media and can be loaded onto persistent storage308via I/O interface(s)312. I/O interface(s)312also can connect to a display320.

Display320provides a mechanism to display data to a user and may be, for example, a computer monitor. Display320can also function as a touch screen, such as a display of a tablet computer.