CN115269152A - Method for scheduling jobs - Google Patents

Method for scheduling jobs Download PDF

Info

Publication number
CN115269152A
CN115269152A CN202210917990.XA CN202210917990A CN115269152A CN 115269152 A CN115269152 A CN 115269152A CN 202210917990 A CN202210917990 A CN 202210917990A CN 115269152 A CN115269152 A CN 115269152A
Authority
CN
China
Prior art keywords
node
job
nodes
scheduling
parent
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
CN202210917990.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.)
Hangzhou Dtwave Technology Co ltd
Original Assignee
Hangzhou Dtwave 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 Hangzhou Dtwave Technology Co ltd filed Critical Hangzhou Dtwave Technology Co ltd
Priority to CN202210917990.XA priority Critical patent/CN115269152A/en
Publication of CN115269152A publication Critical patent/CN115269152A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/502Proximity
    • 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
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • G06F9/4887Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues involving deadlines, e.g. rate based, periodic

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application provides a method for scheduling jobs, which realizes better load balance among nodes through a consistent Hash algorithm.

Description

Method for scheduling jobs
Technical Field
The present application relates to computer technology, and in particular, to a method for scheduling jobs.
Background
There are many big data processing tools, such as a distributed computing framework Hadoop, a data warehouse tool Hive, a distributed system Spark based on memory computing, a large-scale graph data computing platform Giraph, and the like. With the aid of a wide variety of computing platforms, data developers submit jobs of various types to process and analyze data each day. There may be interdependencies between jobs and there may also be a limit or requirement on the start schedule time on each job. In addition, when distributing tasks to multiple computing nodes for operation, whether the loads among the nodes are balanced needs to be considered, so as to obtain the maximum overall efficiency.
Disclosure of Invention
According to a first aspect of the present application, there is provided a method for distributing tasks to a plurality of nodes, comprising:
mapping the unique identifiers Hash of the nodes into a digital space to obtain Hash values corresponding to the nodes of the nodes, wherein the digital space is defined as a closed ring which is connected end to end, and the Hash values corresponding to the nodes are marked on the ring;
mapping the identifiers of the tasks to the digital space according to the same Hash mapping method to obtain corresponding Hash values; and
and determining a node with a Hash value closest to the Hash value of the task according to a preset rule on the ring, and distributing the task to the node.
According to a second aspect of the present application, there is provided a computer readable medium having stored thereon computer readable instructions which, when executed, implement any of the methods for scheduling jobs as described herein.
The method for scheduling the jobs can reasonably distribute the tasks to the task submitter nodes, so that the load of each task submitter node is balanced, and the nodes are dynamically added or deleted, so that the tasks are more flexibly and efficiently executed.
Drawings
FIG. 1 illustrates the dependencies between jobs.
FIG. 2 illustrates a DAG graph formed by a plurality of job nodes.
FIG. 3 illustrates an example of the present application utilizing a DAG graph to implement job scheduling.
Fig. 4 illustrates a method of scheduling a job according to an exemplary embodiment of the present application.
Fig. 5 illustrates a flow diagram of timing scheduling in accordance with an exemplary implementation of the present application.
FIG. 6 shows a flowchart of dependent scheduling according to an example embodiment of the present application.
FIG. 7 illustrates a base DAG layer and a sub-DAG layer according to an exemplary embodiment of the present application.
FIG. 8 illustrates a flowchart for dependency scheduling using multiple DAG layers according to an exemplary embodiment of the present application.
FIG. 9 illustrates a schematic diagram of a multiple DAG layer according to an exemplary embodiment of the present application.
Fig. 10 shows a schematic diagram of Node and job Hash distribution according to an exemplary embodiment of the present application.
Fig. 11 is an architecture diagram of a system for scheduling jobs according to an exemplary embodiment of the present application.
FIG. 12 is a flowchart for job scheduling by dependency and timing according to an exemplary embodiment of the present application.
Detailed Description
The content of the present application will now be discussed with reference to a number of exemplary embodiments. It should be understood that these embodiments are discussed only to enable those of ordinary skill in the art to better understand and thereby implement the teachings of the present application, and are not intended to suggest any limitation as to the scope of the present application.
As used herein, the term "include" and its variants are to be read as open-ended terms meaning "including, but not limited to. The term "based on" is to be read as "based, at least in part, on. The terms "one embodiment" and "an embodiment" are to be read as "at least one embodiment". The term "another embodiment" is to be read as "at least one other embodiment". As used herein, the terms "task," "job" may refer to any kind of executable unit, including but not limited to a process, a thread, a module, or a collection thereof.
When there are multiple computing tasks, there may be dependencies between the tasks, i.e., the start of one task requires the successful completion of another task (e.g., the output of the latter task is the input required by the former task). Dependencies between tasks are often shown in Directed Acyclic Graphs (DAGs). FIG. 1 illustrates an example of dependencies between jobs. Nodes B, E, F and G represent 4 jobs, respectively, and the arrows in the figure represent the dependencies of the various job nodes. In the figure, the execution of the G job node depends on B, E and the execution result of the F node, and the G node can be executed only after B, E and the F node are executed successfully, namely B, E and the F node are parent dependent nodes of the G node.
FIG. 2 illustrates yet another example of a DAG graph. If a job does not have a parent dependency, the computing platform may simply receive the job itself when receiving the job, e.g., the A node and the D node in the graph, which are also referred to as the root node or initial job node of the DAG graph.
FIG. 3 illustrates an example of the present application's utilization of a DAG graph to implement job scheduling. Each task node is provided with a Watcher (Watcher), and each edge is provided with a Listener (Listener). The checker will observe the status of the corresponding job. When the job is completed or fails, the downstream nodes are notified (which may be active) of the status of their parent node through the listeners on each edge. For example, when node D is finished, the watch on node D first modifies the state of node D and informs the parent nodes D of nodes F and C that node D is finished through the Listener on the two edges D to F and D to C. In an embodiment of the present application, the notification message may be sent by using a known message notification mechanism of a distributed coordination service (e.g., zookeeper).
Embodiments of the present application provide methods for scheduling jobs, which are described below with reference to fig. 4, 5, and 6.
As shown in fig. 4, in S101, jobs submitted by users and dependencies among the jobs are received, and a DAG graph (for example, the DAG graph shown in fig. 2) embodying the dependencies is constructed.
In S102, it is detected whether or not a job is set with a constraint of start time. The start time constraint of a job means that execution of the job is started only when a predetermined time is reached.
In S103, if the job node is set with a constraint of start time, the job is added to a queue of jobs to be scheduled (which may be referred to as a time queue) to be scheduled in accordance with timing (timed scheduling).
An example of timing schedule management is shown in fig. 5. In S1031, jobs that reach the start time are periodically fetched from the time queue. The jobs may be arranged in the time queue in order of arrival time, and whether the job arranged at the head of the time queue reaches a predetermined time may be periodically checked. If it is found that the predetermined time has arrived, the operation in S1032 is performed for the job.
In S1032, it is checked whether the job reaching the start time has a parent dependent job whose execution is not successful.
In S1033, if the job reaching the start time does not have a parent dependent job whose execution has not been successful, the job reaching the start time is directly added to a queue to be executed (which may be a distributed queue).
In some embodiments of the present application, a job may have both a time constraint and a dependency constraint, and even if the predetermined time for the job has arrived, it does not represent that the job node can execute, and the job may be ready to execute when the conditions of the time constraint and the dependency constraint are satisfied at the same time.
By detecting the execution condition of the parent dependent job of the job reaching the starting time, the job without the parent dependent job which is not successfully executed is added into the queue of the dependent schedule, and the execution condition of the job in the queue can influence the condition of the dependent schedule, thereby establishing the connection and interaction of the timing schedule and the dependent schedule.
Returning to fig. 4, in S104, if the job is not set with a start time constraint, dependent scheduling is performed by the job.
The job not provided with the start time constraint is not affected by time, but is dependent and constrained due to the possible dependency relationship with other jobs. There is a need to ensure orderly execution of jobs by relying on schedule management. One embodiment of dependent scheduling is shown in fig. 6.
In S1041, an initial job without a parent dependent job is added to the queue to be scheduled. The queue may be a distributed queue or other type of queue, such as a first come first execute, FIFO queue.
In S1042, a job (which may be periodically fetched) is fetched from the queue to be scheduled (this stage is referred to as a work job), and the job is distributed to a task presenter Node (Node) for execution by a scheduling algorithm (e.g., a consistent Hash scheduling algorithm according to an embodiment of the present invention as described below). The Node may obtain information such as a code, resource information, parameter values, and the like of the job from the database according to the job ID of the work job, construct a job submission command, and then submit the job to the computing cluster for execution.
In S1043, if the execution of the job is successful, a message indicating that the execution of the job is successful is notified to the sub-job of the job.
In S1044, if all parent dependent jobs of the sub job are executed successfully and the sub job is not in the time queue, add the sub job to the job queue to be scheduled. Conversely, if the sub-job is in the time queue, then the timing schedule is performed according to the process shown in FIG. 5, according to its position in the time queue and its start time constraint.
In the implementation scheme that the distributed queue is used as the queue to be scheduled, after the work job is completed, the Node informs the Watcher corresponding to the job through a message notification mechanism of the distributed coordination service mechanism, and the job is completed. When the job status is failure, the Node dispatcher sends a stop dispatching message to all the downstream dependent jobs, and the downstream jobs are not operated. When the operation is successful, the downstream operation is informed that the parent operation is successfully executed through the Listener on each side in the DAG graph. After receiving the message that the parent operation is successfully executed, the downstream operation checks whether all parent dependent operations of the child operation are successfully executed and the child operation is not in the time queue, that is, the child operation can be added into the distributed queue to wait for being taken out and executed as a working operation.
And continuously taking out the work jobs from the queue to be scheduled and executing the work jobs, and putting the new jobs into the queue to be scheduled according to the execution results of the work jobs and the information in the time queue until all jobs in the DAG graph are executed successfully. Thus, whether to add a child job to the queue to be scheduled is determined by detecting the status of the parent dependent job of the child job and whether the child job is in the time queue. By the method for managing the dependent scheduling, all the jobs in the DAG can be executed while the time constraint and the dependent constraint are ensured to reach the conditions, and the efficiency is ensured while the accurate execution is ensured.
The embodiment in the application realizes a hybrid scheduling method which combines dependent scheduling and timing scheduling. Not just based on fixed timing scheduling of start execution time, but also based on dependent scheduling of dependency relationships in the DAG graph. The hybrid scheduling method simultaneously considers the dependence and the timing of the operation, so that the operation scheduling is more orderly, unnecessary operation and meaningless calculation are saved, time, calculation resources and transmission resources are saved, and the delay of the operation completion time caused by the unsmooth communication or delay among systems and the calculation error caused by untimely update of information can be prevented.
When a certain job fails, the job and the downstream sub-jobs need to be rerun, but the downstream tasks of the original DAG scheduling process may not be completed yet, so that a plurality of instances exist in the scheduler for the downstream nodes. Logically, when a user reruns a certain subtask and a downstream task each time, the scheduling is equivalent to one-time scheduling of a sub DAG layer, and the sub DAG layer takes the node as a sub-layer of a root node.
As shown in fig. 7, fig. 7- (a) is a DAG layer (which may be referred to as a base DAG layer) of the normal scheduling, fig. 7- (b) is a sub DAG layer of the rerun sub task node C, and fig. 7- (C) is a sub DAG layer of the rerun sub task node E. The key difference between the base DAG layer and the sub DAG layer is that the parent task node of each task node is in the same layer, while the parent task node of the latter is incomplete in the new DAG layer, and some parent task nodes exist in other DAG layers. For example, when the child node C is re-run, the parent node A of node B is not in the sub-hierarchy graph 7- (B), and only node C is in the new DAG graph. When the child node E is rerun, the parent node B of the node G exists in the base DAG layer and the layers of the rerun child node C, and the parent nodes which are not in the current layer are collectively called as external parent nodes in the application. In the scheduling process, an external father task node needs to send a message to a task node of a current layer to inform the task node of the current layer of the running state of the external father task node.
Fig. 8 illustrates a method for performing dependent scheduling using a multi-layered DAG graph when a child node is re-run according to an embodiment of the present invention.
In S1045, if the sub-job fails to be executed, a sub-DAG layer is created with the sub-job as a root node, so as to re-execute the sub-job and the downstream job of the sub-job in the sub-DAG layer.
In S1046, when the sub-job is successfully re-executed, notifying the downstream job thereof, and when the node of the sub-job is an external parent node of another layer, maintaining the completion state of the node of the sub-job as the external parent node of the other layer in the other layer through a distributed coordination service mechanism (e.g., zookeeper).
In S1047, when the downstream job node is executed, querying a completion status of an external parent node of the downstream job node through a distributed coordination service mechanism, and adding the downstream job node into the distributed queue if the downstream job node does not have an external parent node and a parent dependent job node that are not successfully executed and reaches a start execution time of the downstream job node. If the downstream job node does not have an external parent node and a parent dependent job node which are not successfully executed but the predetermined start execution time of the downstream job node has not yet arrived, the downstream job node may be added to a time queue.
Referring to fig. 7, in the process of scheduling the sub-node, it is necessary to distinguish scheduling of different layers, and message communication is also required between multiple layers. Each normal schedule or rerun may be assigned a schedule ID (schedule ID), i.e., < schedule ID, jobId > to uniquely identify a schedule for a job. Therefore, for the task node F, three watchers, namely < schedule id-All, F >, < schedule id-C, F >, < schedule id-E, F > may exist in the scheduler at the same time, and represent the jobs in the three layers of the normal scheduling, the re-running sub-node C and the re-running sub-node E respectively.
When a child task is rerun, the parent node of some nodes in the subgraph is an external parent node, and the external parent node does not need to be rerun in the graph layer, but whether the nodes are scheduled or not needs to be judged according to the state of the external parent node. For example, when the child node C of fig. 7- (B) is re-run, the node B needs to decide whether to start scheduling itself according to the state of the external parent node a. The following takes the rerun child node C as an example to analyze how the external parent node notifies the nodes in the sub-hierarchy when the rerun child node is restarted. For node B, when its external parent node a has completed, the state of parent node a can be updated directly; when the father node a is in operation, the listeners from the external father node a to the node B can be established according to a normal scheduling mechanism, but at this time, the node a may just complete and All listeners have already been triggered to complete, so the newly established listeners from < schedule id-All, a > to < schedule id-C, B > may be ignored. Therefore, in some embodiments of the present application, when a child node is re-run, a Listener is no longer established for an external parent node, but a task node state modification is implemented through a distributed coordination service mechanism (e.g., zookeeper), so as to ensure that an update operation on the external parent node state is an "atomicity" operation as well known in the art, thereby ensuring indivisible and global consistency of the update operation. And maintaining the completion state of the parent node of each node on different layers and the number of the completed parent nodes on the distributed coordination service mechanism. When the parent node A of the node B in the layer schedule-All is finished, the parent node state information of the node B in the layer schedule-C is also updated when the parent node state of the node B in the layer schedule-All is updated.
FIG. 9 illustrates a diagram of a multi-level DAG graph scheduling to illustrate an update mechanism for parent node states, according to an embodiment of the invention. In fig. 9, the node G belongs to three layers G1, G2, and G3 simultaneously, where the sub-layer G1= { B, E, F, G }, G2= { E, F, G }, and G3= { B, E, G }. G1 is a basic graph layer, and G2 and G3 belong to sub graph layers of the re-running sub nodes. For the child layer G1, the node G establishes a listener of B- > G, E- > G, F- > G. When any node in B, E, F is finished, a message is sent to G, G modifies the state of a father node after receiving the message, and when all father nodes of the G are finished successfully, the G is scheduled; for the subgraph G2, the node G only establishes a listener of E- > G, F- > G, and the state of the external father node in the layer G2 is modified through a distributed coordination service mechanism when the external father node B is completed. When a node is finished, a listener informs a downstream node in the graph layer, and when the node is an external parent node of other graph layers, the state of the parent node in other graph layers is atomically modified through a distributed coordination service mechanism, but the node in other graph layers is not informed. For example, in fig. 9, node F in the G2 layer is complete, the state of marking parent node F in the G2 layer is complete, and F is an external node of layer 3, so that the G3 layer also marks parent node F of node G as complete. Meanwhile, F is an internal node of the G1 layer, and thus the G1 layer is not processed.
Traditional DAG-based scheduling methods only consider scheduling of single-layer DAG graphs. For each re-run of a job and downstream jobs, a new DAG subgraph schedule is generated. According to the multi-layer scheduling method, the integrated scheduling of the DAG layers can be simultaneously supported, the execution completion state of the father node is atomically modified through the distributed coordination service mechanism, and faults caused by unsmooth information transmission or untimely updating when the DAG layers are integrally scheduled can be avoided.
When distributing tasks to multiple task submitter nodes (nodes), it is beneficial to ensure load balancing between the nodes. Simply distributing jobs to nodes may result in uneven load across multiple nodes and no dynamic addition and deletion of nodes. The embodiment of the application provides a consistent hash algorithm, which can ensure the load balance of each Node at the bottom layer and support the dynamic addition and deletion of the nodes.
Generally, when a job is distributed, a Node scheduler does not directly send the job to a Node for job submission, but caches a job list to be distributed of each Node at a Master control (Master) end, and then determines whether to issue the job to the Node or not according to resource information in resource management. In a real production scenario for big data, there may be thousands of jobs in each DAG sub-graph, and the Node scheduler needs to distribute these jobs to a limited number of Node nodes. The traditional Hash scheduling or polling scheduling can not guarantee the load balance on each Node, and does not support the dynamic addition or deletion of nodes. For example, in the case of N Node nodes, if a job is distributed to different nodes according to the Hash method described below, it is likely that the load of each Node is unbalanced because the Hash depends excessively on the values of schedule id and JobId.
hash (ScheduleId + JobId)% N (formula 1)
If a Node-m crashes for a physical reason, all jobs mapped to the machine will fail, and the number of nodes is changed to N-1 and the mapping formula is changed to hash (schedule id + JobId)% (N-1), which results in all job caches failing. This problem can also arise if a machine is added to operate a new Node.
Therefore, the implementation scheme of the application provides that the consistent Hash algorithm is adopted to distribute the operation, so that not only can the load balance of each Node be ensured, but also when the Node nodes are deleted or added, only the mapping routes of a few operations are changed, and other operations are not influenced. Fig. 10 shows an example according to this algorithm. The figure shows that there are three Node nodes and there are 4 jobs to be distributed. Three Node unique identifiers (such as Mac addresses) are subjected to Hash mapping to a 32-bit Hash value, namely, a digital space of 0 to (2 ^ 32) -1 (bit values which can provide enough space, such as 64 bits or more, can also be used). These numbers are concatenated end-to-end to form a closed ring (the construction of the ring can be implemented using a suitable data structure), and the Hash value of the node's identifier is marked onto the ring, as shown by the gray nodes in FIG. 10. The schedule id and JoId of the 4 jobs are then mapped to a 32-bit Hash value and added to the ring. For each job, the nearest Node is found in a clockwise direction (or a counterclockwise direction), and the job is distributed to the Node. For example, in the following figure, job A is distributed to Node1 and jobs C and D are distributed to Node3. When a Node is newly added, the new Node can receive task allocation only by mapping the identifier of the new Node to the ring. If a node is deleted, the node is deleted from the ring, and the assigned task skips the node and is assigned to the next closest node in the given direction instead. .
FIG. 11 schematically illustrates a system upon which embodiments of the present application may operate. The system shown mainly comprises three parts: a user layer, a scheduling layer and a computing layer.
1. User layer
The scheme supports multi-user (user, also called tenant) job scheduling, each tenant can submit a job and a parent dependent job to a scheduling layer through, for example, a Restful API, and can also query information such as the running state, the starting time, the ending time, a log and the like of the job.
2. Scheduling layer
The scheduling layer accepts the jobs submitted by the users and the job relations to construct a DAG graph and is responsible for scheduling the jobs. The system mainly comprises a user manager, a dependent operation manager, a timing operation manager, an operation state monitor, a resource manager and a Node scheduler.
a) User manager
And computing and storage space is distributed for each user, so that the operation of each user is not influenced mutually, namely, the user is isolated.
b) Dependent job manager
For checking whether the upstream node of the job is finished. If the upstream dependencies of the job are all completed and the job is not in the timed job manager, the job is appended to a queue to be scheduled (e.g., a distributed scheduling queue) for scheduling.
c) Timing operation manager
The job is stored with a start execution time constraint. When a certain job reaches the starting execution time and all the upstream dependencies are executed, the job is added to the queue to be scheduled to start the scheduling.
d) Operation state monitor
The execution state of the issued job is monitored through a distributed coordination service mechanism (e.g., zookeeper). When the execution of the job is completed, the downstream job is informed that the parent job is completed, and then the downstream job determines whether to start scheduling according to the completion condition of the parent job and whether the execution start time is reached.
e) Resource manager
And the system is responsible for resource management of lower nodes and deletion and addition of nodes.
f) Node scheduler
And taking out the operation to be distributed from the queue to be dispatched, and sending the operation to the execution Node by adopting a consistent Hash algorithm. And the Node submits the operation to the computing platforms such as Hadoop, spark, giraph and the like at the bottom layer.
3. Computing layer
The system consists of distributed clusters of Hadoop, spark, giraph and the like, is responsible for executing the operation, and provides interfaces for inquiring the operation state, stopping the operation, inquiring the operation log and the like for the outside.
Fig. 12 exemplarily shows a flow of job scheduling according to an embodiment of the present application. In fig. 12, the left dashed box includes timing schedule management; the right dashed box includes dependent schedule management. The two will communicate with each other during the scheduling process to ensure that the scheduling is started only when the parent dependency of the job is completed and the start constraint time is reached. The process of FIG. 12 includes the following steps 1-11:
1. a DAG graph is constructed. For an incoming task, the scheduler first checks whether the task is set with a start time constraint. If so, adding the time queue into the left timing scheduling manager, otherwise, managing by the right dependent scheduling manager, and adding the time queue into the distributed queue to be scheduled according to the situation. The timing scheduler then performs steps 2-3 periodically and steps 4-11 are performed depending on the scheduler period.
2. The timed schedule manager cycle on the left checks whether there is a job in the time queue to the start time. If yes, taking out the job from the head of the queue, and executing the step 3; otherwise, after waiting for a certain interval time, the time queue is detected.
3. It is checked whether the parent dependent job of the job is all completed. If the completion is finished, directly adding the data into the distributed queue; otherwise, no processing is carried out, because the right-side dependent scheduling manager can automatically add the job into the distributed queue after the dependence is completed.
4. The dependent schedule manager on the right periodically checks whether there is a job in the distributed queue. If yes, taking out the operation, and executing the step 5; otherwise, after waiting for a certain interval time, the distributed queue is checked.
5. And for each job, distributing the job to the specified Node by adopting a consistent Hash scheduling algorithm.
And 6, the node acquires the codes, the resource information, the parameter values and the like of the jobs from the database according to the job ID, constructs a job submission command and submits the job to the computing cluster.
7. And monitoring the state of the operation, after the operation is completed, the Node informs the completion of the operation of the checker through a message notification mechanism of the Zookeeper, and executes the step 8. When the operation state is failure, the scheduler directly sends a stop scheduling message to all the dependent nodes at the downstream, and the downstream does not operate any more.
8. When the operation is successfully executed, the downstream node is notified that the parent node is completed through the Listener on each edge.
9. And after the downstream node receives the message of the father node, updating the state of the father node.
10. Checking whether all the father nodes of the node are finished, if so, executing the step 11, otherwise, not processing.
11. Checking whether the node is in the time queue, if not, indicating that the father node of the node is finished and reaches the starting constraint time, and adding the node to the tail of the distributed queue; otherwise, no processing is performed (at this time, the parent nodes of the nodes are all completed, but the starting time is not reached, and the processing is performed in step 2-3).
Embodiments of the present application also provide an electronic device, which at least includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the foregoing method.
Embodiments of the present application also provide a computer-readable medium having stored thereon computer-readable instructions, which when executed, may implement the method of embodiments of the present application.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
The system, method and apparatus of the embodiments of the present application can be implemented as pure software (e.g., a software program written in Java and SQL), as pure hardware (e.g., a dedicated ASIC chip or FPGA chip), as desired, or as a system combining software and hardware (e.g., a firmware system storing fixed code or a system with a general-purpose memory and a processor).
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
The foregoing is merely a detailed description of embodiments of the present application, and it should be noted that those skilled in the art can make various modifications and decorations without departing from the principle of the embodiments of the present application, and the modifications and decorations should also be regarded as the protection scope of the embodiments of the present application.

Claims (6)

1. A method for distributing tasks to a plurality of nodes, comprising:
mapping the unique identifiers Hash of the nodes into a digital space to obtain Hash values corresponding to the nodes of the nodes, wherein the digital space is defined as a closed ring which is connected end to end, and the Hash values corresponding to the nodes are marked on the ring;
mapping the identifiers of the tasks to the digital space according to the same Hash mapping method to obtain corresponding Hash values;
and determining a node with a Hash value closest to the Hash value of the task according to a preset rule on the ring, and distributing the task to the node.
2. The method of claim 1, wherein the predetermined rule is a clockwise or counterclockwise direction of the ring.
3. The method of claim 1, further comprising:
and when a new node is added, generating a Hash value of the new node according to the same mapping method, and adding the Hash value to the ring.
4. The method of claim 1, further comprising:
when a node is deleted from the plurality of nodes, the Hash value of the node is deleted from the ring.
5. The method of claim 1, wherein the unique identifier is a Mac address.
6. A computer readable medium having computer readable instructions stored thereon which when executed perform the method of any of claims 1 to 5.
CN202210917990.XA 2022-08-01 2022-08-01 Method for scheduling jobs Pending CN115269152A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210917990.XA CN115269152A (en) 2022-08-01 2022-08-01 Method for scheduling jobs

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210917990.XA CN115269152A (en) 2022-08-01 2022-08-01 Method for scheduling jobs

Publications (1)

Publication Number Publication Date
CN115269152A true CN115269152A (en) 2022-11-01

Family

ID=83746852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210917990.XA Pending CN115269152A (en) 2022-08-01 2022-08-01 Method for scheduling jobs

Country Status (1)

Country Link
CN (1) CN115269152A (en)

Similar Documents

Publication Publication Date Title
CN106919445B (en) Method and device for scheduling containers in cluster in parallel
WO2022105138A1 (en) Decentralized task scheduling method, apparatus, device, and medium
US20160371122A1 (en) File processing workflow management
WO2014062637A2 (en) Systems and methods for fault tolerant, adaptive execution of arbitrary queries at low latency
JP2014123365A (en) DEVICE AND METHOD FOR OPTIMIZATION OF DATA PROCESSING IN MapReduce FRAMEWORK
CN113382077B (en) Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium
CN107479984B (en) Distributed spatial data processing system based on message
CN112667383B (en) Task execution and scheduling method, system, device, computing equipment and medium
CN111831424B (en) Task processing method, system and device
JP2010231502A (en) Job processing method, computer-readable recording medium having stored job processing program, and job processing system
CN111258726B (en) Task scheduling method and device
US11816511B1 (en) Virtual partitioning of a shared message bus
CN111913793A (en) Distributed task scheduling method, device, node equipment and system
CN114816709A (en) Task scheduling method, device, server and readable storage medium
CN114237891A (en) Resource scheduling method and device, electronic equipment and storage medium
CN110365809B (en) Distributed server address configuration system and method
US11726758B2 (en) Efficient scaling of a container-based application in a distributed computing system
US11755297B2 (en) Compiling monoglot function compositions into a single entity
CN115269152A (en) Method for scheduling jobs
CN115269150A (en) Method for scheduling jobs
CN115269151A (en) Method for scheduling jobs
US11321120B2 (en) Data backup method, electronic device and computer program product
CN115373886A (en) Service group container shutdown method, device, computer equipment and storage medium
CN114661432A (en) Task scheduling method, device, equipment and storage medium
CN113703930A (en) Task scheduling method, device and system and computer readable 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