CN112860386A - Method for switching nodes in distributed master-slave system - Google Patents

Method for switching nodes in distributed master-slave system Download PDF

Info

Publication number
CN112860386A
CN112860386A CN201911183954.XA CN201911183954A CN112860386A CN 112860386 A CN112860386 A CN 112860386A CN 201911183954 A CN201911183954 A CN 201911183954A CN 112860386 A CN112860386 A CN 112860386A
Authority
CN
China
Prior art keywords
node
slave
master
nodes
coordination server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911183954.XA
Other languages
Chinese (zh)
Inventor
张杨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN201911183954.XA priority Critical patent/CN112860386A/en
Publication of CN112860386A publication Critical patent/CN112860386A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • G06F11/2023Failover techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention provides a method for switching nodes in a distributed master-slave system. The method comprises the following steps: the coordination server elects a working main node to create a corresponding temporary directory according to first registration requests sent by a plurality of main nodes, and creates a corresponding temporary directory for each slave node according to second registration requests sent by a plurality of slave nodes; after receiving the directory creation success information fed back by the coordination server, the working master node and the slave nodes maintain heartbeat with the coordination server; the coordination server monitors that the heartbeat of the node stops updating, deletes a temporary directory corresponding to the node and broadcasts deletion information; the work master node distributes tasks to the slave nodes, and distributes the tasks which are not completed on the slave nodes to other slave nodes when the temporary directory corresponding to the slave nodes is monitored to be deleted; and when monitoring that the temporary directory corresponding to the working main node is deleted, the redundant main node sends a first registration request to the coordination server. By the method and the device, the reliability of the distributed master-slave system is improved.

Description

Method for switching nodes in distributed master-slave system
Technical Field
The invention relates to the field of distributed technology, in particular to a method for switching nodes in a distributed master-slave system.
Background
The distributed master-slave system comprises at least one master node and a plurality of slave nodes, and after a user submits a task to the distributed master-slave system through an interface, the master node receives the task and distributes the task to the slave nodes for execution.
In the prior art, in order to further improve the reliability of the distributed master-slave system, when a slave node fails, tasks on the failed slave node can be distributed to other slave nodes through reconfiguration on a master node, so that the tasks can still be executed when a single slave node fails. However, when a slave node fails, the task is interrupted, manual configuration needs to be performed again on the master node, and fast switching to another slave node is not possible, so that the response time of part of tasks is increased when the slave node fails. Meanwhile, when the master node fails, the reliability of the distributed master-slave system is affected.
Disclosure of Invention
The invention aims to provide a method for switching nodes in a distributed master-slave system, which is used for solving the technical problem that the task execution is influenced by the node failure in the prior art.
The distributed master-slave system provided by the invention comprises a coordination server and a plurality of nodes; the nodes comprise main nodes and slave nodes, and the main nodes comprise working main nodes and redundant main nodes; the method for switching the nodes in the distributed master-slave system comprises the following steps: a plurality of main nodes send a first registration request to a coordination server; the coordination server selects a working main node from the plurality of main nodes according to the plurality of first registration requests, and creates a temporary directory corresponding to the working main node, wherein the main node which is not created with the temporary directory at present is a redundant main node; the plurality of slave nodes send a second registration request to the coordination server; the coordination server respectively creates a corresponding temporary directory for each slave node according to the plurality of second registration requests; after receiving the directory creation success information fed back by the coordination server, the working master node and the plurality of slave nodes maintain heartbeat at intervals of a first preset time length with the coordination server; when monitoring that the heartbeat of a node stops updating, the coordination server deletes the temporary directory corresponding to the node and broadcasts the deletion information of the temporary directory; the work master node at least allocates tasks to a first slave node in the slave nodes, and allocates uncompleted tasks on the first slave node to a second slave node in the slave nodes when monitoring that a temporary directory corresponding to the first slave node is deleted; and when monitoring that the temporary directory corresponding to the working main node is deleted, the redundant main node sends a first registration request to the coordination server.
Further, the method for switching nodes in the distributed master-slave system further includes: after the coordination server creates a temporary directory corresponding to the working main node, the working main node is written into a permanent directory; and after the working master node receives the directory creation success information fed back by the coordination server, reading the permanent directory, searching the information of the failed historical working master node replaced by the current working master node, and closing the historical working master node.
Further, the distributed master-slave system further includes a database, and the method for switching nodes in the distributed master-slave system further includes: and after receiving the directory creation success information fed back by the coordination server, the working master node acquires and loads the data in the database before distributing the task to the at least one slave node, and writes the data in the memory into the database at intervals of a second preset time after distributing the task to the at least one slave node.
Further, the method for switching nodes in the distributed master-slave system further includes: and after receiving the directory creation success information fed back by the coordination server, the working main node initializes all internal components before acquiring and loading data in the database.
Further, the coordination server broadcasts the deletion information of the temporary directory through the directory state interface, and the method for switching the nodes in the distributed master-slave system further comprises the following steps: and when the working master node monitors that the temporary directory corresponding to the first slave node is deleted, closing the first slave node.
Further, the method for switching nodes in the distributed master-slave system further includes: after a work master node distributes tasks to at least one slave node, a task state recording table is created; the slave node feeds back task state information to the working master node; the work main node updates the task state recording table according to the task state information; the working master node distributing the tasks which are not completed on the first slave node to the second slave node comprises the following steps: and querying the task state record table, acquiring the uncompleted tasks on the first slave node, and distributing the uncompleted tasks to the second slave node.
Further, the method for switching nodes in the distributed master-slave system further includes: after acquiring the unfinished task on the first slave node and before distributing the unfinished task to the second slave node, the work master node judges whether the unfinished task generates a data result, and deletes the data result when the unfinished task generates the data result.
Further, the work master node deleting the data result comprises: querying a receiving location of the data result; if the receiving position is the external storage, deleting the data result in the external storage; and if the receiving position is an external cluster, deleting the data result in the external storage.
Further, the method for switching nodes in the distributed master-slave system further includes: after receiving the directory creation success information fed back by the coordination server, the slave node reports the resource use information and the number of the operated processes to the coordination server at intervals of a third preset time; the coordination server creates a slave node state table, and updates the slave node state table according to the resource use information reported by the slave node and the number of the operated processes, wherein the slave node state table comprises the slave node, the resource use information corresponding to the slave node and the number of the operated processes; the work master node assigning tasks to at least one slave node comprises: and the work master node determines at least one slave node according to the slave node state table and distributes tasks to the determined slave nodes.
The invention provides a node switching method in a distributed master-slave system.A master node and a slave node both send registration requests to a coordination server, the coordination server selects a working master node from a plurality of master nodes according to the registration requests sent by the master nodes, creates a temporary directory corresponding to the working master node, and the other master nodes which are not created with the temporary directory are redundant master nodes; the coordination server creates a corresponding temporary directory for each slave node according to the registration requests sent by the slave nodes. For the nodes which receive the successful directory creation information fed back by the coordination server, heartbeat at an interval of a first preset time length is maintained between the nodes and the coordination server, the coordination server monitors updating of the heartbeat maintained by each node, when the heartbeat of one node is detected to stop updating, the temporary directory corresponding to the node is deleted, and meanwhile, deletion information of the temporary directory is broadcasted. After the master node becomes a working master node, tasks are distributed to at least a first slave node in the slave nodes, deletion information of a temporary directory broadcasted by the coordination server is monitored, when the fact that the temporary directory corresponding to the first slave node is deleted is monitored, it is indicated that the first slave node fails, uncompleted tasks on the first slave node are distributed to a second slave node in the slave nodes, timely sensing and switching of the failed slave nodes are achieved, manual configuration on the master node is not needed, the master node can sense and redistribute the tasks automatically, and response time of the tasks when the slave nodes fail is reduced. The unselected redundant main nodes also monitor the deletion information of the temporary directory broadcast by the coordination server, when the situation that the temporary directory corresponding to the current working main node is deleted is monitored, the situation that the current working main node fails is indicated, the redundant main nodes send registration requests to the coordination server, so that the coordination server reselects one working main node according to the received registration requests, the reselected working main node replaces the failed main node, and the timely sensing and switching of the failed main node are achieved.
Drawings
Fig. 1 is a flowchart of a method for switching nodes in a distributed master-slave system according to an embodiment of the present invention;
fig. 2 is a flowchart of another method for switching a slave node in a distributed master-slave system according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for switching a slave node in another distributed master-slave system according to an embodiment of the present invention;
fig. 4 is a block diagram of a distributed master-slave system according to a second embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a method for switching nodes in a distributed master-slave system. The distributed master-slave system comprises a coordination server and a plurality of nodes, wherein the plurality of nodes comprise at least two master nodes and at least two slave nodes. The master nodes may send a first registration request to the coordination server, and the coordination server may select one master node from the master nodes according to a plurality of first registration requests, and create a temporary directory corresponding to the master node, where the master node selected and created with the temporary directory becomes a working master node in an active state, and the master nodes not selected become redundant master nodes in a standby state. The slave node may send a second registration request to the coordinator server, and the coordinator server may be capable of creating a corresponding temporary directory for each slave node according to the plurality of second registration requests. The method comprises the steps that after a coordination server creates a temporary directory for a master node or a slave node, directory creation success information is fed back, after the work master node and the slave node receive the directory creation success information fed back by the coordination server, heartbeat of an interval with a first preset time is maintained with the coordination server, when the heartbeat of one node stops updating, the node is represented to have a fault, at the moment, the coordination server deletes the temporary directory corresponding to the node, and deletion information of the temporary directory is broadcasted. Based on this, in the node switching method in the distributed master-slave system provided by the application, the redundant master node in the standby state and the working master node in the active state both monitor and coordinate deletion information of the temporary directory broadcast by the server.
The working master node in the active state at least allocates tasks to a first slave node in the slave nodes, and when it is detected that the temporary directory corresponding to the first slave node is deleted, it indicates that the first slave node fails, and at this time, the working master node allocates an incomplete task on the first slave node to a second slave node in the slave nodes for execution, that is, the working master node replaces the failed slave node with a normal slave node to execute the incomplete task. It can be seen from the above that, when the slave node is normal, the heartbeat is maintained with the coordination server, and when the slave node fails, the heartbeat stops updating, so that the coordination server can sense that the slave node fails by stopping updating the heartbeat of the slave node and broadcast the heartbeat, so that when the work master node monitors that the temporary directory corresponding to the slave node is deleted, the unfinished task on the failed slave node is distributed to other normal slave nodes, the timely sensing and switching of the failed slave node are realized, the task can be automatically redistributed without manual configuration on the work master node, and the response time of the task when the slave node fails is reduced.
When the redundant main nodes in the standby state monitor that the temporary directories corresponding to the working main nodes are deleted, the redundant main nodes send the first registration request to the coordination server again, so that the coordination server can select a new working main node from the redundant main nodes again according to the received first registration request, and create the temporary directory corresponding to the new working main node, so that the new working main node replaces the failed historical working main node. It can be seen from the above contents that when the working master node is normal, the heartbeat is maintained with the coordination server, and when the working master node fails, the heartbeat stops updating, so that the coordination server can sense that the working master node fails through the heartbeat stop updating of the working master node and broadcast the failure, so that when the redundant master node monitors that the temporary directory corresponding to the working node is deleted, the coordination server selects a new working master node by sending the first registration request to the coordination server, and timely sensing and switching of the failed working master node are realized.
The present invention provides a specific embodiment of a method for switching nodes in a distributed master-slave system, which will be described in detail below.
Example one
The embodiment of the invention provides a method for switching nodes in a distributed master-slave system, wherein the distributed master-slave system comprises a coordination server and a plurality of nodes, the nodes comprise master nodes and slave nodes, and the master nodes comprise working master nodes and redundant master nodes. The coordination server may be a single server or a cluster server. By the node switching method in the distributed master-slave system provided in this embodiment, when a master node (that is, a working master node) in an active state fails, the master node (that is, a redundant master node) in the standby state can timely sense and convert the standby state into the active state, and when a slave node to which a task is allocated fails, the working master node in the active state can timely sense and convert an incomplete task on the slave node into other slave nodes, so that a task in the distributed master-slave system is automatically switched from the failed slave node to other normal slave nodes. Specifically, the method for switching nodes in a distributed master-slave system provided in this embodiment includes the following steps S101 to S108.
Step S101: the plurality of master nodes send a first registration request to the coordination server.
In the distributed master-slave system, a plurality of master nodes are in a standby state after being started, and can send a first registration request to the coordination server so as to request the coordination server to create a corresponding temporary directory.
Step S102: and the coordination server selects a working main node from the plurality of main nodes according to the plurality of first registration requests and creates a temporary directory corresponding to the working main node.
When the plurality of redundant main nodes send first registration requests to the coordination server, the coordination server receives the plurality of first registration requests, selects one redundant main node from the plurality of redundant main nodes as a working main node according to the plurality of first registration requests, and creates a temporary directory for the working main node. Optionally, the coordination server may select one redundant master node from the multiple redundant master nodes as a working master node to create the temporary directory for the working master node according to a Paxos algorithm of the distributed consistency protocol, where the Paxos algorithm of the distributed consistency protocol belongs to common knowledge in the prior art and is not described here again. Alternatively, the coordination server may be a zookeeper server.
After the coordination server creates the temporary directory for the work master node, directory creation success information is fed back to the work slave node, and the work master node can receive the task and distribute the task to the slave nodes for execution. Optionally, the redundant master node may also serve as a slave node to receive and execute tasks, thereby improving the utilization rate of resources in the distributed master-slave system.
Step S103: the plurality of slave nodes send a second registration request to the coordinating server.
And the slave nodes in the distributed master-slave system send second registration requests to the coordination server so that the coordination server creates a temporary directory for the slave nodes, and after the coordination server creates the temporary directory for the slave nodes, the slave nodes can receive and execute tasks allocated by the master nodes.
Step S104: and the coordination server respectively creates a corresponding temporary directory for each slave node according to the plurality of second registration requests.
The coordination server receives second registration requests sent by a plurality of slave nodes, creates a temporary directory for each slave node, and feeds back directory creation success information to each slave node.
Step S105: after receiving the directory creation success information fed back by the coordination server, the working master node and the plurality of slave nodes maintain heartbeat at intervals of a first preset time length with the coordination server.
After receiving the directory creation success information fed back by the coordination server, the master node indicates that the master node has become a work master node, at this time, the work master node and the coordination server maintain the heartbeat at the interval of the first predetermined time, that is, the work master node sends heartbeat information to the coordination server once at the interval of the first predetermined time, and the coordination server updates the existing heartbeat information by using the received heartbeat information of the work master node, so as to update the heartbeat information at the interval of the first predetermined time at the interval, for example, the first predetermined time is 30 s.
After the coordination server creates the temporary directory for the slave node, the information of the slave node is written into the slave node state table, and the master node can distribute tasks to the slave node according to the information in the slave node state table. Meanwhile, after receiving the directory creation success information fed back by the coordination server, each slave node maintains the heartbeat at the interval of the first preset time length with the coordination server, that is, each slave node sends heartbeat information to the coordination server once at each interval of the first preset time length, and the coordination server maintains the update of the heartbeat of each slave node, that is, the coordination server updates the existing heartbeat information of the slave node by using the received heartbeat information of one slave node, that is, the heartbeat of each slave node can be updated at each interval of the first preset time length.
Step S106: and when monitoring that the heartbeat of a node stops updating, the coordination server deletes the temporary directory corresponding to the node and broadcasts the deletion information of the temporary directory.
When a node fails, namely the node goes down or the communication network fails, the node stops sending heartbeat information to the coordination server, at this time, the heartbeat corresponding to the node on the coordination server stops updating, the coordination server deletes the temporary directory corresponding to the node based on the updating stopping event, broadcasts the deletion information of the temporary directory, and represents that the temporary directory corresponding to the node is deleted through the deletion information.
Step S107: and the work master node at least distributes tasks to a first slave node in the slave nodes, and distributes the tasks which are not completed on the first slave node to a second slave node in the slave nodes when the temporary directory corresponding to the first slave node is monitored to be deleted.
The method comprises the steps that after a work main node receives a task submitted by a user through an interface, the task is distributed to at least one slave node, the first slave node is any one slave node of the task distributed by the work main node, the work main node monitors deletion information of a temporary directory broadcast by a coordination server, when the temporary directory corresponding to the first slave node is monitored to be deleted, namely the first slave node is monitored not to normally execute the task, the task which is not completed on the first slave node is distributed to a second slave node in the slave nodes.
Step S108: and when monitoring that the temporary directory corresponding to the working main node is deleted, the redundant main node sends the first registration request to the coordination server.
In the step, the redundant main nodes monitor deletion information of the temporary directory broadcast by the coordination server, when the temporary directory of the working main nodes is monitored to be deleted, namely when the current working main node fails, the first registration request is sent to the coordination server again, at the moment, the coordination server selects a new main node from the multiple redundant main nodes as the working main node according to the current multiple first registration requests according to the Paxos algorithm of the distributed consistency protocol, the temporary directory is created for the new main node, and the selected new working main node can receive and distribute tasks, so that the timely sensing and switching of the failed working main node are realized.
By adopting the node switching method in the distributed master-slave system provided by the embodiment, the plurality of master nodes send the first registration request to the coordination server, so that the coordination server selects one working master node from the plurality of master nodes according to the plurality of first registration requests, creates the temporary directory corresponding to the working master node, when one master node receives directory creation success information fed back by the coordination server, the master node becomes a working master node capable of receiving and allocating tasks, and maintains heartbeat at intervals of a first preset time length with the coordination server, and when the master node does not receive the creation success information, the master node is a redundant master node. When monitoring that the heartbeat maintained by the working master node and the coordination server stops updating, the coordination server deletes the temporary directory and broadcasts the deletion information of the temporary directory to serve as a redundant master node which monitors whether the deletion information corresponding to the working master node exists or not, and when monitoring that the temporary directory of the working master node is deleted, the coordination server sends a first registration request to the coordination server again, so that when the working master node fails, the heartbeat cannot be maintained with the coordination server, the heartbeat stops updating, the coordination server deletes the temporary directory and broadcasts the temporary directory, and when monitoring that the temporary directory of the master node is deleted, the redundant master node monitors that the working master node fails, the first registration request is sent to the coordination server, so that the coordination server reselects one working master node according to a new first registration request and creates the corresponding temporary directory, the main node which successfully creates the temporary directory on the coordination server replaces the working main node to become a new working main node, and timely sensing and switching are realized when the main node fails. The plurality of slave nodes send a second registration request to the coordination server, after the temporary directories are successfully created on the coordination server, the heartbeat interval with the coordination server is maintained for a first preset time, the coordination server is used for deleting the temporary directory corresponding to one slave node when the heartbeat of the slave node stops updating, meanwhile, the coordination server can broadcast the deletion information of the temporary directory when the temporary directory is deleted, based on the deletion information of the temporary directory broadcast by the coordination server is monitored after the work master node distributes tasks to the first slave node, so as to achieve the effect of monitoring the first slave node, if the work master node receives the deletion information of the temporary directory broadcast by the coordination server, and the deletion information represents that the temporary directory corresponding to the first slave node is deleted, which indicates that the first slave node fails, then the tasks on the first slave node are distributed to the second slave node, the fault slave node can sense and switch in time, manual configuration on the working master node is not needed, the working master node can sense and automatically redistribute tasks, and the response time of the tasks when the slave node breaks down is shortened.
It should be noted that, in the embodiments provided by the present invention, the first and second of 102 and 103 in "step S102", "step S103", and the like, the "first predetermined time length", "second predetermined time length", and the like are only used for distinguishing different concepts, and do not constitute a limitation on the order.
Optionally, in an embodiment, the coordination server broadcasts the deletion information of the temporary directory through the directory state interface; the working main node monitors that the temporary directory corresponding to the first slave node is deleted comprises the working main node monitors that the temporary directory corresponding to the first slave node is deleted by calling a directory state interface; the step of deleting the temporary directory corresponding to the redundant main node monitoring working main node comprises the step of deleting the temporary directory corresponding to the redundant main node monitoring working main node by calling a directory state interface.
Specifically, the coordinating server provides a directory state interface through which delete information may be broadcast when the coordinating server deletes a temporary directory, and an object calling the directory state interface may receive the delete information. The host node calls the directory state interface and monitors whether the deletion information exists or not by calling the directory state interface.
By adopting the node switching method in the distributed master-slave system provided by the embodiment, the working master node monitors whether the temporary directory of the slave node to which the task is allocated is deleted by calling the directory state interface of the coordination server, so as to monitor the working state of the slave node; the redundant main node monitors whether the temporary directory deletion information exists or not by calling a directory state interface of the coordination server, and monitors the working state of the working main node. On one hand, when the coordination server broadcasts the directory deletion information, the directory deletion information can be received only by the main node calling the directory state interface, so that the influence of the directory deletion information on other objects in the distributed master-slave system is avoided; on the other hand, the working master node can obtain the directory deletion information representing the fault of the slave node in time when the slave node fails only by executing the step of calling the directory state interface of the coordination server, and the fault judgment is realized without interaction between the working master node and the slave node, so that the resource overhead of the slave node is reduced; the redundant main node can timely obtain the directory deletion information representing the fault of the working main node when the working main node fails only by executing the step of calling the directory state interface of the coordination server, the fault judgment is realized without interaction between the redundant main node and the working node, and the resource overhead of the working node is reduced.
Fig. 2 is a flowchart of another method for switching nodes in a distributed master-slave system according to an embodiment of the present invention, and optionally, in an embodiment, as shown in fig. 2, the method for switching nodes in a distributed master-slave system further includes: step S109, after the coordination server creates a temporary directory corresponding to the work master node, the work master node is written into the permanent directory; step S110, after the work master node receives the directory creation success information fed back by the coordination server, the work master node reads the permanent directory, searches the information of the history work master node which is replaced by the current work master node and has a fault, and closes the history work master node.
Specifically, a persistent directory is maintained on the coordination server, and after a master node is selected from a plurality of master nodes to create a temporary directory for the master node, the information of the selected master nodes is sequentially written into the persistent directory, so that the persistent directory includes information of all master nodes that successfully create the temporary directory, that is, information of all working master nodes, and the information of the working master nodes includes IP addresses of the master nodes. After a master node is successfully created into a temporary directory, the master node becomes a current working master node, reads the permanent directory on the coordination server, and can obtain the information of the previous working master node in history, namely the information of the history master node which is replaced by the current working master node and has a fault, and at the moment, the current working master node closes the history master node.
The first main node and the second main node are any two main nodes in a distributed main-slave system, and when the first main node is in an active state, the second main node is in a standby state. Taking the first host node and the second host node as an example, when the first host node is in a "fake death" state, such as a network problem or a process GC, and the first host node cannot keep heartbeat with the coordination server, the coordination server deletes the temporary directory of the first host node and broadcasts deletion information of the temporary directory, and after the second host node monitors the deletion information, the standby state is converted into an active state.
When the network problem of the first master node is improved or other processes of the process GC release resources to make the process GC disappear, the 'false death' state of the first master node is eliminated and the first master node returns to the active state, at this time, two master nodes in the active state exist in the distributed master-slave system, and further service conflict is generated. In order to avoid the service conflict, in the method for switching nodes in the distributed master-slave system provided in this embodiment, after the second master node successfully creates the temporary directory, that is, after the second master node is in an active state, the first master node is turned off, so that the first master node is forced to be offline, thereby avoiding the service conflict caused by "false death" of the first master node.
Further optionally, in an embodiment, turning off the history master node comprises: and remotely calling a command of the history main node operating system to close the history main node.
Specifically, the authority of remote operation between the master nodes in the distributed master-slave system can be set, and the information of the master nodes in the permanent directory includes the IP addresses of the master nodes. When the current working main node closes the history main node, reading the permanent directory on the coordination server to obtain the IP address of the history main node, and calling a shutdown command of the history main node operating system through the IP address to close the history main node.
Further optionally, in an embodiment, the method for switching nodes in a distributed master-slave system further includes: and starting the historical main node after the fourth preset time length of the historical main node is closed.
Specifically, after the history master node is turned off by the current working master node, the history master node is in an offline state, that is, in a resource idle state. In order to avoid resource idling, the current working master node is restarted after the current working master node is turned off to work for a fourth preset time. After the history master node is started, the history master node can be in a standby state and/or used as a slave node to receive tasks.
In many cases, the failure of the history master node can be solved by restarting, and therefore, by adopting the switching method of the nodes in the distributed master-slave system provided by the embodiment, the resource utilization rate can be further improved.
Optionally, in an embodiment, the distributed master-slave system further includes a database, please continue referring to fig. 2, the method for switching nodes in the distributed master-slave system further includes: step S111, after receiving the directory creation success information fed back by the coordination server, the work master node acquires and loads data in the database before distributing tasks to at least one slave node; step S112, after the task is allocated to at least one slave node, writing the data in the memory into the database at intervals of a second predetermined time.
Specifically, in consideration of the performance of receiving and distributing tasks by the master node, when the master node is in an active state, a large number of asynchronous operations exist, the tasks submitted by the user or the task states reported from the slave nodes are temporarily stored in the memory, and once the master node goes down, data in the memory is lost, so that the tasks submitted by the user are lost, and/or the state data updated by the slave nodes are lost. In order to prevent the problem of data loss, in the method for switching nodes in a distributed master-slave system provided in this embodiment, after receiving directory creation success information fed back by a coordination server, when the master node is in an active state, obtaining and loading data in a database, loading data added by a history master node in the database, and writing the data in a memory into the database every second predetermined time interval, so that when a current working master node is replaced, a new master node can load information in the database, where the database may adopt a redis database, and the third predetermined time may be 3 s.
By adopting the method for switching the nodes in the distributed master-slave system, the reliability of the distributed master-slave system can be improved.
Further optionally, in an embodiment, the step of the master node writing the data in the memory into the database includes: the work main node covers the database by using the data in the memory in full; or the work main node performs incremental updating on the data in the database by using the data in the memory.
Specifically, in one embodiment, every time a fifth predetermined time interval elapses, the current master node replaces all the memory data written last time in the database with the data in the current memory, and when writing data into the database, the logic is simple, and the amount of data stored in the database is reduced. In another embodiment, every sixth preset time interval, the current working master node compares the data in the current memory with the data in the database, and writes the data with difference into the database, so as to ensure the comprehensiveness and non-repeatability of the data in the database.
Optionally, in an embodiment, the method for switching nodes in a distributed master-slave system further includes: and after receiving the directory creation success information fed back by the coordination server, the working main node initializes all internal components before acquiring and loading data in the database.
Specifically, the internal components of the work master node include a component for receiving a task submitted by a user, a component for receiving a task state of the slave node, and the like, after receiving directory creation success information fed back by the coordination server and before acquiring and loading data in the database, initialization is performed on each internal component, after initialization is completed, each internal component is ensured to be in an initial state, then the data in the database is acquired and loaded, and therefore when each internal component is in an intermediate state which is not in the initial state, conflict with the data in the loaded database is avoided, and data loss in the loaded database when the internal component is initialized is also avoided.
Fig. 3 is a flowchart of a method for switching a slave node in a distributed master-slave system according to an embodiment of the present invention, and optionally, in an embodiment, as shown in fig. 3, the method for switching a node in a distributed master-slave system further includes: step S113, when the work master node monitors that the temporary directory corresponding to the first slave node is deleted, the work master node closes the first slave node.
Specifically, the directory deletion information fed back by the directory state interface may include identification information of the slave node, and when the temporary directory of the first slave node is deleted, the work master node may obtain the identification information of the first slave node from the monitored deletion information, and then determine the first slave node according to the identification information of the first slave node, and close the first slave node.
When the first slave node is in a "dying of" state, that is, the first slave node is not really completely in a state of being unable to execute the task, the first slave node may execute the task again after a period of failure. Based on this situation, after the working master node allocates the task that is not completed on the first slave node to the second slave node, a situation may occur in which the first slave node and the second slave node execute the task at the same time, resulting in a traffic conflict. In order to avoid the service conflict, in the method for switching nodes in the distributed master-slave system provided in this embodiment, after determining that the temporary directory of the first slave node is deleted, the working master node closes the first slave node, so that the first slave node is forced to be offline, thereby avoiding the service conflict caused by "false death" of the first slave node.
Further optionally, in an embodiment, the step of turning off the first slave node comprises: a command to remotely invoke the operating system of the first slave node to close the first slave node.
Specifically, the master node in the distributed master-slave system may be set to have a remote operation authority of each slave node, and the directory deletion information may include an IP address of the slave node. When the master node closes the first slave node, the master node analyzes the directory deletion information to obtain the IP address of the first slave node, and then calls a shutdown command of the operating system of the first slave node through the IP address to close the first slave node.
Optionally, in an embodiment, after the first slave node is turned off, the method for switching nodes in the distributed master-slave system further includes: and starting the first slave node after a seventh preset time.
Specifically, after the first slave node is turned off by the work master node, the first slave node is in an offline state, that is, in a resource idle state. In order to avoid the idle of resources, the work master node restarts the first slave node after closing the first slave node for a seventh preset time. After the first slave node is started, the coordination server is requested to create the temporary directory, and after the first slave node successfully creates the temporary directory on the coordination server again, other tasks distributed by the work master node can be continuously received and executed.
In many cases, the failure of the first slave node may be solved through restart, and therefore, by using the method for switching nodes in the distributed master-slave system provided by this embodiment, the resource utilization rate can be further improved.
Optionally, in an embodiment, please continue to refer to fig. 3, the method for switching nodes in a distributed master-slave system further includes: step S114, after the work master node distributes tasks to at least one slave node, a task state recording table is created; step S115, the slave node feeds back task state information to the work master node; step S116, the work master node updates a task state record table according to the task state information; in step S107, the distributing, by the master node, the uncompleted task on the first slave node to the second slave node includes: and querying the task state record table, acquiring the uncompleted tasks on the first slave node, and distributing the uncompleted tasks to the second slave node.
Specifically, when the work master node allocates tasks to the first slave nodes, a task state record table corresponding to the tasks is created, the first slave nodes feed back the execution states of the tasks, namely, the task state information, to the work master node in the process of receiving and executing the tasks, and the work master node updates the task state record table according to the task state information fed back by the first slave nodes, so that when the work master node needs to allocate the tasks which are not completed on the first slave nodes to the second slave nodes, the tasks which are not completed on the first slave nodes can be obtained by inquiring the task state record table, and then the tasks are allocated.
By adopting the node switching method in the distributed master-slave system provided by the embodiment, the working master node can acquire the execution state of the task in real time through the task state recording table, so that when the slave node fails, the task which is not completed on the failed slave node is acquired in time and is redistributed to the normal slave node for execution, and the response time of the task when the slave node fails is further reduced.
Optionally, when the work master node receives the task, the longest response duration of the task may be determined according to the characteristic parameters of the task, or the parameters of the task include the longest response duration, and the longest response duration may be obtained when the work master node analyzes the parameters of the task, no matter which way the longest response duration is obtained, after the work master node allocates the task to the slave node, the execution time of the task is written in the task state record table, and when the actual execution time of the task reaches the longest response duration and the task is not executed yet, the task is deleted from the slave node that currently executes the task, and the task is reallocated to other slave nodes.
Further optionally, when the actual execution time of the task reaches the longest response time and the task is not executed yet, the information of the type of the task and the slave node is recorded, and when the task is subsequently allocated, the task of the same type is prevented from being allocated to the slave node, so that the response time of the task is prolonged.
Optionally, in an embodiment, the method for switching nodes in a distributed master-slave system further includes: after acquiring the unfinished task on the first slave node and before distributing the unfinished task to the second slave node, the work master node judges whether the unfinished task generates a data result, and deletes the data result when the unfinished task generates the data result.
Specifically, for the tasks which are not completed on the first slave node, it is possible that the tasks have already been executed with a partial step, and a data result is generated in the process of completing the partial step, for this reason, after acquiring the tasks which are not completed on the first slave node, the work master node determines whether the tasks have already generated the data result before distributing the acquired tasks to the second slave node, and when the data result has been generated, the generated data result is deleted, so as to avoid that the second slave node generates the same data result again when the tasks which are not completed on the first slave node are distributed to the second slave node for execution, thereby causing data collision or data redundancy. Specifically, whether a data result has been generated may be determined by the task state record table.
By adopting the switching method of the nodes in the distributed master-slave system provided by the embodiment, for the tasks that are not completed in the first slave node, the tasks are executed by the first slave node to form data result deletion, so that data collision or data redundancy caused when the tasks are executed by the second slave node is avoided, meanwhile, deletion is performed before the tasks that are not completed on the first slave node are distributed to the second slave node, and the data result generated when the tasks are executed by the second slave node is avoided being deleted by mistake.
Optionally, in an embodiment, the working master node deleting the data result includes: querying a receiving location of the data result; if the receiving position is the external storage, deleting the data result in the external storage; and if the receiving position is an external cluster, deleting the data result in the external storage.
Specifically, when deleting the data result, the receiving position of the data result is queried first, that is, where the data result is transmitted first, in one case, the receiving position of the data result is written in the task state record table, so that the receiving position of the data result can be obtained by querying the task state record table; in another case, the receiving location of the data result is written in the task information of the user-submitted task, and thus the receiving location of the data result can also be obtained by querying the task information.
Based on different specific tasks executed by the slave nodes, the formed data result may be written into an external storage or transmitted to an external cluster, and when the data result is deleted, the deletion may be performed according to the difference between the external storage or the external cluster.
Optionally, in an embodiment, the method for switching nodes in a distributed master-slave system further includes: after receiving the directory creation success information fed back by the coordination server, the slave node reports the resource use information and the number of the operated processes to the coordination server at intervals of a third preset time; the coordination server creates a slave node state table, and updates the slave node state table according to the resource use information reported by the slave node and the number of the operated processes, wherein the slave node state table comprises the slave node, the resource use information corresponding to the slave node and the number of the operated processes; the work master node assigning tasks to at least one slave node comprises: and the work master node determines at least one slave node according to the slave node state table and distributes tasks to the determined slave nodes.
Specifically, after receiving a task submitted by a user, the work master node determines at least one slave node according to the slave node state table, and allocates the task to the determined slave node, that is, selects a proper slave node to execute the current task according to the current self resource use information and the number of the executed processes of each slave node.
By adopting the node switching method in the distributed master-slave system provided by the embodiment, the task can be distributed to the proper slave node when the work master node distributes the task, and the task execution efficiency is further improved.
Further optionally, in an embodiment, the resource usage information comprises usage information of at least two resources. The step of the working master node determining at least one slave node according to the slave node state table comprises the following steps: the work master node determines the resource type of the task to be distributed according to the type of the task to be distributed, searches a plurality of slave nodes with the running process number smaller than the preset process number in a slave node state table, and determines one slave node with the least consumption of the resource type of the task to be distributed according to the resource use information corresponding to the plurality of slave nodes.
Specifically, the resource usage information includes usage information of at least two kinds of resources, such as usage information of CPU resources and usage information of memory resources. And each slave node reports the use information of the CPU resource, the use information of the memory resource and the number of the operated processes to the coordination server at intervals of preset duration. For example, for the types of tasks such as mr, hivesql, shell, and email, the main resources consumed by the two types of tasks such as mr and shell are memory resources, and the main resources consumed by the two types of tasks such as hivesql and email are CPU resources. When the type of the task to be distributed is mr or shell, determining that the resource type of the task to be distributed is a memory resource, and selecting a slave node with the least memory resource consumption from a plurality of slave nodes with the running process number smaller than the preset process number; and when the type of the task to be distributed is hivesql or email, determining that the resource type of the task to be distributed is CPU (Central processing Unit) resource, and selecting one slave node with the least CPU resource consumption from a plurality of slave nodes with the running process number smaller than the preset process number.
When the task is distributed after the task submitted by the user is received through the interface, the task execution characteristics can be considered at the same time, for example, when the task is an exclusively executed task, the task is distributed to one slave node, and when the task is a parallel executed task including a plurality of subtasks, each subtask is distributed to different slave nodes to be executed.
Example two
Corresponding to the first embodiment, the second embodiment of the present invention provides a distributed master-slave system, and detailed descriptions and technical effects of some technical features may refer to the first embodiment, which is not described herein again. Fig. 2 is a block diagram of a distributed master-slave system according to a second embodiment of the present invention, and as shown in fig. 2, the distributed master-slave system includes: a coordination server 201 and a plurality of nodes; the nodes include a plurality of master nodes 202 and a plurality of slave nodes 203, with the master node 202 including a worker master node 202A and a redundant master node 202B.
The plurality of master nodes 2022 are configured to send a first registration request to the coordination server 201; the coordination server 201 is configured to select one working master node 202A from the plurality of master nodes 202 according to the plurality of first registration requests, and create a temporary directory corresponding to the working master node 202A, where a master node 202 that is not currently created with the temporary directory is a redundant master node 202B; a plurality of slave nodes 203 for sending a second registration request to the coordinator server 201; the coordination server 201 is further configured to create a corresponding temporary directory for each slave node 203 according to the plurality of second registration requests; the working master node 202A and the plurality of slave nodes 203 are further configured to maintain a heartbeat at an interval of a first predetermined time length with the coordination server 201 after receiving the directory creation success information fed back by the coordination server 201; the coordination server 201 is further configured to delete the temporary directory corresponding to the node when monitoring that the heartbeat of the node stops updating, and broadcast deletion information of the temporary directory; the work master node 202A is further configured to at least allocate a task to a first slave node 203A in the slave nodes 203, and when it is monitored that the temporary directory corresponding to the first slave node 203A is deleted, allocate an incomplete task on the first slave node 203A to a second slave node 203B in the slave nodes 203; the redundant master node 202B is further configured to send a first registration request to the coordination server 201 when it is monitored that the temporary directory corresponding to the working master node 202A is deleted.
Optionally, in an embodiment, the coordination server 201 is further configured to broadcast deletion information of the temporary directory through the directory state interface; the working master node 202A is further configured to monitor that the temporary directory corresponding to the first slave node 203A is deleted by calling a directory state interface; the redundant master node 202B is further configured to monitor that the temporary directory corresponding to the worker master node 202A is deleted by calling the directory state interface.
Optionally, in an embodiment, after the coordination server 201 creates the temporary directory corresponding to the worker master node 202A, it is further configured to write the worker master node 202A into the permanent directory; after receiving the directory creation success information fed back by the coordinator server 201, the worker master node 202A is further configured to read the persistent directory, search for information of the failed worker master node 202A replaced by the current worker master node 202A, and turn off the worker master node 202A.
Optionally, in an embodiment, the distributed master-slave system further includes a database, and the work master node 202A is further configured to, after receiving the directory creation success information fed back by the coordination server 201, obtain and load data in the database before allocating a task to the at least one slave node 203, and after allocating a task to the at least one slave node 203, write data in the memory into the database at intervals of a second predetermined time.
Optionally, in an embodiment, after receiving the directory creation success information fed back by the coordination server 201, the work master node 202A is further configured to initialize all internal components before obtaining and loading data in the database.
Optionally, in an embodiment, the work master node 202A is further configured to close the first slave node 203A when detecting that the temporary directory corresponding to the first slave node 203A is deleted.
Optionally, in an embodiment, the work master node 202A is further configured to create a task state record table after allocating a task to at least one slave node 203; the slave node 203 is also used for feeding back task state information to the work master node 202A; the work master node 202A is further configured to update the task state record table according to the task state information; when the work master node 202A allocates the task that is not completed on the first slave node 203A to the second slave node 203B, the specific steps executed include: and querying the task state record table, acquiring the uncompleted tasks on the first slave node 203A, and distributing the uncompleted tasks to the second slave node 203B.
Optionally, in an embodiment, the work master node 202A is further configured to determine whether the incomplete task generates a data result after acquiring the incomplete task on the first slave node 203A and before allocating the incomplete task to the second slave node 203B, and delete the data result when the incomplete task has generated the data result.
Optionally, in an embodiment, when the work master node 202A deletes the data result, the specifically executed steps include: querying a receiving location of the data result; if the receiving position is the external storage, deleting the data result in the external storage; and if the receiving position is an external cluster, deleting the data result in the external storage.
Optionally, in an embodiment, after receiving the directory creation success information fed back by the coordination server 201 from the node 203, the slave node is further configured to report resource usage information of the slave node and the number of running processes to the coordination server 201 every third predetermined time interval; the coordination server 201 is further configured to create a slave node 203 state table, and update the slave node 203 state table according to the resource usage information reported by the slave node 203 and the number of processes that have been run, where the slave node 203 state table includes the slave node 203, the resource usage information corresponding to the slave node 203, and the number of processes that have been run; when the work master node 202A allocates a task to at least one slave node 203, the specific steps executed include: the work master node 202A determines at least one slave node 203 from the slave node 203 state table and assigns a task to the determined slave node 203.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for switching nodes in a distributed master-slave system is characterized in that the distributed master-slave system comprises a coordination server and a plurality of nodes; the nodes comprise a main node and a slave node, and the main node comprises a working main node and a redundant main node; the method for switching the nodes in the distributed master-slave system comprises the following steps:
a plurality of main nodes send a first registration request to the coordination server;
the coordination server selects a working main node from a plurality of main nodes according to the first registration requests, and creates a temporary directory corresponding to the working main node, wherein the main node which is not created with the temporary directory at present is the redundant main node;
a plurality of the slave nodes send a second registration request to the coordination server;
the coordination server respectively creates a corresponding temporary directory for each slave node according to the plurality of second registration requests;
after receiving the directory creation success information fed back by the coordination server, the working master node and the plurality of slave nodes maintain heartbeat at intervals of a first preset time length with the coordination server;
when monitoring that the heartbeat of a node stops updating, the coordination server deletes a temporary directory corresponding to the node and broadcasts deletion information of the temporary directory;
the work master node at least allocates tasks to a first slave node in the slave nodes, and allocates uncompleted tasks on the first slave node to a second slave node in the slave nodes when the temporary directory corresponding to the first slave node is monitored to be deleted;
and when the redundant main node monitors that the temporary directory corresponding to the working main node is deleted, the redundant main node sends the first registration request to the coordination server.
2. The method for switching nodes in a distributed master-slave system according to claim 1,
the coordination server broadcasts the deletion information of the temporary directory through a directory state interface;
the working master node monitoring that the temporary directory corresponding to the first slave node is deleted comprises the working master node monitoring that the temporary directory corresponding to the first slave node is deleted by calling the directory state interface;
the monitoring of the temporary directory corresponding to the working main node by the redundant main node is deleted, and the monitoring of the temporary directory corresponding to the working main node by the redundant main node through calling the directory state interface is carried out.
3. The method for switching nodes in a distributed master-slave system according to claim 1, wherein the method for switching nodes in a distributed master-slave system further comprises:
after the coordination server creates a temporary directory corresponding to the work main node, writing the work main node into a permanent directory;
and after receiving the directory creation success information fed back by the coordination server, the working master node reads the permanent directory, searches the information of the failed historical working master node replaced by the current working master node, and closes the historical working master node.
4. The method for switching nodes in a distributed master-slave system according to claim 1, wherein the distributed master-slave system further comprises a database, and the method for switching nodes in a distributed master-slave system further comprises:
and after receiving the directory creation success information fed back by the coordination server, the working master node acquires and loads the data in the database before distributing tasks to at least one slave node, and writes the data in the memory into the database every second preset time after distributing the tasks to at least one slave node.
5. The method for switching nodes in a distributed master-slave system according to claim 4, wherein the method for switching nodes in a distributed master-slave system further comprises:
and after receiving the directory creation success information fed back by the coordination server, the working master node initializes all internal components before acquiring and loading the data in the database.
6. The method for switching nodes in a distributed master-slave system according to claim 1, wherein the method for switching nodes in a distributed master-slave system further comprises:
and when the working master node monitors that the temporary directory corresponding to the first slave node is deleted, closing the first slave node.
7. The method for switching nodes in a distributed master-slave system according to claim 1, wherein the method for switching nodes in a distributed master-slave system further comprises:
the work master node creates a task state record table after distributing tasks to at least one slave node;
the slave node feeds back task state information to the working master node;
the work main node updates the task state record table according to the task state information;
the distributing, by the working master node, the tasks that are not completed on the first slave node to the second slave node comprises: and querying the task state record table, acquiring the uncompleted tasks on the first slave node, and distributing the uncompleted tasks to the second slave node.
8. The method for switching nodes in a distributed master-slave system according to claim 7, wherein the method for switching nodes in a distributed master-slave system further comprises:
after the work master node acquires the uncompleted tasks on the first slave node and before the uncompleted tasks are distributed to the second slave nodes, whether the uncompleted tasks generate data results or not is judged, and when the uncompleted tasks generate the data results, the data results are deleted.
9. The method of claim 8, wherein the master node deleting the data result comprises:
querying a receiving position of the data result;
if the receiving position is an external storage, deleting the data result in the external storage;
and if the receiving position is an external cluster, deleting the data result in the external storage.
10. The method for switching nodes in a distributed master-slave system according to claim 1, wherein the method for switching nodes in a distributed master-slave system further comprises:
after receiving the directory creation success information fed back by the coordination server, the slave node reports the resource use information and the number of the operated processes to the coordination server at intervals of a third preset time;
the coordination server creates a slave node state table, and updates the slave node state table according to the resource use information reported by the slave node and the number of the operated processes, wherein the slave node state table comprises the slave node, the resource use information corresponding to the slave node and the number of the operated processes;
the work master node assigning tasks to at least one of the slave nodes comprises: and the working master node determines at least one slave node according to the slave node state table and distributes tasks to the determined slave nodes.
CN201911183954.XA 2019-11-27 2019-11-27 Method for switching nodes in distributed master-slave system Pending CN112860386A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911183954.XA CN112860386A (en) 2019-11-27 2019-11-27 Method for switching nodes in distributed master-slave system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911183954.XA CN112860386A (en) 2019-11-27 2019-11-27 Method for switching nodes in distributed master-slave system

Publications (1)

Publication Number Publication Date
CN112860386A true CN112860386A (en) 2021-05-28

Family

ID=75985766

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911183954.XA Pending CN112860386A (en) 2019-11-27 2019-11-27 Method for switching nodes in distributed master-slave system

Country Status (1)

Country Link
CN (1) CN112860386A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113660350A (en) * 2021-10-18 2021-11-16 恒生电子股份有限公司 Distributed lock coordination method, device, equipment and storage medium
CN113821329A (en) * 2021-11-24 2021-12-21 湖南大学 Parallel task processing method and system for large-scale data
CN114363350A (en) * 2021-12-14 2022-04-15 中科曙光南京研究院有限公司 Service management system and method
CN117714056A (en) * 2024-02-05 2024-03-15 中国船舶集团有限公司第七〇七研究所 Service-oriented special password service system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107168813A (en) * 2017-04-28 2017-09-15 平安科技(深圳)有限公司 Task processing method and system
CN107729126A (en) * 2016-08-12 2018-02-23 中国移动通信集团浙江有限公司 A kind of method for scheduling task and device of container cloud
CN107819556A (en) * 2016-09-12 2018-03-20 北京金山云网络技术有限公司 A kind of service state switching method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729126A (en) * 2016-08-12 2018-02-23 中国移动通信集团浙江有限公司 A kind of method for scheduling task and device of container cloud
CN107819556A (en) * 2016-09-12 2018-03-20 北京金山云网络技术有限公司 A kind of service state switching method and device
CN107168813A (en) * 2017-04-28 2017-09-15 平安科技(深圳)有限公司 Task processing method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
冯战胜,张激,彭宏,刘颖娜: "基于Zookeeper的分布式ICE中间件研究", 《计算机系统应用》 *
天津滨海迅腾科技集团有限公司: "《大数据高可用环境搭建与运维》" *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113660350A (en) * 2021-10-18 2021-11-16 恒生电子股份有限公司 Distributed lock coordination method, device, equipment and storage medium
CN113821329A (en) * 2021-11-24 2021-12-21 湖南大学 Parallel task processing method and system for large-scale data
CN113821329B (en) * 2021-11-24 2022-02-11 湖南大学 Parallel task processing method and system for large-scale data
CN114363350A (en) * 2021-12-14 2022-04-15 中科曙光南京研究院有限公司 Service management system and method
CN114363350B (en) * 2021-12-14 2024-04-16 中科曙光南京研究院有限公司 Service management system and method
CN117714056A (en) * 2024-02-05 2024-03-15 中国船舶集团有限公司第七〇七研究所 Service-oriented special password service system

Similar Documents

Publication Publication Date Title
CN108958920B (en) Distributed task scheduling method and system
CN112860386A (en) Method for switching nodes in distributed master-slave system
US11226847B2 (en) Implementing an application manifest in a node-specific manner using an intent-based orchestrator
JP4721195B2 (en) Method for managing remotely accessible resources in a multi-node distributed data processing system
US8826290B2 (en) Method of monitoring performance of virtual computer and apparatus using the method
US10846185B2 (en) Method for processing acquire lock request and server
CN107005426B (en) Method and device for managing life cycle of virtual network function
CN112214293A (en) Method for service deployment under server-free architecture and function management platform
US20050050200A1 (en) Computer system and cluster system program
WO2022105138A1 (en) Decentralized task scheduling method, apparatus, device, and medium
CN112866314B (en) Method for switching slave nodes in distributed master-slave system, master node device and storage medium
JP3987517B2 (en) Computer system and cluster system program
US20210406127A1 (en) Method to orchestrate a container-based application on a terminal device
CN114064414A (en) High-availability cluster state monitoring method and system
CN112865992A (en) Method and device for switching master nodes in distributed master-slave system and computer equipment
CN112948050A (en) Method and device for deploying pod
CN112860787A (en) Method for switching master nodes in distributed master-slave system, master node device and storage medium
CN112865993B (en) Method and device for switching slave nodes in distributed master-slave system
CN113965576B (en) Container-based big data acquisition method, device, storage medium and equipment
CN109697112B (en) Distributed intensive one-stop operating system and implementation method
US8909666B2 (en) Data query system and constructing method thereof and corresponding data query method
CN112865995B (en) Distributed master-slave system
US20070180452A1 (en) Load distributing system and method
CN111614701B (en) Distributed cluster and container state switching method and device
CN110650059B (en) Fault cluster detection method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210528

RJ01 Rejection of invention patent application after publication