WO2017167070A1 - Method for copying clustered data, and method and device for determining priority - Google Patents

Method for copying clustered data, and method and device for determining priority Download PDF

Info

Publication number
WO2017167070A1
WO2017167070A1 PCT/CN2017/077500 CN2017077500W WO2017167070A1 WO 2017167070 A1 WO2017167070 A1 WO 2017167070A1 CN 2017077500 W CN2017077500 W CN 2017077500W WO 2017167070 A1 WO2017167070 A1 WO 2017167070A1
Authority
WO
WIPO (PCT)
Prior art keywords
replication
task
priority
copy
data
Prior art date
Application number
PCT/CN2017/077500
Other languages
French (fr)
Chinese (zh)
Inventor
史英杰
何乐
黄俨
张�杰
张辰
Original Assignee
阿里巴巴集团控股有限公司
史英杰
何乐
黄俨
张�杰
张辰
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 阿里巴巴集团控股有限公司, 史英杰, 何乐, 黄俨, 张�杰, 张辰 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2017167070A1 publication Critical patent/WO2017167070A1/en

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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications

Definitions

  • the present application relates to communication technologies, and in particular, to a cluster data replication method, a priority determination method, and an apparatus.
  • Clustering greatly increases the storage limits and processing limits of a single unit.
  • the data generated by many companies has reached the PB or even EB level, and the amount of new data added every day is also growing rapidly.
  • the data exceeds the storage of a single cluster, or a single cluster cannot meet the needs of data processing, it needs to be split and stored in multiple clusters according to business units.
  • the data of the service A is stored in the first cluster. If the service B in the first cluster needs to access the data of the service A, the data can be directly read from the first cluster. If the service C located in the second cluster needs to access the data of the service A, the data needs to be read out of the cluster. If multiple services in the second cluster need to access the data of service A, it is necessary to read the same data across the cluster multiple times, which wastes bandwidth resources between the clusters. In particular, as the number of services increases, the number of services that read the same data across different clusters will increase, resulting in more waste of bandwidth resources.
  • the common method in the industry is to keep the data of service A in another cluster, so that the services in other clusters can directly read data in the cluster when the data of service A is needed.
  • the prior art generally adopts an offline replication mode, that is, stops database operations of each cluster, and copies data all from one cluster to another at a time, which requires a large amount of bandwidth resources.
  • cross-domain bandwidth is limited and valuable, and as the number of services grows, so does the need to replicate data. It will gradually increase, so under the condition of limited cross-domain bandwidth, the offline replication method obviously cannot meet the demand, so a new data replication method is urgently needed.
  • the present invention provides a cluster data replication method and device for reasonably scheduling data to be replicated under the condition of limited cross-domain bandwidth, thereby realizing rapid data replication.
  • a cluster data replication method including:
  • Each of the copy tasks is executed according to the priority of each of the copy tasks.
  • a cluster data replication apparatus including:
  • a calculation module configured to calculate a priority of each of the at least one replication task
  • an execution module configured to execute each of the replication tasks according to a priority of each of the replication tasks.
  • a method for determining a priority including:
  • the source corresponding to the replication task Service refers to the service that generates the data that the copy task needs to copy;
  • the priority of the copy task is calculated according to the at least one factor.
  • a priority determining apparatus including:
  • An information obtaining module configured to acquire a triggering manner of a replication task that needs to replicate data across the cluster, a generation time of the data to be copied by the replication task, and an importance degree of the source service corresponding to the replication task, where
  • the source service corresponding to the replication task refers to a service that generates data that needs to be copied by the replication task;
  • a priority calculation module configured to calculate a priority of the replication task according to the at least one factor.
  • the priority of each replication task is calculated, and then each replication task is executed according to the priority of each replication task. It can be seen that, under the condition that the cross-domain bandwidth is limited, the replication task is scheduled according to the priority of the replication task, and the replication task with higher priority is preferentially scheduled, and the replication task can be reasonably scheduled, which is beneficial to realizing data. Quick copy.
  • FIG. 1 is a schematic structural diagram of a cluster system according to an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a method for replicating a cluster data according to another embodiment of the present application
  • FIG. 3 is a schematic structural diagram of a replication system according to another embodiment of the present disclosure.
  • FIG. 4 is a schematic flowchart of packet processing of a replication task according to another embodiment of the present disclosure.
  • FIG. 5 is a schematic structural diagram of a cluster data replication apparatus according to another embodiment of the present disclosure.
  • FIG. 6 is a schematic flowchart of a priority determining method according to another embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of a priority determining apparatus according to another embodiment of the present disclosure.
  • FIG. 1 is a schematic structural diagram of a cluster system according to Embodiment 1 of the present application. As shown in Figure 1, the cluster system only symbolically indicates three clusters, namely cluster A, cluster B, and cluster C. In fact, the cluster system can contain any number of clusters.
  • the present application provides a solution, the main idea of which is to calculate the priority of the replication task after determining the replication task that needs to replicate data across the cluster, and then perform the replication task according to the priority of the replication task.
  • This application is based on the limited cross-domain bandwidth.
  • the replication task is scheduled according to the priority of the replication task, and the replication task with the higher priority is preferentially scheduled, and the replication task can be scheduled reasonably, which is beneficial for realizing rapid data replication.
  • FIG. 2 is a schematic flowchart of a method for replicating a cluster data according to another embodiment of the present disclosure. As shown in Figure 2, the method includes:
  • the embodiment provides a cluster data replication method, which can be executed by a cluster data replication device (hereinafter referred to as a replication device) to properly schedule replication tasks, implement data replication across the cluster, and improve data replication efficiency.
  • a cluster data replication device hereinafter referred to as a replication device
  • the replication device may be deployed in a cluster system, for example, a cluster deployed in the cluster system, for example, a cluster for generating data (referred to as a source cluster) or a cluster that needs to replicate data (referred to as a destination cluster).
  • a cluster deployed in the cluster system for example, a cluster for generating data (referred to as a source cluster) or a cluster that needs to replicate data (referred to as a destination cluster).
  • a destination cluster a cluster that is independent of the cluster system but is capable of communicating with the cluster system.
  • the replication device first needs to determine at least one replication task that needs to replicate data across the cluster.
  • a replication task is a task that requires data to be replicated from one cluster to another.
  • the copying device may determine the copying task by using, but not limited to, the following methods:
  • the first method is to poll the data version management server periodically, and when it is found that the version of the data changes, it is determined that there is a need to perform a cross-cluster replication replication task for the data whose version is changed.
  • the first method can also be called a scan trigger method.
  • the version information of each data in the entire cluster system needs to be managed by the data version management server.
  • the copying device may start a thread to periodically poll the data version management server, and when it is found that the version of the data changes, it is determined that there is a need to perform a cross-cluster copying task for the data whose version has changed.
  • the second method is: the obtaining, by the control server, the replication task that is sent according to the received replication task notification message, and the replication task notification message is that the first service actively reports to the control server when the new version of the data is generated.
  • the second way can also be called the event trigger mode.
  • FIG. 3 a system architecture for implementing the method of the present embodiment is shown in FIG. 3.
  • the system includes a control server 31 and at least one managed server 32.
  • the copying device is implemented in the controlled server 32, but is not limited thereto.
  • the system architecture can run on a cluster in the cluster system, for example, it can be a source cluster or a destination cluster, or can also run outside the cluster system.
  • control server 31 is responsible for the distribution management of the replication task in the cluster, monitoring the state of the controlled server 32 and the replication device running thereon, and further, the control server 31 is also responsible for communicating with the outside world, for example, receiving a replication task notification message, querying System status, etc.
  • the control server 31 and the controlled server 32 communicate by means of a heartbeat message, and the controlled server 32 reports the running status to the control server 31, including the CPU, the memory usage, and the operating state of the copying device.
  • the control server 31 sends the information of the copying device that needs to be started or stopped to the managed server 32. For example, the operation and maintenance personnel send a message to the control server 31 to start or stop a copy device through the management interface.
  • control server 31 When the control server 31 receives a message to start or stop a copy device, a controlled server 32 is randomly selected, and a message for starting or stopping a copy device is added to the heartbeat message of the controlled server 32, and is controlled. After the server 32 receives the heartbeat message, it will start or stop the corresponding copying device to execute or end the execution of the copying task.
  • the control server 31 may adopt a message subscription mode, that is, the service that generates data in the cluster (referred to as the first service), when generating the new version data, actively sends a replication task notification message to the control server to notify the control server 31 that there is a replication task.
  • the replication task notification message carries information of data that needs to be replicated across the cluster, information of the source cluster where the data is located, information of the destination cluster that needs to copy the data, and the like.
  • the control server 31 issues a copy task to the copying device according to the copy task notification message.
  • the third mode is: receiving a replication task sent by the control server when receiving the replication task notification message, where the replication task notification message is a service requiring data (referred to as a second service), determining that the data is in the cluster where the second service is located.
  • the version is reported to the control server when the version is inconsistent with the version in the source cluster where the data resides.
  • the third way can also be called an on-demand trigger.
  • the second service determines the required service. Whether the version of the data in the cluster where the second service is located (for example, cluster C) is consistent with the version in the source cluster (for example, cluster A) where the data is located. For example, the second service can query the data version management server to obtain the version in the source cluster. Comparing the version in the cluster in which the second service is located with the version in the source cluster that is queried. If the result of the determination is inconsistent, the second service sends a copy task notification message to the control server 31, and the control server 31 performs the copy task. The notification message sends a copy task to the copying device.
  • the replication device can determine the replication tasks that need to replicate data across the cluster. As the number of services continues to increase, the number of replication tasks that need to replicate data across clusters is increasing. However, the bandwidth between clusters is limited. This requires proper scheduling of replication tasks to complete replication tasks more efficiently and quickly. To solve this problem, the copying device calculates the priority of each copy task, and performs scheduling execution on each copy task according to the priority of each copy task. This ensures that high-priority replication tasks are processed first, and that replication tasks can be scheduled reasonably, which facilitates fast data replication.
  • step 202 that is, calculating an implementation priority of each replication task, includes:
  • the priority of each replication task is calculated according to at least one of the triggering manner of each replication task, the generation time of the data to be copied by each replication task, and the importance of the source service corresponding to each replication task.
  • the triggering manner of the foregoing replication task mainly refers to the foregoing three methods for determining a replication task, such as a scan trigger mode, an event trigger mode, and a demand trigger mode.
  • Replication tasks with different trigger modes have different priorities. For example, the priority of the replication task triggered by the demand trigger mode is the highest, the priority of the replication task triggered by the event trigger mode is the second, and the priority of the replication task triggered by the scan trigger mode is the lowest, but is not limited thereto.
  • the source service corresponding to the above replication task refers to the service that generates data that needs to be copied by the replication task. For example, if the service a in the cluster A generates data, and the data needs to be copied from the cluster A to the clusters B and C, the data to be copied by the replication task is the data generated by the service a, and the service a is the corresponding to the replication task.
  • Source business In general, the importance of different services is different. The higher the importance of the data generated by the service, the higher the importance of the data. Therefore, the priority of the replication task for copying the data generated by the more important business is higher. The higher.
  • the generation time of the data to be copied by the above replication task is mainly used to indicate the freshness of the data that the replication task needs to copy. Generally speaking, the later the data is generated, the newer the data is, the copying is used to copy the data with higher freshness. The priority of the task is higher.
  • one of the above three factors may be used to determine the priority of each replication task.
  • the priority of each replication task is determined only according to the trigger mode of each replication task.
  • the priority of each replication task is determined only according to the importance of the source service corresponding to each replication task.
  • the priority of each copy task is determined based only on the generation time of the data to be copied for each copy task.
  • the priority of each replication task may be determined in combination with any two of the above three factors. Specifically, a priority value can be calculated according to each factor, and then the weighted average of the two priority values is obtained to obtain the final priority of the replication task. Among them, different weights can be configured in advance for different factors.
  • the importance of the source service corresponding to each replication task and the triggering mode of each replication task may be combined, and it is determined that the priority of the replication task is P1 according to the importance of the source service corresponding to the replication task, according to the replication task.
  • the triggering mode determines that the priority of the replication task is P2.
  • the weights determined in advance for the importance and trigger mode of the source service are w1 and w2, respectively.
  • the final priority of the replication task is w1*P1+w2*P2.
  • the triggering manner of the replication task and the generation time of the data to be copied by the replication task may be combined, and the importance of the source service corresponding to the replication task and the generation time of the data to be copied by the replication task may be combined, and the specific calculation manner is the same as above. Let me repeat.
  • the priority of each replication task may be calculated by combining the triggering manner of each replication task, the generation time of the data to be copied by each replication task, and the importance of the source service corresponding to each replication task.
  • the replication device may determine, according to the triggering manner of each replication task, the first priority value of each replication task, and determine the second priority value of each replication task according to the importance of the source service corresponding to each replication task. Determining, according to the generation time of the data to be copied by each replication task, determining the third priority value of each replication task; according to the first priority value, the second priority value, and the third priority value of each replication task, Generate the priority of each replication task.
  • the copying device may pre-set the weights for the importance of the source service corresponding to the replication task, the triggering manner of the replication task, and the generation time of the data to be copied by the replication task, for example, w1, w2, and w3, respectively.
  • the copying device may also stitch the first priority value, the second priority value, and the third priority value of each copy task in order from high to low.
  • the priority of each replication task may also stitch the first priority value, the second priority value, and the third priority value of each copy task in order from high to low. The priority of each replication task.
  • the priority of the triggering mode is set to [0, 2], where the priority of the triggering mode is 0, and the priority of the event triggering mode is 1, and the scanning trigger mode corresponds to The priority value is 2.
  • the first priority of the replication task is determined to be 0.
  • the triggering mode of the replication task is the event triggering mode
  • the first task of the replication task may be determined.
  • the priority of the replication task is 1. If the triggering mode of the replication task is the scan trigger mode, you can determine that the first priority of the replication task is 2.
  • the first priority value is recorded as P t .
  • the priority value of the priority of the source service is defined as [0, 9], which can be set according to the importance of the source service. Generally, the importance of the source service is higher. The lower the priority value.
  • the second priority of the replication task is any value from 0-9.
  • the first priority value is recorded as P p .
  • the priority value corresponding to the generation time of the data to be copied is defined as [0, 9].
  • the copying device may determine, according to formula (1), a third priority value of each copy task.
  • t represents the generation time of the data to be copied by each copy task
  • T represents the life cycle of the data to be copied by each copy task, and 0 ⁇ t ⁇ T
  • P d represents the third of each copy task Priority value. It is worth noting that the life cycle of data that needs to be replicated by different replication tasks may be the same or different. The length of the life cycle can generally be determined by factors such as business needs and importance.
  • the above priority value may be based on the composition, three digital copying apparatus, in which one hundred, ten, bit followed by P t, the priority P p, P d, the number three is the replication tasks, The value range is [000, 299]. The smaller the three digits, the higher the priority of the corresponding replication task.
  • the replication device can apply for bandwidth resources for each replication task according to the priority of each replication task, and then based on the applied bandwidth resources. Perform each copy task.
  • high-priority replication tasks will apply for bandwidth resources preferentially, so they will be executed preferentially, which is beneficial to improve the replication efficiency of cross-domain data.
  • the replication device can maintain a multi-priority queue, for example, 300 queues, and then add the replication task to the corresponding priority queue according to the priority of the replication task.
  • the copying device polls each priority queue in order of priority from high to low, and requests bandwidth resources for the polled copy task.
  • the control server 31 is also responsible for the allocation of bandwidth for the entire replication system.
  • the copying device may send a bandwidth request request to the control server, and the control server 31 sends the number of bandwidths allocated to the copy task and the priority of the copy task for requesting the bandwidth resource to the copying device through the heartbeat message.
  • the copying device receives the heartbeat message sent by the control server 31, and obtains the number of bandwidths requested.
  • control server 31 allocates according to the priority level. For the high-priority replication task, not only the quota within the rated bandwidth can be obtained, but when the bandwidth resource is allocated, the control server 31 also satisfies the application of the high-priority replication task by overselling.
  • the copying device can continuously poll the priority queue, pack a plurality of copy tasks into one copy job, and apply for bandwidth resources to the control server 31 in units of copy jobs.
  • performing multiple replication tasks in one replication job can effectively improve efficiency; however, if there are too many replication tasks included in one replication job, the replication job execution time will be too long to meet the replication task with high real-time requirements. demand.
  • you need to limit the size of each copy job For example, you can limit the total number of files that a copy job contains, or the total file size, or you can limit the total number of files and the total file size that a copy job contains.
  • the condition for limiting the size of a copy job is called a job submission limit.
  • Job submission limit The system may include at least one of the following: an upper limit of the total number of files, and an upper limit of the total size of the file.
  • the value of the upper limit of the total number of files and the upper limit of the total size of the file may be set according to the application requirements. The specific value is not limited in this embodiment.
  • the process of applying for the bandwidth resource by the copying device according to the foregoing job submission restriction includes: packaging each copy task according to a priority of each copy task and a preset job submission limit to form at least one copy job; and then, according to each The priority of the replication task included in the replication job is determined, and the priority of each replication job is determined; and the bandwidth resource is requested for the replication task included in each replication job according to the priority of each replication job.
  • the copying device may package the copy task in the following manner:
  • the copying device sequentially obtains the copy task as the current copy task according to the order of priority, and determines whether the current copy task reaches the job submission limit, for example, whether the total number of files included in the current copy task reaches the total number of files. Value, and determine whether the total size of the file included in the current replication task reaches the upper limit of the total file size. If there is a yes in the judgment result, it is determined that the current replication task reaches the job submission limit, which indicates that the current replication task is too large. Or too many files, do not need to be packaged with other replication tasks, you can directly use the current replication task as a replication job; if the judgment result is no, this indicates that the current replication task meets the packaging requirements, and then continue to obtain other non-reaching job submission restrictions.
  • the replication task until the sum of multiple replication tasks that do not meet the job submission limit reaches the job submission limit, packages multiple replication tasks that do not meet the job submission limit to generate a replication job.
  • the process of packaging the replication task by the replication device is as shown in FIG. 4, and includes the following steps:
  • step 401 determine whether the current priority queue to read the replication task, and if so, to read the replication task, step 402 is performed; if not, that is, the replication task is not read, step 408 is performed;
  • step 402 determining whether the read copy task reaches the job submission limit, if the determination result is yes, step 403 is performed; if the determination result is no, step 404 is performed;
  • the judgment result of the at least one judgment operation is no, it is determined that the read copy task does not reach the job submission limit; if the judgment result of the at least one judgment operation is yes, it is determined that the read copy task reaches the job submission limit;
  • the read copy task is placed in the current priority queue, and the read pointer is incremented by 1, returning to step 401;
  • the read replication task is added to the current job queue, and step 405 is performed;
  • step 405 determining whether the sum of the replication tasks in the current job queue reaches the job submission limit, if the determination result is yes, step 406; if the determination result is no, step 407;
  • the judgment result of the at least one judgment operation is no, it is determined that the sum of the replication tasks in the current job queue does not reach the job submission limit; if the judgment result of the at least one judgment operation is yes, it is determined that the sum of the replication tasks in the current job queue reaches Job submission limit;
  • the read pointer is incremented by 1, returning to step 401;
  • step 408. Determine whether the current job queue is empty. If the determination result is no, go to step 409. If the judgment result is yes, go to step 411.
  • step 409 determining whether the waiting time exceeds the preset number of upper limit, if the determination is no, proceed to step 410; if the determination is yes, then step 411;
  • step 410 Wait for the number of times to wait for +1, and wait for 300 ms, and return to step 407.
  • the present embodiment can improve the execution efficiency and meet the timeliness requirement of the replication task by packaging a plurality of replication tasks into one replication job.
  • FIG. 5 is a schematic structural diagram of a cluster data replication apparatus according to another embodiment of the present disclosure. As shown in FIG. 5, the apparatus includes a determination module 51, a calculation module 52, and an execution module 53.
  • the determining module 51 is configured to determine at least one copy task that needs to replicate data across the cluster.
  • the calculating module 52 is configured to calculate a priority of each copy task in the at least one copy task.
  • the executing module 53 is configured to execute each copy task according to the priority of each copy task.
  • the determining module 51 is specifically configured to perform at least one of the following operations:
  • the replication task notification message is reported to the control server when the first service generates the new version data, or is the version of the second service that needs the data in determining the version of the data in the cluster where the second service is located and the source cluster in which the data is located. Reported to the control server when it is inconsistent.
  • calculation module 52 is specifically configured to:
  • the source service corresponding to the replication task refers to the service that generates data that needs to be copied by the replication task.
  • the calculating module 52 is further specifically configured to:
  • the priority of each replication task is generated according to the first priority value, the second priority value, and the third priority value of each replication task.
  • the calculation module 52 determines the third priority value of each replication task according to the generation time of the data to be copied according to each replication task
  • the calculation module 52 is specifically configured to: determine the third priority of each replication task according to formula (1). Level value.
  • the description of the formula (1) is specifically referred to the foregoing embodiment, and details are not described herein again.
  • calculation module 52 when the calculation module 52 generates the priority of each replication task according to the first priority value, the second priority value, and the third priority value of each replication task, the calculation module 52 is specifically configured to:
  • the first priority value, the second priority value, and the third priority value of each replication task are spliced together in order from the high to the low to generate the priority of each replication task.
  • the executing module 53 is specifically configured to:
  • Each copy task is executed based on the requested bandwidth resource.
  • the execution module 53 when the execution module 53 requests bandwidth resources for each replication task according to the priority of each replication task, the execution module 53 is specifically configured to:
  • Each copy task is packaged according to a priority of each copy task and a preset job submission limit to form at least one copy job;
  • the execution module 53 performs a packaging process on each of the copy tasks according to the priority of each copy task and the preset job submission limit to form at least one copy job, specifically for:
  • the replication task is sequentially acquired as the current replication task according to the order of priority from high to low;
  • the current replication task is directly treated as a replication job.
  • the job submission restriction includes at least one of the following:
  • the total number of files is the upper limit
  • the cluster data replication apparatus calculates the priority of each replication task after determining the replication task that needs to replicate data across the cluster, and then performs each replication task according to the priority of each replication task. It can be seen that, under the condition that the cross-domain bandwidth is limited, the replication task is scheduled according to the priority of the replication task, and the replication task with higher priority is preferentially scheduled, and the replication task can be reasonably scheduled, which is beneficial to realizing data. Quick copy.
  • the present application also provides a priority determination method for cross-cluster replication tasks to determine the priority of cross-cluster replication tasks.
  • the process of the priority determining method is as shown in FIG. 6, and includes:
  • the replication task requires replication of the data for the business.
  • the triggering manner of the foregoing replication task mainly refers to the foregoing three methods for determining a replication task, such as a scan trigger mode, an event trigger mode, and a demand trigger mode.
  • Replication tasks with different trigger modes have different priorities. For example, the priority of the replication task triggered by the demand trigger mode is the highest, the priority of the replication task triggered by the event trigger mode is the second, and the priority of the replication task triggered by the scan trigger mode is the lowest, but is not limited thereto.
  • the source service corresponding to the above replication task refers to the service that generates data that needs to be copied by the replication task. For example, if the service a in the cluster A generates data, and the data needs to be copied from the cluster A to the clusters B and C, the data to be copied by the replication task is the data generated by the service a, and the service a is the corresponding to the replication task.
  • Source business In general, the importance of different services is different. The higher the importance of the data generated by the service, the higher the importance of the data. Therefore, the priority of the replication task for copying the data generated by the more important business is higher. The higher.
  • the generation time of the data to be copied by the above replication task is mainly used to indicate the freshness of the data that the replication task needs to copy. Generally speaking, the later the data is generated, the newer the data is, the copying is used to copy the data with higher freshness. The priority of the task is higher.
  • one of the above three factors may be used to determine the priority of each replication task.
  • the priority of each replication task is determined only according to the trigger mode of each replication task.
  • the priority of each replication task is determined only according to the importance of the source service corresponding to each replication task.
  • the priority of each copy task is determined based only on the generation time of the data to be copied for each copy task.
  • any two of the above three factors may be used in combination Determine the priority of each replication task. Specifically, a priority value can be calculated according to each factor, and then the weighted average of the two priority values is obtained to obtain the final priority of the replication task. Among them, different weights can be configured in advance for different factors.
  • the importance of the source service corresponding to each replication task and the triggering mode of each replication task may be combined, and it is determined that the priority of the replication task is P1 according to the importance of the source service corresponding to the replication task, according to the replication task.
  • the triggering mode determines that the priority of the replication task is P2.
  • the weights determined in advance for the importance and trigger mode of the source service are w1 and w2, respectively.
  • the final priority of the replication task is w1*P1+w2*P2.
  • the triggering manner of the replication task and the generation time of the data to be copied by the replication task may be combined, and the importance of the source service corresponding to the replication task and the generation time of the data to be copied by the replication task may be combined, and the specific calculation manner is the same as above. Let me repeat.
  • the priority of the replication task may be calculated by combining the triggering manner of each replication task, the generation time of the data to be copied by each replication task, and the importance of the source service corresponding to each replication task.
  • the copying device may determine the value of the first priority of each of the replication tasks according to the triggering manner of the replication task, and determine the second priority value of the replication task according to the importance of the source service corresponding to the replication task;
  • the time at which the task needs to be copied determines the third priority of the replication task, and generates the priority of the replication task according to the first priority value, the second priority value, and the third priority value of the replication task. level.
  • the copying device may pre-set the weights for the importance of the source service corresponding to the replication task, the triggering manner of the replication task, and the generation time of the data to be copied by the replication task, for example, w1, w2, and w3, respectively.
  • the copying device may also stitch the first priority value, the second priority value, and the third priority value of each replication task in an order from high to low to generate a replication task. priority.
  • the priority of the triggering mode is set to [0, 2], where the priority of the triggering mode is 0, and the priority of the event triggering mode is 1, and the scanning trigger mode corresponds to The priority value is 2.
  • the first priority of the replication task is determined to be 0.
  • the triggering mode of the replication task is the event triggering mode
  • the first task of the replication task may be determined.
  • the priority of the replication task is 1. If the triggering mode of the replication task is the scan trigger mode, you can determine that the first priority of the replication task is 2.
  • the first priority value is recorded as Pt.
  • the priority value of the priority of the source service is defined as [0, 9], which can be set according to the importance of the source service. Generally, the importance of the source service is higher. The lower the priority value.
  • the second priority of the replication task is any value from 0-9.
  • the first priority value is recorded as Pp.
  • the priority value corresponding to the generation time of the data to be copied is defined as [0, 9].
  • the copying device may determine, according to formula (1), a third priority value of each copy task.
  • formula (1) refer to the foregoing description, and details are not described herein again.
  • the copying device may form the above-mentioned priority values into three digits, wherein the hundred digits, the ten digits, and the single digits are Pt, Pp, Pd, and the three digits are the priority of the copying task, and the value thereof is The range is [000, 299], and the smaller the three digits, the higher the priority of the corresponding copy task.
  • the priority of the replication task across the cluster can be calculated, and the conditions for the subsequent replication task processing based on the priority of the replication task (for example, the replication task scheduling process) are provided.
  • FIG. 7 is a schematic structural diagram of a priority determining apparatus according to another embodiment of the present disclosure. As shown in FIG. 7, the apparatus includes an information acquisition module 71 and a priority calculation module 72.
  • the information obtaining module 71 is configured to acquire at least one of a triggering manner of a replication task that needs to replicate data across the cluster, a generation time of the data to be copied by the replication task, and an importance of the source service corresponding to the replication task, where the replication task corresponds
  • the source service refers to the service that generates the data that the replication task needs to replicate.
  • the priority calculation module 72 is configured to calculate a priority of the replication task according to at least one factor acquired by the information acquisition module 71.
  • the triggering manner of the foregoing replication task mainly refers to the foregoing three methods for determining a replication task, such as a scan trigger mode, an event trigger mode, and a demand trigger mode.
  • Replication tasks with different trigger modes have different priorities. For example, the priority of the replication task triggered by the demand trigger mode is the highest, the priority of the replication task triggered by the event trigger mode is the second, and the priority of the replication task triggered by the scan trigger mode is the lowest, but is not limited thereto.
  • the source service corresponding to the above replication task refers to the service that generates data that needs to be copied by the replication task. For example, if the service a in the cluster A generates data, and the data needs to be copied from the cluster A to the clusters B and C, the data to be copied by the replication task is the data generated by the service a, and the service a is the corresponding to the replication task.
  • Source business In general, the importance of different services is different. The higher the importance of the data generated by the service, the higher the importance of the data. Therefore, the priority of the replication task for copying the data generated by the more important business is higher. The higher.
  • the generation time of the data to be copied by the above replication task is mainly used to indicate the freshness of the data that the replication task needs to copy. Generally speaking, the later the data is generated, the newer the data is, the copying is used to copy the data with higher freshness. The priority of the task is higher.
  • the information obtaining module 71 may obtain one of the above three factors, and the priority calculating module 72 determines the priority of the copying task according to the factor acquired by the information acquiring module 71.
  • the priority calculation module 72 determines the priority of the replication task based only on the triggering manner of the replication task.
  • the priority calculation module 72 determines the priority of the replication task based only on the importance of the source service corresponding to the replication task.
  • priority calculation The module 72 determines the priority of the replication task based only on the generation time of the data that the replication task needs to replicate.
  • the information obtaining module 71 may obtain any two of the above three factors, and the priority calculating module 72 determines the priority of each copy task according to two factors acquired by the information acquiring module 71.
  • the priority calculation module 72 can calculate a priority value according to each factor, and then perform weighted averaging on the two priority values to obtain the final priority of the replication task. Among them, different weights can be configured in advance for different factors.
  • the priority calculation module 72 may combine the importance of the source service corresponding to the replication task and the triggering mode of the replication task, and determine that the priority of the replication task is P1 according to the importance of the source service corresponding to the replication task, according to The triggering mode of the replication task determines that the priority of the replication task is P2.
  • the weights determined for the importance and trigger mode of the source service are w1 and w2 respectively.
  • the final priority of the replication task is w1*P1+w2. *P2.
  • the triggering manner of the replication task and the generation time of the data to be copied by the replication task may be combined, and the importance of the source service corresponding to the replication task and the generation time of the data to be copied by the replication task may be combined, and the specific calculation manner is the same as above. Let me repeat.
  • the information acquiring module 71 can obtain the foregoing three factors, and the priority calculating module 72 can simultaneously combine the triggering manner of the replication task, the generation time of the data that the replication task needs to be copied, and the source service corresponding to the replication task. Importance, calculate the priority of the replication task.
  • the priority calculation module 72 may determine the first priority value of the replication task according to the triggering manner of the replication task, and determine the second priority value of the replication task according to the importance of the source service corresponding to the replication task; The generation time of the data to be copied by the replication task, determining the third priority value of the replication task; generating the replication task according to the first priority value, the second priority value, and the third priority value of the replication task priority.
  • the importance of the source service corresponding to the replication task and the touch of the replication task may be pre-replicated
  • the sending time and the generation time of the data to be copied by the copying task are three factors, such as w1, w2, and w3.
  • the priority calculation module 72 may perform weighted averaging on the first priority value, the second priority value, and the third priority value of the replication task according to the weight of the corresponding factor to generate a priority of the replication task. .
  • the priority of the replication task w1 * the first priority value + w2 * the second priority value + w3 * the third priority value.
  • the priority calculation module 72 may also splicing the first priority value, the second priority value, and the third priority value of the replication task in order from high to low to generate a replication. The priority of the task.
  • the priority of the triggering mode is set to [0, 2], where the priority of the triggering mode is 0, and the priority of the event triggering mode is 1, and the scanning trigger mode corresponds to The priority value is 2.
  • the first priority of the replication task is determined to be 0.
  • the triggering mode of the replication task is the event triggering mode
  • the first task of the replication task may be determined.
  • the priority of the replication task is 1. If the triggering mode of the replication task is the scan trigger mode, you can determine that the first priority of the replication task is 2.
  • the first priority value is recorded as Pt.
  • the priority value of the priority of the source service is defined as [0, 9], which can be set according to the importance of the source service. Generally, the importance of the source service is higher. The lower the priority value.
  • the second priority of the replication task is any value from 0-9.
  • the first priority value is recorded as Pp.
  • the priority value corresponding to the generation time of the data to be copied is defined as [0, 9].
  • the copying device may determine, according to formula (1), a third priority value of each copy task.
  • formula (1) refer to the foregoing description, and details are not described herein again.
  • the priority calculation module 72 may form the priority value into a three-digit number, wherein the hundred, ten, and one digits are Pt, Pp, and Pd, and the three digits are priorities of the replication task. Its value range is [000, 299], the smaller the three digits, the corresponding copy The higher the priority of the service.
  • the priority determining apparatus can calculate the priority of the replication task across the cluster, and provide conditions for the subsequent replication task processing process based on the priority of the replication task (for example, the replication task scheduling process).
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Abstract

A method and device for copying clustered data. The method for copying clustered data comprises: determining at least one copying task requiring inter-cluster data copying (201); calculating a priority for each of the at least one copying task (202); and implementing the copying task according to the priority of the copying task (203).The method and device provided in the invention can achieve reasonable scheduling of data to be copied under a limited inter-domain bandwidth, thereby achieving rapid copying of the data.

Description

集群数据复制方法、优先级确定方法及装置Cluster data replication method, priority determination method and device 技术领域Technical field
本申请涉及通信技术,尤其涉及一种集群数据复制方法、优先级确定方法及装置。The present application relates to communication technologies, and in particular, to a cluster data replication method, a priority determination method, and an apparatus.
背景技术Background technique
集群大大提高了单机的存储极限和处理极限。但随着互联网特别是移动互联网的持续发展,很多公司产生的数据已经达到PB甚至EB级别,并且每天新增加的数据数量也在迅速增长。当这些数据超过单个集群的存储上线,或单个集群无法满足数据处理的需求时,就需要将这些数据按照业务单元分拆并存储在多个集群中。Clustering greatly increases the storage limits and processing limits of a single unit. However, with the continuous development of the Internet, especially the mobile Internet, the data generated by many companies has reached the PB or even EB level, and the amount of new data added every day is also growing rapidly. When the data exceeds the storage of a single cluster, or a single cluster cannot meet the needs of data processing, it needs to be split and stored in multiple clusters according to business units.
业务单元之间往往有依赖关系,业务A的数据存储在第一集群中,若同在第一集群中的业务B需要访问业务A的数据,则可以从第一集群内直接读取数据;若位于第二集群的业务C需要访问业务A的数据,则需要跨集群异地读取数据。若第二集群中存在多个业务需要访问业务A的数据,那么需要多次跨集群异地读取同一份数据,这会浪费集群之间的带宽资源。特别是随着业务数量越来越多,跨集群异地读取同一份数据的业务数量也会越来越多,导致带宽资源的浪费更加严重。There is a dependency between the business units. The data of the service A is stored in the first cluster. If the service B in the first cluster needs to access the data of the service A, the data can be directly read from the first cluster. If the service C located in the second cluster needs to access the data of the service A, the data needs to be read out of the cluster. If multiple services in the second cluster need to access the data of service A, it is necessary to read the same data across the cluster multiple times, which wastes bandwidth resources between the clusters. In particular, as the number of services increases, the number of services that read the same data across different clusters will increase, resulting in more waste of bandwidth resources.
为节约带宽资源,业界普遍采取的方式是将业务A的数据在其它集群中保留一个副本,这样其它集群中的业务在需要业务A的数据时就可以在集群内直接读取数据。这需要将数据在各个集群之间进行复制。现有技术一般采用离线复制方式,即停止各集群的数据库操作,一次性将数据全部从一个集群复制到另一个集群,这种方式需要大量带宽资源。但是,跨域带宽是有限且很宝贵的,并且随着业务数量不断增长,需要复制的数据也 会逐渐增多,所以在跨域带宽有限的条件下,离线复制方法显然已经无法满足需求,因此急需一种新的数据复制方法。To save bandwidth resources, the common method in the industry is to keep the data of service A in another cluster, so that the services in other clusters can directly read data in the cluster when the data of service A is needed. This requires data to be replicated between clusters. The prior art generally adopts an offline replication mode, that is, stops database operations of each cluster, and copies data all from one cluster to another at a time, which requires a large amount of bandwidth resources. However, cross-domain bandwidth is limited and valuable, and as the number of services grows, so does the need to replicate data. It will gradually increase, so under the condition of limited cross-domain bandwidth, the offline replication method obviously cannot meet the demand, so a new data replication method is urgently needed.
发明内容Summary of the invention
本申请提供一种集群数据复制方法及装置,用以在跨域带宽有限的条件下,对待复制数据进行合理调度,实现数据的快速复制。The present invention provides a cluster data replication method and device for reasonably scheduling data to be replicated under the condition of limited cross-domain bandwidth, thereby realizing rapid data replication.
为达到上述目的,本申请的实施例采用如下技术方案:To achieve the above objective, the embodiment of the present application adopts the following technical solutions:
第一方面,提供了一种集群数据复制方法,包括:In a first aspect, a cluster data replication method is provided, including:
确定需要跨集群复制数据的至少一个复制任务;Identify at least one replication task that requires data to be replicated across the cluster;
计算所述至少一个复制任务中各复制任务的优先级;Calculating a priority of each of the at least one replication task;
根据所述各复制任务的优先级,执行所述各复制任务。Each of the copy tasks is executed according to the priority of each of the copy tasks.
第二方面,提供了一种集群数据复制装置,包括:In a second aspect, a cluster data replication apparatus is provided, including:
确定模块,用于确定需要跨集群复制数据的至少一个复制任务;Determining a module for determining at least one replication task that requires data to be replicated across the cluster;
计算模块,用于计算所述至少一个复制任务中各复制任务的优先级;a calculation module, configured to calculate a priority of each of the at least one replication task;
执行模块,用于根据所述各复制任务的优先级,执行所述各复制任务。And an execution module, configured to execute each of the replication tasks according to a priority of each of the replication tasks.
第三方面,提供一种优先级确定方法,包括:In a third aspect, a method for determining a priority is provided, including:
获取需要跨集群复制数据的复制任务的触发方式、所述复制任务需要复制的数据的产生时间、以及所述复制任务对应的源业务的重要度中的至少一个因素,所述复制任务对应的源业务是指产生所述复制任务需要复制的数据的业务;Acquiring at least one of a triggering manner of a replication task that needs to replicate data across the cluster, a generation time of the data that the replication task needs to be replicated, and an importance of the source service corresponding to the replication task, the source corresponding to the replication task Service refers to the service that generates the data that the copy task needs to copy;
根据所述至少一个因素,计算所述复制任务的优先级。The priority of the copy task is calculated according to the at least one factor.
第四方面,提供一种优先级确定装置,包括:In a fourth aspect, a priority determining apparatus is provided, including:
信息获取模块,用于获取需要跨集群复制数据的复制任务的触发方式、所述复制任务需要复制的数据的产生时间、以及所述复制任务对应的源业务的重要度中的至少一个因素,所述复制任务对应的源业务是指产生所述复制任务需要复制的数据的业务; An information obtaining module, configured to acquire a triggering manner of a replication task that needs to replicate data across the cluster, a generation time of the data to be copied by the replication task, and an importance degree of the source service corresponding to the replication task, where The source service corresponding to the replication task refers to a service that generates data that needs to be copied by the replication task;
优先级计算模块,用于根据所述至少一个因素,计算所述复制任务的优先级。a priority calculation module, configured to calculate a priority of the replication task according to the at least one factor.
在本申请中,在确定需要跨集群复制数据的复制任务之后,计算各复制任务的优先级,然后根据各复制任务的优先级,执行各复制任务。由此可见,本申请在跨域带宽有限的条件下,按照复制任务的优先级对复制任务进行调度,优先调度优先级较高的复制任务,能够对复制任务进行合理调度,有利于实现数据的快速复制。In the present application, after determining a replication task that needs to replicate data across the cluster, the priority of each replication task is calculated, and then each replication task is executed according to the priority of each replication task. It can be seen that, under the condition that the cross-domain bandwidth is limited, the replication task is scheduled according to the priority of the replication task, and the replication task with higher priority is preferentially scheduled, and the replication task can be reasonably scheduled, which is beneficial to realizing data. Quick copy.
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。The above description is only an overview of the technical solutions of the present application, and the technical means of the present application can be more clearly understood, and the above and other objects, features and advantages of the present application can be more clearly understood. The following is a specific embodiment of the present application.
附图说明DRAWINGS
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those skilled in the art from a The drawings are only for the purpose of illustrating the preferred embodiments and are not intended to be limiting. Throughout the drawings, the same reference numerals are used to refer to the same parts. In the drawing:
图1为本申请一实施例提供的集群系统的结构示意图;FIG. 1 is a schematic structural diagram of a cluster system according to an embodiment of the present application;
图2为本申请另一实施例提供集群数据复制方法的流程示意图;2 is a schematic flowchart of a method for replicating a cluster data according to another embodiment of the present application;
图3为本申请又一实施例提供的复制系统的架构示意图;FIG. 3 is a schematic structural diagram of a replication system according to another embodiment of the present disclosure;
图4为本申请又一实施例提供的对复制任务进行打包处理的流程示意图;FIG. 4 is a schematic flowchart of packet processing of a replication task according to another embodiment of the present disclosure;
图5为本申请又一实施例提供的集群数据复制装置的结构示意图;FIG. 5 is a schematic structural diagram of a cluster data replication apparatus according to another embodiment of the present disclosure;
图6为本申请又一实施例提供的优先级确定方法的流程示意图;FIG. 6 is a schematic flowchart of a priority determining method according to another embodiment of the present disclosure;
图7为本申请又一实施例提供的优先级确定装置的结构示意图。FIG. 7 is a schematic structural diagram of a priority determining apparatus according to another embodiment of the present disclosure.
具体实施方式 detailed description
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the embodiments of the present invention have been shown in the drawings, the embodiments Rather, these embodiments are provided so that this disclosure will be more fully understood and the scope of the disclosure will be fully disclosed.
图1为本申请实施例一提供的集群系统的结构示意图。如图1所示,该集群系统仅象征性的示意出3个集群,分别为集群A、集群B和集群C,实际上集群系统可以包含任意数量的集群。FIG. 1 is a schematic structural diagram of a cluster system according to Embodiment 1 of the present application. As shown in Figure 1, the cluster system only symbolically indicates three clusters, namely cluster A, cluster B, and cluster C. In fact, the cluster system can contain any number of clusters.
结合图1所示集群系统说明一下跨集群数据复制的过程。The process of cross-cluster data replication is illustrated in conjunction with the cluster system shown in Figure 1.
假设集群A中存在一业务a,集群B中存在一业务b,集群C中存在一业务c,业务a产生数据,而且业务b和业务c需要业务a产生的数据,故需要将业务a产生的数据从集群A复制到集群B和集群C中。当然,若集群A中还包括业务d,且业务b和业务c也需要业务d产生的数据,则也需要将业务d产生的数据从集群A复制到集群B和集群C中。当然,若业务a需要业务b和业务c产生的数据,则也需要将业务b和c产生的数据从集群B和C分别复制到集群A中。It is assumed that there is a service a in the cluster A, a service b exists in the cluster B, a service c exists in the cluster C, the service a generates data, and the service b and the service c need the data generated by the service a, so the service a needs to be generated. Data is copied from cluster A to cluster B and cluster C. Of course, if the cluster A also includes the service d, and the service b and the service c also need the data generated by the service d, the data generated by the service d needs to be copied from the cluster A to the cluster B and the cluster C. Of course, if the service a needs the data generated by the service b and the service c, the data generated by the services b and c also needs to be copied from the clusters B and C to the cluster A, respectively.
由于集群之间的带宽资源有限,而且随着业务数量不断增长,需要复制的数据也会逐渐增多,所以如果采用离线复制方式,需要一次性将所有数据从一个集群复制到另一个集群,这需要大量带宽资源,在集群之间的带宽资源有限的情况下,该方法不再适用,需要部分的进行数据复制,这就涉及到待复制数据之间的调度问题,如果能够合理的调度待复制数据,那么将有利于提高复制效率。Due to the limited bandwidth resources between clusters and the increasing number of services, the amount of data to be replicated will gradually increase. Therefore, if offline replication is adopted, all data needs to be copied from one cluster to another at a time. A large number of bandwidth resources, in the case of limited bandwidth resources between clusters, the method is no longer applicable, and part of the data replication is required. This involves scheduling problems between data to be replicated, if the data to be copied can be reasonably scheduled. , then it will help to improve the efficiency of replication.
针对上述问题,本申请提供一种解决方案,其主要思想在于,在确定需要跨集群复制数据的复制任务之后,计算复制任务的优先级,然后根据复制任务的优先级,执行复制任务。本申请在跨域带宽有限的条件下,按 照复制任务的优先级对复制任务进行调度,优先调度优先级较高的复制任务,能够对复制任务进行合理调度,有利于实现数据的快速复制。In view of the above problems, the present application provides a solution, the main idea of which is to calculate the priority of the replication task after determining the replication task that needs to replicate data across the cluster, and then perform the replication task according to the priority of the replication task. This application is based on the limited cross-domain bandwidth. The replication task is scheduled according to the priority of the replication task, and the replication task with the higher priority is preferentially scheduled, and the replication task can be scheduled reasonably, which is beneficial for realizing rapid data replication.
下面结合附图对本申请技术方案进行详细说明。The technical solution of the present application will be described in detail below with reference to the accompanying drawings.
图2为本申请另一实施例提供的集群数据复制方法的流程示意图。如图2所示,该方法包括:FIG. 2 is a schematic flowchart of a method for replicating a cluster data according to another embodiment of the present disclosure. As shown in Figure 2, the method includes:
201、确定需要跨集群复制数据的至少一个复制任务。201. Determine at least one replication task that needs to replicate data across the cluster.
202、计算至少一个复制任务中各复制任务的优先级。202. Calculate a priority of each replication task in at least one replication task.
203、根据各复制任务的优先级,执行各复制任务。203. Perform each replication task according to the priority of each replication task.
本实施例提供一种集群数据复制方法,可由集群数据复制装置(后续简称为复制装置)执行,用以合理调度复制任务,实现跨集群复制数据,提高数据复制效率。The embodiment provides a cluster data replication method, which can be executed by a cluster data replication device (hereinafter referred to as a replication device) to properly schedule replication tasks, implement data replication across the cluster, and improve data replication efficiency.
在具体实现上,复制装置可以部署于集群系统中,例如部署于集群系统中的某个集群,例如可以是产生数据的集群(简称为源集群),或需要复制数据的集群(简称为目的集群)内,或者也可以是独立于集群系统但能够与集群系统进行通信的设备。In a specific implementation, the replication device may be deployed in a cluster system, for example, a cluster deployed in the cluster system, for example, a cluster for generating data (referred to as a source cluster) or a cluster that needs to replicate data (referred to as a destination cluster). Within, or it may be a device that is independent of the cluster system but is capable of communicating with the cluster system.
具体的,复制装置首先需要确定需要跨集群复制数据的至少一个复制任务。复制任务是指需要将数据从一个集群复制到其它集群的任务。Specifically, the replication device first needs to determine at least one replication task that needs to replicate data across the cluster. A replication task is a task that requires data to be replicated from one cluster to another.
其中,复制装置可以采用但不限于以下几种方式确定复制任务:The copying device may determine the copying task by using, but not limited to, the following methods:
第一种方式:定期轮询数据版本管理服务器,在发现有数据的版本发生变化时,确定有需要对所述版本发生变化的数据进行跨集群复制的复制任务。第一种方式也可称为扫描(Scan)触发方式。The first method is to poll the data version management server periodically, and when it is found that the version of the data changes, it is determined that there is a need to perform a cross-cluster replication replication task for the data whose version is changed. The first method can also be called a scan trigger method.
在第一种方式中,需要通过数据版本管理服务器管理整个集群系统中各数据的版本信息。例如,复制装置可以启动一线程定期轮询数据版本管理服务器,当发现有数据的版本发生变化时,确定有需要对版本发生变化的数据进行跨集群复制的复制任务。 In the first mode, the version information of each data in the entire cluster system needs to be managed by the data version management server. For example, the copying device may start a thread to periodically poll the data version management server, and when it is found that the version of the data changes, it is determined that there is a need to perform a cross-cluster copying task for the data whose version has changed.
第二种方式:获取控制服务器根据收到的复制任务通知消息所下发的复制任务,该复制任务通知消息是第一业务在产生新版本数据时主动上报给控制服务器的。第二种方式也可称为事件(Event)触发方式。The second method is: the obtaining, by the control server, the replication task that is sent according to the received replication task notification message, and the replication task notification message is that the first service actively reports to the control server when the new version of the data is generated. The second way can also be called the event trigger mode.
在第二种方式中,需要部署控制服务器。基于此,一种实施本实施例方法的系统架构如图3所示,该系统包括控制服务器31和至少一个受控服务器32,复制装置位于受控服务器32中实现,但不限于此。In the second way, you need to deploy a control server. Based on this, a system architecture for implementing the method of the present embodiment is shown in FIG. 3. The system includes a control server 31 and at least one managed server 32. The copying device is implemented in the controlled server 32, but is not limited thereto.
在部署实现上,该系统架构可以运行在集群系统中的某个集群上,例如可以是源集群或目的集群,或者也可以运行于集群系统之外。In the deployment implementation, the system architecture can run on a cluster in the cluster system, for example, it can be a source cluster or a destination cluster, or can also run outside the cluster system.
具体的,控制服务器31负责集群中复制任务的分发管理,监控受控服务器32以及其上运行的复制装置的状态,此外,控制服务器31还负责同外界进行通信,例如接收复制任务通知消息,查询系统状态等。控制服务器31和受控服务器32之间依靠心跳消息进行通信,受控服务器32向控制服务器31汇报运行状态,包括CPU、内存使用量,以及复制装置的运行状态等。控制服务器31将需要启动或停止的复制装置的信息发给受控服务器32。例如,运维人员通过管控接口,向控制服务器31发送启动或停止某复制装置的消息。当控制服务器31接到一个启动或停止某复制装置的消息时,随机选定某个受控服务器32,在该受控服务器32的心跳消息中加上启动或停止某复制装置的消息,受控服务器32接到心跳消息后,就会启动或停止相应的复制装置以执行或结束执行复制任务。Specifically, the control server 31 is responsible for the distribution management of the replication task in the cluster, monitoring the state of the controlled server 32 and the replication device running thereon, and further, the control server 31 is also responsible for communicating with the outside world, for example, receiving a replication task notification message, querying System status, etc. The control server 31 and the controlled server 32 communicate by means of a heartbeat message, and the controlled server 32 reports the running status to the control server 31, including the CPU, the memory usage, and the operating state of the copying device. The control server 31 sends the information of the copying device that needs to be started or stopped to the managed server 32. For example, the operation and maintenance personnel send a message to the control server 31 to start or stop a copy device through the management interface. When the control server 31 receives a message to start or stop a copy device, a controlled server 32 is randomly selected, and a message for starting or stopping a copy device is added to the heartbeat message of the controlled server 32, and is controlled. After the server 32 receives the heartbeat message, it will start or stop the corresponding copying device to execute or end the execution of the copying task.
其中,控制服务器31可以采用消息订阅方式,即集群中产生数据的业务(简称为第一业务)在产生新版本数据时,主动向控制服务器发送复制任务通知消息,以通知控制服务器31有复制任务。一般来说,复制任务通知消息携带有需要跨集群复制的数据的信息、该数据所在的源集群的信息以及需要复制该数据的目的集群的信息等。控制服务器31根据复制任务通知消息向复制装置下发复制任务。 The control server 31 may adopt a message subscription mode, that is, the service that generates data in the cluster (referred to as the first service), when generating the new version data, actively sends a replication task notification message to the control server to notify the control server 31 that there is a replication task. . Generally, the replication task notification message carries information of data that needs to be replicated across the cluster, information of the source cluster where the data is located, information of the destination cluster that needs to copy the data, and the like. The control server 31 issues a copy task to the copying device according to the copy task notification message.
第三种方式:接收控制服务器在接收到复制任务通知消息时下发的复制任务,该复制任务通知消息是需要数据的业务(简称为第二业务)在确定该数据在第二业务所在集群中的版本与该数据所在源集群中的版本不一致时上报给控制服务器的。第三种方式也可称为需求(On-demand)触发方式。The third mode is: receiving a replication task sent by the control server when receiving the replication task notification message, where the replication task notification message is a service requiring data (referred to as a second service), determining that the data is in the cluster where the second service is located. The version is reported to the control server when the version is inconsistent with the version in the source cluster where the data resides. The third way can also be called an on-demand trigger.
在第三种方式中,需要部署控制服务器。该方式也可以采用图3所示的系统架构实现。关于图3所示系统的描述参见上述实施例。In the third way, you need to deploy a control server. This method can also be implemented by using the system architecture shown in FIG. See the above embodiment for a description of the system shown in FIG.
具体的,当第二业务的用户希望在第二业务所在集群(例如集群C)提交的作业需要用到位于其他集群(例如集群A)中的业务产生的数据时,第二业务会判断所需数据在第二业务所在集群(例如集群C)中的版本与该数据所在源集群(例如集群A)中的版本是否一致,例如第二业务可以到数据版本管理服务器查询以获取源集群中的版本,将第二业务所在集群中的版本与查询到的源集群中的版本进行比较,如果判断结果为不一致,则第二业务会向控制服务器31发送一个复制任务通知消息,控制服务器31根据复制任务通知消息向复制装置下发复制任务。Specifically, when the user of the second service wants to submit the data generated by the service in another cluster (for example, cluster A) in the cluster where the second service is located (for example, cluster C), the second service determines the required service. Whether the version of the data in the cluster where the second service is located (for example, cluster C) is consistent with the version in the source cluster (for example, cluster A) where the data is located. For example, the second service can query the data version management server to obtain the version in the source cluster. Comparing the version in the cluster in which the second service is located with the version in the source cluster that is queried. If the result of the determination is inconsistent, the second service sends a copy task notification message to the control server 31, and the control server 31 performs the copy task. The notification message sends a copy task to the copying device.
上述三种方式可以单独使用,也可以结合使用。The above three methods can be used alone or in combination.
通过上述任意方式,复制装置可以确定需要跨集群复制数据的复制任务。由于业务数量不断增长,所以需要跨集群复制数据的复制任务也在逐渐增多,但是集群之间的带宽有限,这就需要对复制任务进行合理调度,以便更高效、快速的完成各复制任务。针对该问题,复制装置计算各复制任务的优先级,根据各复制任务的优先级,对各复制任务进行调度执行。这样可以保证高优先级的复制任务优先得到处理,能够对复制任务进行合理调度,有利于实现数据的快速复制。In any of the ways described above, the replication device can determine the replication tasks that need to replicate data across the cluster. As the number of services continues to increase, the number of replication tasks that need to replicate data across clusters is increasing. However, the bandwidth between clusters is limited. This requires proper scheduling of replication tasks to complete replication tasks more efficiently and quickly. To solve this problem, the copying device calculates the priority of each copy task, and performs scheduling execution on each copy task according to the priority of each copy task. This ensures that high-priority replication tasks are processed first, and that replication tasks can be scheduled reasonably, which facilitates fast data replication.
在一可选实施方式中,上述步骤202,即计算各复制任务的优先级的一种实施方式包括: In an optional implementation manner, the foregoing step 202, that is, calculating an implementation priority of each replication task, includes:
根据各复制任务的触发方式、各复制任务需要复制的数据的产生时间、以及各复制任务对应的源业务的重要度中的至少一个因素,计算各复制任务的优先级。The priority of each replication task is calculated according to at least one of the triggering manner of each replication task, the generation time of the data to be copied by each replication task, and the importance of the source service corresponding to each replication task.
上述复制任务的触发方式主要是指上述确定复制任务的三种方式,例如扫描触发方式、事件触发方式和需求触发方式。不同触发方式的复制任务具有不同的优先级。例如,可以设置需求触发方式触发的复制任务的优先级最高,事件触发方式触发的复制任务的优先级次之,扫描触发方式触发的复制任务的优先级最低,但不限于此。The triggering manner of the foregoing replication task mainly refers to the foregoing three methods for determining a replication task, such as a scan trigger mode, an event trigger mode, and a demand trigger mode. Replication tasks with different trigger modes have different priorities. For example, the priority of the replication task triggered by the demand trigger mode is the highest, the priority of the replication task triggered by the event trigger mode is the second, and the priority of the replication task triggered by the scan trigger mode is the lowest, but is not limited thereto.
上述复制任务对应的源业务是指产生复制任务需要复制的数据的业务。举例说明,假设集群A中的业务a产生数据,需要将该数据从集群A复制到集群B和C中,则复制任务需要复制的数据即为业务a产生的数据,业务a即为复制任务对应的源业务。一般来说,不同业务的重要度并不相同,重要度越高的业务产生的数据的重要度相对也会较高,所以用于复制重要度较高的业务产生的数据的复制任务的优先级就越高。The source service corresponding to the above replication task refers to the service that generates data that needs to be copied by the replication task. For example, if the service a in the cluster A generates data, and the data needs to be copied from the cluster A to the clusters B and C, the data to be copied by the replication task is the data generated by the service a, and the service a is the corresponding to the replication task. Source business. In general, the importance of different services is different. The higher the importance of the data generated by the service, the higher the importance of the data. Therefore, the priority of the replication task for copying the data generated by the more important business is higher. The higher.
上述复制任务需要复制的数据的产生时间主要用于表示复制任务需要复制的数据的新鲜程度,一般来说,数据产生时间越晚,数据越新,则用于复制新鲜程度较高的数据的复制任务的优先级就越高。The generation time of the data to be copied by the above replication task is mainly used to indicate the freshness of the data that the replication task needs to copy. Generally speaking, the later the data is generated, the newer the data is, the copying is used to copy the data with higher freshness. The priority of the task is higher.
在一具体实施方式中,可以采用上述三个因素中的一个因素,确定各复制任务的优先级。例如,仅根据各复制任务的触发方式,确定各复制任务的优先级。又例如,仅根据各复制任务对应的源业务的重要度,确定各复制任务的优先级。又例如,仅根据各复制任务需要复制的数据的产生时间,确定各复制任务的优先级。In a specific embodiment, one of the above three factors may be used to determine the priority of each replication task. For example, the priority of each replication task is determined only according to the trigger mode of each replication task. For another example, the priority of each replication task is determined only according to the importance of the source service corresponding to each replication task. For another example, the priority of each copy task is determined based only on the generation time of the data to be copied for each copy task.
在另一具体实施方式中,可以结合使用上述三个因素中的任意两个因素,确定各复制任务的优先级。具体可以根据每个因素计算出一个优先级取值,然后对两个优先级取值进行加权平均,获得复制任务的最终优先级。 其中,可以预先为不同因素配置不同的权重。In another embodiment, the priority of each replication task may be determined in combination with any two of the above three factors. Specifically, a priority value can be calculated according to each factor, and then the weighted average of the two priority values is obtained to obtain the final priority of the replication task. Among them, different weights can be configured in advance for different factors.
例如,可以结合各复制任务对应的源业务的重要度以及各复制任务的触发方式,则假设根据复制任务对应的源业务的重要度,确定复制任务的优先级取值为P1,根据复制任务的触发方式,确定复制任务的优先级取值为P2,预先为源业务的重要度和触发方式确定的权重分别为w1和w2,则复制任务的最终优先级为:w1*P1+w2*P2。For example, the importance of the source service corresponding to each replication task and the triggering mode of each replication task may be combined, and it is determined that the priority of the replication task is P1 according to the importance of the source service corresponding to the replication task, according to the replication task. The triggering mode determines that the priority of the replication task is P2. The weights determined in advance for the importance and trigger mode of the source service are w1 and w2, respectively. The final priority of the replication task is w1*P1+w2*P2.
当然,也可以结合复制任务的触发方式和复制任务需要复制的数据的产生时间,也可以结合复制任务对应的源业务的重要度和复制任务需要复制的数据的产生时间,具体计算方式同上,不再赘述。Of course, the triggering manner of the replication task and the generation time of the data to be copied by the replication task may be combined, and the importance of the source service corresponding to the replication task and the generation time of the data to be copied by the replication task may be combined, and the specific calculation manner is the same as above. Let me repeat.
在又一具体实施方式中,可以同时结合各复制任务的触发方式、各复制任务需要复制的数据的产生时间以及各复制任务对应的源业务的重要度,计算各复制任务的优先级。In another embodiment, the priority of each replication task may be calculated by combining the triggering manner of each replication task, the generation time of the data to be copied by each replication task, and the importance of the source service corresponding to each replication task.
具体的,复制装置可以根据各复制任务的触发方式,确定各复制任务的第一优先级取值;根据各复制任务对应的源业务的重要度,确定各复制任务的第二优先级取值;根据各复制任务需要复制的数据的产生时间,确定各复制任务的第三优先级取值;根据各复制任务的第一优先级取值、第二优先级取值以及第三优先级取值,生成各复制任务的优先级。Specifically, the replication device may determine, according to the triggering manner of each replication task, the first priority value of each replication task, and determine the second priority value of each replication task according to the importance of the source service corresponding to each replication task. Determining, according to the generation time of the data to be copied by each replication task, determining the third priority value of each replication task; according to the first priority value, the second priority value, and the third priority value of each replication task, Generate the priority of each replication task.
可选的,复制装置可以预先为复制任务对应的源业务的重要度、复制任务的触发方式以及复制任务需要复制的数据的产生时间三个因素配置权重,例如分别为w1、w2、w3。基于此,复制装置可以根据对应因素的权重,对各复制任务的第一优先级取值、第二优先级取值以及第三优先级取值进行加权平均,以生成各复制任务的优先级。例如,复制任务的优先级=w1*第一优先级取值+w2*第二优先级取值+w3*第三优先级取值。Optionally, the copying device may pre-set the weights for the importance of the source service corresponding to the replication task, the triggering manner of the replication task, and the generation time of the data to be copied by the replication task, for example, w1, w2, and w3, respectively. Based on this, the copying apparatus may perform weighted averaging on the first priority value, the second priority value, and the third priority value of each copy task according to the weight of the corresponding factor to generate a priority of each copy task. For example, the priority of the replication task = w1 * the first priority value + w2 * the second priority value + w3 * the third priority value.
可选的,复制装置也可以按照由高位到低位的顺序,将各复制任务的第一优先级取值、第二优先级取值以及第三优先级取值拼接在一起,以生 成各复制任务的优先级。Optionally, the copying device may also stitch the first priority value, the second priority value, and the third priority value of each copy task in order from high to low. The priority of each replication task.
例如,预先定义触发方式对应的优先级取值的范围为[0,2],其中需求触发方式对应的优先级取值为0,事件触发方式对应的优先级取值为1,扫描触发方式对应的优先级取值为2。基于此,若复制任务的触发方式为需求触发方式,则可以确定该复制任务的第一优先级取值为0,若复制任务的触发方式为事件触发方式,则可以确定该复制任务的第一优先级取值为1,若复制任务的触发方式为扫描触发方式,则可以确定该复制任务的第一优先级取值为2。为便于后续描述,将第一优先级取值记为PtFor example, the priority of the triggering mode is set to [0, 2], where the priority of the triggering mode is 0, and the priority of the event triggering mode is 1, and the scanning trigger mode corresponds to The priority value is 2. Based on this, if the triggering mode of the replication task is the demand triggering mode, the first priority of the replication task is determined to be 0. If the triggering mode of the replication task is the event triggering mode, the first task of the replication task may be determined. The priority of the replication task is 1. If the triggering mode of the replication task is the scan trigger mode, you can determine that the first priority of the replication task is 2. For the convenience of subsequent description, the first priority value is recorded as P t .
例如,预先定义源业务的重要度对应的优先级取值的范围为[0,9],具体可以根据源业务的重要度进行设定,一般来说,源业务的重要度越高,对应的优先级取值越低。其中,复制任务的第二优先级取值为0-9中任一数值。为便于后续描述,将第一优先级取值记为PpFor example, the priority value of the priority of the source service is defined as [0, 9], which can be set according to the importance of the source service. Generally, the importance of the source service is higher. The lower the priority value. The second priority of the replication task is any value from 0-9. For the convenience of subsequent description, the first priority value is recorded as P p .
又例如,预先定义需要复制的数据的产生时间对应的优先级取值的范围为[0,9]。可选的,复制装置可以根据公式(1),确定各复制任务的第三优先级取值。For another example, the priority value corresponding to the generation time of the data to be copied is defined as [0, 9]. Optionally, the copying device may determine, according to formula (1), a third priority value of each copy task.
Pd=9*t/T         (1)P d =9*t/T (1)
在上述公式(1)中,t表示各复制任务需要复制的数据的产生时间;T表示各复制任务需要复制的数据的生命周期,且0<t<T;Pd表示各复制任务的第三优先级取值。值得说明的是,不同复制任务需要复制的数据的生命周期可能相同,也可能不同。生命周期的长短,一般可由业务需求、重要程度等因素决定。In the above formula (1), t represents the generation time of the data to be copied by each copy task; T represents the life cycle of the data to be copied by each copy task, and 0 < t <T; P d represents the third of each copy task Priority value. It is worth noting that the life cycle of data that needs to be replicated by different replication tasks may be the same or different. The length of the life cycle can generally be determined by factors such as business needs and importance.
基于上述,复制装置可以将上述优先级取值组成三位数字,其中,百位,十位,个位依次为Pt,Pp,Pd,该三位数字即为复制任务的优先级,其取值范围为[000,299],该三位数字越小,表示对应复制任务的优先级越高。 The above priority value may be based on the composition, three digital copying apparatus, in which one hundred, ten, bit followed by P t, the priority P p, P d, the number three is the replication tasks, The value range is [000, 299]. The smaller the three digits, the higher the priority of the corresponding replication task.
在计算出各复制任务的优先级之后,复制任务之间就具有了可比性,因此复制装置可以根据各复制任务的优先级,为各复制任务申请带宽资源,然后基于所申请到的带宽资源,执行各复制任务。其中,高优先级的复制任务,会优先申请到带宽资源,所以会优先被执行,有利于提高跨域数据的复制效率。After the priorities of the replication tasks are calculated, the replication tasks are comparable. Therefore, the replication device can apply for bandwidth resources for each replication task according to the priority of each replication task, and then based on the applied bandwidth resources. Perform each copy task. Among them, high-priority replication tasks will apply for bandwidth resources preferentially, so they will be executed preferentially, which is beneficial to improve the replication efficiency of cross-domain data.
具体的,复制装置可以维护一个多优先级队列,例如300个队列,然后按照复制任务的优先级,将复制任务加入相应优先级队列中。复制装置按照优先级由高到低的顺序依次轮询各优先级队列,并为轮询到的复制任务申请带宽资源。结合图3所示系统架构,控制服务器31还负责整个复制系统带宽的分配。复制装置可以向控制服务器发送带宽申请请求,控制服务器31通过心跳消息携带分配给复制任务的带宽数以及申请带宽资源的复制任务的优先级下发给复制装置。复制装置接收控制服务器31下发的心跳消息,从中获取申请到的带宽数。Specifically, the replication device can maintain a multi-priority queue, for example, 300 queues, and then add the replication task to the corresponding priority queue according to the priority of the replication task. The copying device polls each priority queue in order of priority from high to low, and requests bandwidth resources for the polled copy task. In conjunction with the system architecture shown in Figure 3, the control server 31 is also responsible for the allocation of bandwidth for the entire replication system. The copying device may send a bandwidth request request to the control server, and the control server 31 sends the number of bandwidths allocated to the copy task and the priority of the copy task for requesting the bandwidth resource to the copying device through the heartbeat message. The copying device receives the heartbeat message sent by the control server 31, and obtains the number of bandwidths requested.
值得的说明的是,当有多个复制任务同时申请带宽资源时,控制服务器31会根据优先级的高低进行分配。对于高优先级的复制任务,不仅可以获得额定带宽内的配额,当带宽资源分配完时,控制服务器31还对高优先级的复制任务的申请通过超卖进行满足。It is worth noting that when there are multiple replication tasks requesting bandwidth resources at the same time, the control server 31 allocates according to the priority level. For the high-priority replication task, not only the quota within the rated bandwidth can be obtained, but when the bandwidth resource is allocated, the control server 31 also satisfies the application of the high-priority replication task by overselling.
进一步,复制装置可以不断轮询优先级队列,将若干复制任务打包成一个复制作业,并以复制作业为单位,向控制服务器31申请带宽资源,并。其中,一个复制作业中执行多个复制任务可以有效地提高效率;但一个复制作业中包含的复制任务太多,则会导致复制作业执行时间过长,无法满足实时性要求较高的复制任务的需求。基于此,需要对每个复制作业的大小进行限制。例如,可以限制复制作业包含的文件总数,或文件总大小,或者也可以同时限制复制作业包含的文件总数和文件总大小。为便于描述,将用于限制复制作业的大小的条件称为作业提交限制。作业提交限 制可以包括以下至少一个:文件总个数上限值,文件总大小上限值。文件总个数上限值和文件总大小上限值的取值可以根据应用需求适应性设置,本实施例不限定其具体取值。Further, the copying device can continuously poll the priority queue, pack a plurality of copy tasks into one copy job, and apply for bandwidth resources to the control server 31 in units of copy jobs. Among them, performing multiple replication tasks in one replication job can effectively improve efficiency; however, if there are too many replication tasks included in one replication job, the replication job execution time will be too long to meet the replication task with high real-time requirements. demand. Based on this, you need to limit the size of each copy job. For example, you can limit the total number of files that a copy job contains, or the total file size, or you can limit the total number of files and the total file size that a copy job contains. For ease of description, the condition for limiting the size of a copy job is called a job submission limit. Job submission limit The system may include at least one of the following: an upper limit of the total number of files, and an upper limit of the total size of the file. The value of the upper limit of the total number of files and the upper limit of the total size of the file may be set according to the application requirements. The specific value is not limited in this embodiment.
基于上述作业提交限制,复制装置打包申请带宽资源的过程包括:根据各复制任务的优先级以及预设的作业提交限制,对各复制任务进行打包处理,以形成至少一个复制作业;然后,根据各复制作业所包含的复制任务的优先级,确定各复制作业的优先级;根据各复制作业的优先级,为各复制作业所包含的复制任务申请带宽资源。The process of applying for the bandwidth resource by the copying device according to the foregoing job submission restriction includes: packaging each copy task according to a priority of each copy task and a preset job submission limit to form at least one copy job; and then, according to each The priority of the replication task included in the replication job is determined, and the priority of each replication job is determined; and the bandwidth resource is requested for the replication task included in each replication job according to the priority of each replication job.
进一步,复制装置可以采用以下方式对复制任务进行打包处理:Further, the copying device may package the copy task in the following manner:
复制装置按照优先级由高到低的顺序,依次获取复制任务作为当前复制任务;判断当前复制任务是否达到作业提交限制,例如判断当前复制任务包含的文件总个数是否达到文件总个数上限值,并判断当前复制任务包含的文件的总大小是否达到文件总大小上限值,若判断结果中存在一个为是的情况,则确定当前复制任务达到作业提交限制,这说明当前复制任务太大或文件数太多,不需要与其他复制任务打包,可以直接将当前复制任务作为一个复制作业;若判断结果均为否,这说明当前复制任务符合打包要求,则继续获取其他未达到作业提交限制的复制任务,直到未达到作业提交限制的多个复制任务的总和达到作业提交限制为止,将未达到作业提交限制的多个复制任务打包,以生成一个复制作业。The copying device sequentially obtains the copy task as the current copy task according to the order of priority, and determines whether the current copy task reaches the job submission limit, for example, whether the total number of files included in the current copy task reaches the total number of files. Value, and determine whether the total size of the file included in the current replication task reaches the upper limit of the total file size. If there is a yes in the judgment result, it is determined that the current replication task reaches the job submission limit, which indicates that the current replication task is too large. Or too many files, do not need to be packaged with other replication tasks, you can directly use the current replication task as a replication job; if the judgment result is no, this indicates that the current replication task meets the packaging requirements, and then continue to obtain other non-reaching job submission restrictions. The replication task, until the sum of multiple replication tasks that do not meet the job submission limit reaches the job submission limit, packages multiple replication tasks that do not meet the job submission limit to generate a replication job.
结合多优先级队列,复制装置对复制任务进行打包处理的过程如图4所示,包括以下步骤:Combined with the multi-priority queue, the process of packaging the replication task by the replication device is as shown in FIG. 4, and includes the following steps:
401、判断是否当前优先级队列中读取复制任务,若是,即读取到复制任务,则执行步骤402;若否,即未读取到复制任务,则执行步骤408;401, determine whether the current priority queue to read the replication task, and if so, to read the replication task, step 402 is performed; if not, that is, the replication task is not read, step 408 is performed;
402、判断读取到的复制任务是否达到作业提交限制,若判断结果为是,则执行步骤403;若判断结果为否,则执行步骤404; 402, determining whether the read copy task reaches the job submission limit, if the determination result is yes, step 403 is performed; if the determination result is no, step 404 is performed;
可以执行以下至少一种判断操作:You can perform at least one of the following judgments:
判断读取到的复制任务包含的文件总个数是否达到文件总个数上限值;Determine whether the total number of files included in the copied task reaches the upper limit of the total number of files;
判断读取到的复制任务包含的文件总大小是否达到文件总大小上限值;Determine whether the total size of the file included in the copied task reaches the upper limit of the total file size;
若至少一个判断操作的判断结果均为否,确定读取到的复制任务未达到作业提交限制;若至少一个判断操作的判断结果均为是,则确定读取到的复制任务达到作业提交限制;If the judgment result of the at least one judgment operation is no, it is determined that the read copy task does not reach the job submission limit; if the judgment result of the at least one judgment operation is yes, it is determined that the read copy task reaches the job submission limit;
403、将读取到的复制任务放入当前优先级队列中,并将读取指针加1,返回执行步骤401;403, the read copy task is placed in the current priority queue, and the read pointer is incremented by 1, returning to step 401;
404、将读取到的复制任务加入当前作业队列中,并执行步骤405;404, the read replication task is added to the current job queue, and step 405 is performed;
405、判断当前作业队列中复制任务的总和是否达到作业提交限制,若判断结果为是,执行步骤406;若判断结果为否,执行步骤407;405, determining whether the sum of the replication tasks in the current job queue reaches the job submission limit, if the determination result is yes, step 406; if the determination result is no, step 407;
具体执行以下至少一个判断操作:Specifically perform at least one of the following judgment operations:
可以执行以下至少一种判断操作:You can perform at least one of the following judgments:
判断当前作业队列中所有复制任务包含的文件总个数是否达到文件总个数上限值;Determine whether the total number of files included in all replication tasks in the current job queue reaches the upper limit of the total number of files;
判断当前作业队列中所有复制任务包含文件总大小是否达到文件总大小上限值;Determine whether all the replication tasks in the current job queue include the total file size to reach the upper limit of the total file size;
若至少一个判断操作的判断结果均为否,确定当前作业队列中复制任务的总和未达到作业提交限制;若至少一个判断操作的判断结果均为是,则确定当前作业队列中复制任务的总和达到作业提交限制;If the judgment result of the at least one judgment operation is no, it is determined that the sum of the replication tasks in the current job queue does not reach the job submission limit; if the judgment result of the at least one judgment operation is yes, it is determined that the sum of the replication tasks in the current job queue reaches Job submission limit;
406、将当前作业队列中的复制任务打包为复制任务,并确定该复制作业的优先级,为该复制作业申请带宽资源,并提交该复制作业以启动复制,并执行步骤411。 406. Package the replication task in the current job queue as a replication task, determine a priority of the replication job, request a bandwidth resource for the replication job, and submit the replication job to start replication, and perform step 411.
407、将读取指针加1,返回执行步骤401;407, the read pointer is incremented by 1, returning to step 401;
408、判断当前作业队列是否为空,若判断结果为否,则执行步骤409;若判断结果为是,则执行步骤411。408. Determine whether the current job queue is empty. If the determination result is no, go to step 409. If the judgment result is yes, go to step 411.
409、判断等待次数是否超过预设次数上限值,若判断结果为否,则执行步骤410;若判断结果为是,则执行步骤411;409, determining whether the waiting time exceeds the preset number of upper limit, if the determination is no, proceed to step 410; if the determination is yes, then step 411;
410、将等待次数+1,并在等待300ms,返回执行步骤407。410. Wait for the number of times to wait for +1, and wait for 300 ms, and return to step 407.
411、结束此次操作。411. End this operation.
由上述可见,本实施例通过将若干个复制任务打包成一个复制作业提交执行,既有利于提高执行效率,又可以满足复制任务的及时性要求。It can be seen from the above that the present embodiment can improve the execution efficiency and meet the timeliness requirement of the replication task by packaging a plurality of replication tasks into one replication job.
图5为本申请又一实施例提供的集群数据复制装置的结构示意图。如图5所示,该装置包括:确定模块51、计算模块52和执行模块53。FIG. 5 is a schematic structural diagram of a cluster data replication apparatus according to another embodiment of the present disclosure. As shown in FIG. 5, the apparatus includes a determination module 51, a calculation module 52, and an execution module 53.
确定模块51,用于确定需要跨集群复制数据的至少一个复制任务。The determining module 51 is configured to determine at least one copy task that needs to replicate data across the cluster.
计算模块52,用于计算至少一个复制任务中各复制任务的优先级。The calculating module 52 is configured to calculate a priority of each copy task in the at least one copy task.
执行模块53,用于根据各复制任务的优先级,执行各复制任务。The executing module 53 is configured to execute each copy task according to the priority of each copy task.
在一可选实施方式中,确定模块51具体用于执行以下至少一种操作:In an optional implementation, the determining module 51 is specifically configured to perform at least one of the following operations:
定期轮询数据版本管理服务器,在发现有数据的版本发生变化时,确定有需要对版本发生变化的数据进行跨集群复制的复制任务;Periodically polling the data version management server to determine whether there is a need to perform a cross-cluster replication replication task for data with changed versions when a version of the data is found to change;
接收控制服务器在接收到复制任务通知消息时下发的复制任务;Receiving a replication task sent by the control server when receiving the replication task notification message;
其中,复制任务通知消息是第一业务在产生新版本数据时上报给控制服务器的,或者是需要数据的第二业务在确定数据在第二业务所在集群中的版本与数据所在源集群中的版本不一致时上报给控制服务器的。The replication task notification message is reported to the control server when the first service generates the new version data, or is the version of the second service that needs the data in determining the version of the data in the cluster where the second service is located and the source cluster in which the data is located. Reported to the control server when it is inconsistent.
在一可选实施方式中,计算模块52具体用于:In an optional implementation, the calculation module 52 is specifically configured to:
根据各复制任务的触发方式、各复制任务需要复制的数据的产生时间、以及各复制任务对应的源业务的重要度中的至少一个因素,计算各复制任务的优先级; Calculating the priority of each replication task according to at least one of a triggering manner of each replication task, a generation time of data to be copied by each replication task, and an importance of source services corresponding to each replication task;
其中,复制任务对应的源业务是指产生复制任务需要复制的数据的业务。The source service corresponding to the replication task refers to the service that generates data that needs to be copied by the replication task.
可选的,计算模块52进一步具体用于:Optionally, the calculating module 52 is further specifically configured to:
根据各复制任务的触发方式,确定各复制任务的第一优先级取值;Determining, according to the triggering manner of each replication task, the first priority value of each replication task;
根据各复制任务对应的源业务的重要度,确定各复制任务的第二优先级取值;Determining a second priority value of each replication task according to the importance of the source service corresponding to each replication task;
根据各复制任务需要复制的数据的产生时间,确定各复制任务的第三优先级取值;Determining the third priority value of each replication task according to the generation time of the data to be copied by each replication task;
根据各复制任务的第一优先级取值、第二优先级取值以及第三优先级取值,生成各复制任务的优先级。The priority of each replication task is generated according to the first priority value, the second priority value, and the third priority value of each replication task.
更进一步,计算模块52在根据各复制任务需要复制的数据的产生时间,确定各复制任务的第三优先级取值时,具体用于:根据公式(1),确定各复制任务的第三优先级取值。关于公式(1)的描述具体参见前述实施例,在此不再赘述。Further, when the calculation module 52 determines the third priority value of each replication task according to the generation time of the data to be copied according to each replication task, the calculation module 52 is specifically configured to: determine the third priority of each replication task according to formula (1). Level value. The description of the formula (1) is specifically referred to the foregoing embodiment, and details are not described herein again.
更进一步,计算模块52在根据各复制任务的第一优先级取值、第二优先级取值以及第三优先级取值,生成各复制任务的优先级时,具体用于:Further, when the calculation module 52 generates the priority of each replication task according to the first priority value, the second priority value, and the third priority value of each replication task, the calculation module 52 is specifically configured to:
按照由高位到低位的顺序,将各复制任务的第一优先级取值、第二优先级取值以及第三优先级取值拼接在一起,以生成各复制任务的优先级。The first priority value, the second priority value, and the third priority value of each replication task are spliced together in order from the high to the low to generate the priority of each replication task.
在一可选实施方式中,执行模块53具体用于:In an optional implementation, the executing module 53 is specifically configured to:
根据各复制任务的优先级,为各复制任务申请带宽资源;Apply bandwidth resources to each replication task according to the priority of each replication task.
基于所申请到的带宽资源,执行各复制任务。Each copy task is executed based on the requested bandwidth resource.
进一步,执行模块53在根据各复制任务的优先级,为各复制任务申请带宽资源时,具体用于:Further, when the execution module 53 requests bandwidth resources for each replication task according to the priority of each replication task, the execution module 53 is specifically configured to:
根据各复制任务的优先级以及预先设置的作业提交限制,对各复制任务进行打包处理,以形成至少一个复制作业; Each copy task is packaged according to a priority of each copy task and a preset job submission limit to form at least one copy job;
根据至少一个复制作业中各复制作业所包含的复制任务的优先级,确定各复制作业的优先级;Determining the priority of each copy job based on the priority of the copy tasks included in each copy job in at least one copy job;
根据各复制作业的优先级,为各复制作业所包含的复制任务申请带宽资源。Request bandwidth resources for the replication tasks included in each replication job based on the priority of each replication job.
更进一步,执行模块53在根据各复制任务的优先级以及预先设置的作业提交限制,对各复制任务进行打包处理,以形成至少一个复制作业时,具体用于:Further, the execution module 53 performs a packaging process on each of the copy tasks according to the priority of each copy task and the preset job submission limit to form at least one copy job, specifically for:
按照优先级由高到低的顺序,依次获取复制任务作为当前复制任务;The replication task is sequentially acquired as the current replication task according to the order of priority from high to low;
若当前复制任务未达到作业提交限制,则继续获取其它未达到作业提交限制的复制任务,直到未达到作业提交限制的多个复制任务的总和达到作业提交限制为止,将未达到作业提交限制的多个复制任务打包,以生成一个复制作业;If the current replication task does not meet the job submission limit, continue to obtain other replication tasks that do not meet the job submission limit. Until the sum of multiple replication tasks that do not meet the job submission limit reaches the job submission limit, the job submission limit will not be reached. Packing tasks are packaged to generate a copy job;
若当前复制任务达到作业提交限制,则直接将当前复制任务作为一个复制作业。If the current replication task reaches the job submission limit, the current replication task is directly treated as a replication job.
可选的,上述作业提交限制包括以下至少一个:Optionally, the job submission restriction includes at least one of the following:
文件总个数上限值;The total number of files is the upper limit;
文件总大小上限值。The upper limit of the total file size.
本实施例提供的集群数据复制装置,在确定需要跨集群复制数据的复制任务之后,计算各复制任务的优先级,然后根据各复制任务的优先级,执行各复制任务。由此可见,本申请在跨域带宽有限的条件下,按照复制任务的优先级对复制任务进行调度,优先调度优先级较高的复制任务,能够对复制任务进行合理调度,有利于实现数据的快速复制。The cluster data replication apparatus provided in this embodiment calculates the priority of each replication task after determining the replication task that needs to replicate data across the cluster, and then performs each replication task according to the priority of each replication task. It can be seen that, under the condition that the cross-domain bandwidth is limited, the replication task is scheduled according to the priority of the replication task, and the replication task with higher priority is preferentially scheduled, and the replication task can be reasonably scheduled, which is beneficial to realizing data. Quick copy.
除上述技术方案之外,本申请还针对跨集群复制任务提供了一种优先级确定方法,用以确定跨集群复制任务的优先级。其中,优先级确定方法的流程如图6所示,包括: In addition to the above technical solutions, the present application also provides a priority determination method for cross-cluster replication tasks to determine the priority of cross-cluster replication tasks. The process of the priority determining method is as shown in FIG. 6, and includes:
601、获取需要跨集群复制数据的复制任务的触发方式、复制任务需要复制的数据的产生时间、以及复制任务对应的源业务的重要度中的至少一个因素,复制任务对应的源业务是指产生该复制任务需要复制的数据的业务。601. Acquire at least one of a triggering manner of a replication task that needs to replicate data across the cluster, a generation time of the data to be copied by the replication task, and an importance of the source service corresponding to the replication task, where the source service corresponding to the replication task is generated. The replication task requires replication of the data for the business.
602、根据上述至少一个因素,计算复制任务的优先级。602. Calculate a priority of the replication task according to at least one of the foregoing factors.
上述复制任务的触发方式主要是指上述确定复制任务的三种方式,例如扫描触发方式、事件触发方式和需求触发方式。不同触发方式的复制任务具有不同的优先级。例如,可以设置需求触发方式触发的复制任务的优先级最高,事件触发方式触发的复制任务的优先级次之,扫描触发方式触发的复制任务的优先级最低,但不限于此。The triggering manner of the foregoing replication task mainly refers to the foregoing three methods for determining a replication task, such as a scan trigger mode, an event trigger mode, and a demand trigger mode. Replication tasks with different trigger modes have different priorities. For example, the priority of the replication task triggered by the demand trigger mode is the highest, the priority of the replication task triggered by the event trigger mode is the second, and the priority of the replication task triggered by the scan trigger mode is the lowest, but is not limited thereto.
上述复制任务对应的源业务是指产生复制任务需要复制的数据的业务。举例说明,假设集群A中的业务a产生数据,需要将该数据从集群A复制到集群B和C中,则复制任务需要复制的数据即为业务a产生的数据,业务a即为复制任务对应的源业务。一般来说,不同业务的重要度并不相同,重要度越高的业务产生的数据的重要度相对也会较高,所以用于复制重要度较高的业务产生的数据的复制任务的优先级就越高。The source service corresponding to the above replication task refers to the service that generates data that needs to be copied by the replication task. For example, if the service a in the cluster A generates data, and the data needs to be copied from the cluster A to the clusters B and C, the data to be copied by the replication task is the data generated by the service a, and the service a is the corresponding to the replication task. Source business. In general, the importance of different services is different. The higher the importance of the data generated by the service, the higher the importance of the data. Therefore, the priority of the replication task for copying the data generated by the more important business is higher. The higher.
上述复制任务需要复制的数据的产生时间主要用于表示复制任务需要复制的数据的新鲜程度,一般来说,数据产生时间越晚,数据越新,则用于复制新鲜程度较高的数据的复制任务的优先级就越高。The generation time of the data to be copied by the above replication task is mainly used to indicate the freshness of the data that the replication task needs to copy. Generally speaking, the later the data is generated, the newer the data is, the copying is used to copy the data with higher freshness. The priority of the task is higher.
在一具体实施方式中,可以采用上述三个因素中的一个因素,确定各复制任务的优先级。例如,仅根据各复制任务的触发方式,确定各复制任务的优先级。又例如,仅根据各复制任务对应的源业务的重要度,确定各复制任务的优先级。又例如,仅根据各复制任务需要复制的数据的产生时间,确定各复制任务的优先级。In a specific embodiment, one of the above three factors may be used to determine the priority of each replication task. For example, the priority of each replication task is determined only according to the trigger mode of each replication task. For another example, the priority of each replication task is determined only according to the importance of the source service corresponding to each replication task. For another example, the priority of each copy task is determined based only on the generation time of the data to be copied for each copy task.
在另一具体实施方式中,可以结合使用上述三个因素中的任意两个因 素,确定各复制任务的优先级。具体可以根据每个因素计算出一个优先级取值,然后对两个优先级取值进行加权平均,获得复制任务的最终优先级。其中,可以预先为不同因素配置不同的权重。In another embodiment, any two of the above three factors may be used in combination Determine the priority of each replication task. Specifically, a priority value can be calculated according to each factor, and then the weighted average of the two priority values is obtained to obtain the final priority of the replication task. Among them, different weights can be configured in advance for different factors.
例如,可以结合各复制任务对应的源业务的重要度以及各复制任务的触发方式,则假设根据复制任务对应的源业务的重要度,确定复制任务的优先级取值为P1,根据复制任务的触发方式,确定复制任务的优先级取值为P2,预先为源业务的重要度和触发方式确定的权重分别为w1和w2,则复制任务的最终优先级为:w1*P1+w2*P2。For example, the importance of the source service corresponding to each replication task and the triggering mode of each replication task may be combined, and it is determined that the priority of the replication task is P1 according to the importance of the source service corresponding to the replication task, according to the replication task. The triggering mode determines that the priority of the replication task is P2. The weights determined in advance for the importance and trigger mode of the source service are w1 and w2, respectively. The final priority of the replication task is w1*P1+w2*P2.
当然,也可以结合复制任务的触发方式和复制任务需要复制的数据的产生时间,也可以结合复制任务对应的源业务的重要度和复制任务需要复制的数据的产生时间,具体计算方式同上,不再赘述。Of course, the triggering manner of the replication task and the generation time of the data to be copied by the replication task may be combined, and the importance of the source service corresponding to the replication task and the generation time of the data to be copied by the replication task may be combined, and the specific calculation manner is the same as above. Let me repeat.
在又一具体实施方式中,可以同时结合各复制任务的触发方式、各复制任务需要复制的数据的产生时间以及各复制任务对应的源业务的重要度,计算复制任务的优先级。In another embodiment, the priority of the replication task may be calculated by combining the triggering manner of each replication task, the generation time of the data to be copied by each replication task, and the importance of the source service corresponding to each replication task.
具体的,复制装置可以根据各复制任务的触发方式,确定各复制任务的第一优先级取值;根据复制任务对应的源业务的重要度,确定复制任务的第二优先级取值;根据复制任务需要复制的数据的产生时间,确定复制任务的第三优先级取值;根据复制任务的第一优先级取值、第二优先级取值以及第三优先级取值,生成复制任务的优先级。Specifically, the copying device may determine the value of the first priority of each of the replication tasks according to the triggering manner of the replication task, and determine the second priority value of the replication task according to the importance of the source service corresponding to the replication task; The time at which the task needs to be copied, determines the third priority of the replication task, and generates the priority of the replication task according to the first priority value, the second priority value, and the third priority value of the replication task. level.
可选的,复制装置可以预先为复制任务对应的源业务的重要度、复制任务的触发方式以及复制任务需要复制的数据的产生时间三个因素配置权重,例如分别为w1、w2、w3。基于此,复制装置可以根据对应因素的权重,对复制任务的第一优先级取值、第二优先级取值以及第三优先级取值进行加权平均,以生成复制任务的优先级。例如,复制任务的优先级=w1*第一优先级取值+w2*第二优先级取值+w3*第三优先级取值。 Optionally, the copying device may pre-set the weights for the importance of the source service corresponding to the replication task, the triggering manner of the replication task, and the generation time of the data to be copied by the replication task, for example, w1, w2, and w3, respectively. Based on this, the copying apparatus may perform weighted averaging on the first priority value, the second priority value, and the third priority value of the copy task according to the weight of the corresponding factor to generate a priority of the copy task. For example, the priority of the replication task = w1 * the first priority value + w2 * the second priority value + w3 * the third priority value.
可选的,复制装置也可以按照由高位到低位的顺序,将各复制任务的第一优先级取值、第二优先级取值以及第三优先级取值拼接在一起,以生成复制任务的优先级。Optionally, the copying device may also stitch the first priority value, the second priority value, and the third priority value of each replication task in an order from high to low to generate a replication task. priority.
例如,预先定义触发方式对应的优先级取值的范围为[0,2],其中需求触发方式对应的优先级取值为0,事件触发方式对应的优先级取值为1,扫描触发方式对应的优先级取值为2。基于此,若复制任务的触发方式为需求触发方式,则可以确定该复制任务的第一优先级取值为0,若复制任务的触发方式为事件触发方式,则可以确定该复制任务的第一优先级取值为1,若复制任务的触发方式为扫描触发方式,则可以确定该复制任务的第一优先级取值为2。为便于后续描述,将第一优先级取值记为Pt。For example, the priority of the triggering mode is set to [0, 2], where the priority of the triggering mode is 0, and the priority of the event triggering mode is 1, and the scanning trigger mode corresponds to The priority value is 2. Based on this, if the triggering mode of the replication task is the demand triggering mode, the first priority of the replication task is determined to be 0. If the triggering mode of the replication task is the event triggering mode, the first task of the replication task may be determined. The priority of the replication task is 1. If the triggering mode of the replication task is the scan trigger mode, you can determine that the first priority of the replication task is 2. For the convenience of subsequent description, the first priority value is recorded as Pt.
例如,预先定义源业务的重要度对应的优先级取值的范围为[0,9],具体可以根据源业务的重要度进行设定,一般来说,源业务的重要度越高,对应的优先级取值越低。其中,复制任务的第二优先级取值为0-9中任一数值。为便于后续描述,将第一优先级取值记为Pp。For example, the priority value of the priority of the source service is defined as [0, 9], which can be set according to the importance of the source service. Generally, the importance of the source service is higher. The lower the priority value. The second priority of the replication task is any value from 0-9. For the convenience of subsequent description, the first priority value is recorded as Pp.
又例如,预先定义需要复制的数据的产生时间对应的优先级取值的范围为[0,9]。可选的,复制装置可以根据公式(1),确定各复制任务的第三优先级取值。关于公式(1)可参见前面描述,在此不再赘述。For another example, the priority value corresponding to the generation time of the data to be copied is defined as [0, 9]. Optionally, the copying device may determine, according to formula (1), a third priority value of each copy task. For the formula (1), refer to the foregoing description, and details are not described herein again.
基于上述,复制装置可以将上述优先级取值组成三位数字,其中,百位,十位,个位依次为Pt,Pp,Pd,该三位数字即为复制任务的优先级,其取值范围为[000,299],该三位数字越小,表示对应复制任务的优先级越高。Based on the above, the copying device may form the above-mentioned priority values into three digits, wherein the hundred digits, the ten digits, and the single digits are Pt, Pp, Pd, and the three digits are the priority of the copying task, and the value thereof is The range is [000, 299], and the smaller the three digits, the higher the priority of the corresponding copy task.
本实施例可以计算出跨集群的复制任务的优先级,为后续基于复制任务的优先级的复制任务处理过程(例如复制任务调度过程)提供条件。In this embodiment, the priority of the replication task across the cluster can be calculated, and the conditions for the subsequent replication task processing based on the priority of the replication task (for example, the replication task scheduling process) are provided.
图7为本申请又一实施例提供的优先级确定装置的结构示意图。如图7所示,该装置包括:信息获取模块71和优先级计算模块72。 FIG. 7 is a schematic structural diagram of a priority determining apparatus according to another embodiment of the present disclosure. As shown in FIG. 7, the apparatus includes an information acquisition module 71 and a priority calculation module 72.
信息获取模块71,用于获取需要跨集群复制数据的复制任务的触发方式、复制任务需要复制的数据的产生时间、以及复制任务对应的源业务的重要度中的至少一个因素,复制任务对应的源业务是指产生该复制任务需要复制的数据的业务。The information obtaining module 71 is configured to acquire at least one of a triggering manner of a replication task that needs to replicate data across the cluster, a generation time of the data to be copied by the replication task, and an importance of the source service corresponding to the replication task, where the replication task corresponds The source service refers to the service that generates the data that the replication task needs to replicate.
优先级计算模块72,用于根据信息获取模块71获取的至少一个因素,计算复制任务的优先级。The priority calculation module 72 is configured to calculate a priority of the replication task according to at least one factor acquired by the information acquisition module 71.
上述复制任务的触发方式主要是指上述确定复制任务的三种方式,例如扫描触发方式、事件触发方式和需求触发方式。不同触发方式的复制任务具有不同的优先级。例如,可以设置需求触发方式触发的复制任务的优先级最高,事件触发方式触发的复制任务的优先级次之,扫描触发方式触发的复制任务的优先级最低,但不限于此。The triggering manner of the foregoing replication task mainly refers to the foregoing three methods for determining a replication task, such as a scan trigger mode, an event trigger mode, and a demand trigger mode. Replication tasks with different trigger modes have different priorities. For example, the priority of the replication task triggered by the demand trigger mode is the highest, the priority of the replication task triggered by the event trigger mode is the second, and the priority of the replication task triggered by the scan trigger mode is the lowest, but is not limited thereto.
上述复制任务对应的源业务是指产生复制任务需要复制的数据的业务。举例说明,假设集群A中的业务a产生数据,需要将该数据从集群A复制到集群B和C中,则复制任务需要复制的数据即为业务a产生的数据,业务a即为复制任务对应的源业务。一般来说,不同业务的重要度并不相同,重要度越高的业务产生的数据的重要度相对也会较高,所以用于复制重要度较高的业务产生的数据的复制任务的优先级就越高。The source service corresponding to the above replication task refers to the service that generates data that needs to be copied by the replication task. For example, if the service a in the cluster A generates data, and the data needs to be copied from the cluster A to the clusters B and C, the data to be copied by the replication task is the data generated by the service a, and the service a is the corresponding to the replication task. Source business. In general, the importance of different services is different. The higher the importance of the data generated by the service, the higher the importance of the data. Therefore, the priority of the replication task for copying the data generated by the more important business is higher. The higher.
上述复制任务需要复制的数据的产生时间主要用于表示复制任务需要复制的数据的新鲜程度,一般来说,数据产生时间越晚,数据越新,则用于复制新鲜程度较高的数据的复制任务的优先级就越高。The generation time of the data to be copied by the above replication task is mainly used to indicate the freshness of the data that the replication task needs to copy. Generally speaking, the later the data is generated, the newer the data is, the copying is used to copy the data with higher freshness. The priority of the task is higher.
在一具体实施方式中,信息获取模块71可以获取上述三个因素中的一个因素,优先级计算模块72具体根据信息获取模块71获取的因素确定复制任务的优先级。例如,优先级计算模块72仅根据复制任务的触发方式,确定复制任务的优先级。又例如,优先级计算模块72仅根据复制任务对应的源业务的重要度,确定复制任务的优先级。又例如,优先级计算 模块72仅根据复制任务需要复制的数据的产生时间,确定复制任务的优先级。In an embodiment, the information obtaining module 71 may obtain one of the above three factors, and the priority calculating module 72 determines the priority of the copying task according to the factor acquired by the information acquiring module 71. For example, the priority calculation module 72 determines the priority of the replication task based only on the triggering manner of the replication task. For another example, the priority calculation module 72 determines the priority of the replication task based only on the importance of the source service corresponding to the replication task. Another example, priority calculation The module 72 determines the priority of the replication task based only on the generation time of the data that the replication task needs to replicate.
在另一具体实施方式中,信息获取模块71可以获取上述三个因素中的任意两个因素,优先级计算模块72具体根据信息获取模块71获取的两个因素确定各复制任务的优先级。优先级计算模块72具体可以根据每个因素计算出一个优先级取值,然后对两个优先级取值进行加权平均,获得复制任务的最终优先级。其中,可以预先为不同因素配置不同的权重。In another embodiment, the information obtaining module 71 may obtain any two of the above three factors, and the priority calculating module 72 determines the priority of each copy task according to two factors acquired by the information acquiring module 71. The priority calculation module 72 can calculate a priority value according to each factor, and then perform weighted averaging on the two priority values to obtain the final priority of the replication task. Among them, different weights can be configured in advance for different factors.
例如,优先级计算模块72可以结合复制任务对应的源业务的重要度以及复制任务的触发方式,则假设根据复制任务对应的源业务的重要度,确定复制任务的优先级取值为P1,根据复制任务的触发方式,确定复制任务的优先级取值为P2,预先为源业务的重要度和触发方式确定的权重分别为w1和w2,则复制任务的最终优先级为:w1*P1+w2*P2。For example, the priority calculation module 72 may combine the importance of the source service corresponding to the replication task and the triggering mode of the replication task, and determine that the priority of the replication task is P1 according to the importance of the source service corresponding to the replication task, according to The triggering mode of the replication task determines that the priority of the replication task is P2. The weights determined for the importance and trigger mode of the source service are w1 and w2 respectively. The final priority of the replication task is w1*P1+w2. *P2.
当然,也可以结合复制任务的触发方式和复制任务需要复制的数据的产生时间,也可以结合复制任务对应的源业务的重要度和复制任务需要复制的数据的产生时间,具体计算方式同上,不再赘述。Of course, the triggering manner of the replication task and the generation time of the data to be copied by the replication task may be combined, and the importance of the source service corresponding to the replication task and the generation time of the data to be copied by the replication task may be combined, and the specific calculation manner is the same as above. Let me repeat.
在又一具体实施方式中,信息获取模块71可以获取上述三个因素,优先级计算模块72可以同时结合复制任务的触发方式、复制任务需要复制的数据的产生时间以及复制任务对应的源业务的重要度,计算复制任务的优先级。In another embodiment, the information acquiring module 71 can obtain the foregoing three factors, and the priority calculating module 72 can simultaneously combine the triggering manner of the replication task, the generation time of the data that the replication task needs to be copied, and the source service corresponding to the replication task. Importance, calculate the priority of the replication task.
具体的,优先级计算模块72可以根据复制任务的触发方式,确定复制任务的第一优先级取值;根据复制任务对应的源业务的重要度,确定复制任务的第二优先级取值;根据复制任务需要复制的数据的产生时间,确定复制任务的第三优先级取值;根据复制任务的第一优先级取值、第二优先级取值以及第三优先级取值,生成复制任务的优先级。Specifically, the priority calculation module 72 may determine the first priority value of the replication task according to the triggering manner of the replication task, and determine the second priority value of the replication task according to the importance of the source service corresponding to the replication task; The generation time of the data to be copied by the replication task, determining the third priority value of the replication task; generating the replication task according to the first priority value, the second priority value, and the third priority value of the replication task priority.
可选的,可以预先为复制任务对应的源业务的重要度、复制任务的触 发方式以及复制任务需要复制的数据的产生时间三个因素配置权重,例如分别为w1、w2、w3。基于此,优先级计算模块72可以根据对应因素的权重,对复制任务的第一优先级取值、第二优先级取值以及第三优先级取值进行加权平均,以生成复制任务的优先级。例如,复制任务的优先级=w1*第一优先级取值+w2*第二优先级取值+w3*第三优先级取值。Optionally, the importance of the source service corresponding to the replication task and the touch of the replication task may be pre-replicated The sending time and the generation time of the data to be copied by the copying task are three factors, such as w1, w2, and w3. Based on this, the priority calculation module 72 may perform weighted averaging on the first priority value, the second priority value, and the third priority value of the replication task according to the weight of the corresponding factor to generate a priority of the replication task. . For example, the priority of the replication task = w1 * the first priority value + w2 * the second priority value + w3 * the third priority value.
可选的,优先级计算模块72也可以按照由高位到低位的顺序,将复制任务的第一优先级取值、第二优先级取值以及第三优先级取值拼接在一起,以生成复制任务的优先级。Optionally, the priority calculation module 72 may also splicing the first priority value, the second priority value, and the third priority value of the replication task in order from high to low to generate a replication. The priority of the task.
例如,预先定义触发方式对应的优先级取值的范围为[0,2],其中需求触发方式对应的优先级取值为0,事件触发方式对应的优先级取值为1,扫描触发方式对应的优先级取值为2。基于此,若复制任务的触发方式为需求触发方式,则可以确定该复制任务的第一优先级取值为0,若复制任务的触发方式为事件触发方式,则可以确定该复制任务的第一优先级取值为1,若复制任务的触发方式为扫描触发方式,则可以确定该复制任务的第一优先级取值为2。为便于后续描述,将第一优先级取值记为Pt。For example, the priority of the triggering mode is set to [0, 2], where the priority of the triggering mode is 0, and the priority of the event triggering mode is 1, and the scanning trigger mode corresponds to The priority value is 2. Based on this, if the triggering mode of the replication task is the demand triggering mode, the first priority of the replication task is determined to be 0. If the triggering mode of the replication task is the event triggering mode, the first task of the replication task may be determined. The priority of the replication task is 1. If the triggering mode of the replication task is the scan trigger mode, you can determine that the first priority of the replication task is 2. For the convenience of subsequent description, the first priority value is recorded as Pt.
例如,预先定义源业务的重要度对应的优先级取值的范围为[0,9],具体可以根据源业务的重要度进行设定,一般来说,源业务的重要度越高,对应的优先级取值越低。其中,复制任务的第二优先级取值为0-9中任一数值。为便于后续描述,将第一优先级取值记为Pp。For example, the priority value of the priority of the source service is defined as [0, 9], which can be set according to the importance of the source service. Generally, the importance of the source service is higher. The lower the priority value. The second priority of the replication task is any value from 0-9. For the convenience of subsequent description, the first priority value is recorded as Pp.
又例如,预先定义需要复制的数据的产生时间对应的优先级取值的范围为[0,9]。可选的,复制装置可以根据公式(1),确定各复制任务的第三优先级取值。关于公式(1)可参见前面描述,在此不再赘述。For another example, the priority value corresponding to the generation time of the data to be copied is defined as [0, 9]. Optionally, the copying device may determine, according to formula (1), a third priority value of each copy task. For the formula (1), refer to the foregoing description, and details are not described herein again.
基于上述,优先级计算模块72可以将上述优先级取值组成三位数字,其中,百位,十位,个位依次为Pt,Pp,Pd,该三位数字即为复制任务的优先级,其取值范围为[000,299],该三位数字越小,表示对应复制任 务的优先级越高。Based on the above, the priority calculation module 72 may form the priority value into a three-digit number, wherein the hundred, ten, and one digits are Pt, Pp, and Pd, and the three digits are priorities of the replication task. Its value range is [000, 299], the smaller the three digits, the corresponding copy The higher the priority of the service.
本实施例提供的优先级确定装置,可以计算出跨集群的复制任务的优先级,为后续基于复制任务的优先级的复制任务处理过程(例如复制任务调度过程)提供条件。The priority determining apparatus provided in this embodiment can calculate the priority of the replication task across the cluster, and provide conditions for the subsequent replication task processing process based on the priority of the replication task (for example, the replication task scheduling process).
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。One of ordinary skill in the art will appreciate that all or part of the steps to implement the various method embodiments described above may be accomplished by hardware associated with the program instructions. The aforementioned program can be stored in a computer readable storage medium. The program, when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。 Finally, it should be noted that the above embodiments are only for explaining the technical solutions of the present application, and are not limited thereto; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that The technical solutions described in the foregoing embodiments may be modified, or some or all of the technical features may be equivalently replaced; and the modifications or substitutions do not deviate from the technical solutions of the embodiments of the present application. range.

Claims (22)

  1. 一种集群数据复制方法,其特征在于,包括:A cluster data replication method, comprising:
    确定需要跨集群复制数据的至少一个复制任务;Identify at least one replication task that requires data to be replicated across the cluster;
    计算所述至少一个复制任务中各复制任务的优先级;Calculating a priority of each of the at least one replication task;
    根据所述各复制任务的优先级,执行所述各复制任务。Each of the copy tasks is executed according to the priority of each of the copy tasks.
  2. 根据权利要求1所述的方法,其特征在于,所述确定需要跨集群复制数据的至少一个复制任务,包括以下至少一种操作:The method of claim 1, wherein the determining at least one replication task that requires data replication across the cluster comprises at least one of the following operations:
    定期轮询数据版本管理服务器,在发现有数据的版本发生变化时,确定有需要对所述版本发生变化的数据进行跨集群复制的复制任务;Periodically polling the data version management server, and determining that there is a need to perform a cross-cluster replication replication task on the data whose version changes when the version of the data is found to change;
    获取控制服务器根据收到的复制任务通知消息所下发的复制任务;Obtaining a replication task sent by the control server according to the received replication task notification message;
    其中,所述复制任务通知消息是第一业务在产生新版本数据时上报给所述控制服务器的,或者是需要数据的第二业务在确定所述数据在所述第二业务所在集群中的版本与所述数据所在源集群中的版本不一致时上报给所述控制服务器的。The copy task notification message is reported to the control server when the first service generates the new version data, or the second service that needs the data is determined to be the version of the data in the cluster where the second service is located. Reported to the control server when the version in the source cluster where the data is inconsistent is reported.
  3. 根据权利要求1所述的方法,其特征在于,所述计算所述至少一个复制任务中各复制任务的优先级,包括:The method according to claim 1, wherein the calculating the priority of each of the at least one copy task comprises:
    根据所述各复制任务的触发方式、所述各复制任务需要复制的数据的产生时间、以及所述各复制任务对应的源业务的重要度中的至少一个因素,计算所述各复制任务的优先级;Calculating the priority of each of the replication tasks according to at least one of a triggering manner of each of the replication tasks, a generation time of the data to be copied by the replication tasks, and an importance of the source services corresponding to the replication tasks. level;
    其中,所述复制任务对应的源业务是指产生所述复制任务需要复制的数据的业务。The source service corresponding to the replication task refers to a service that generates data that needs to be copied by the replication task.
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述各复制任务的触发方式、所述各复制任务需要复制的数据的产生时间、以及所述各复制任务对应的源业务的重要度,计算所述各复制任务的优先级,包括:The method according to claim 3, wherein the triggering manner according to the replication tasks, the generation time of data to be copied by the replication tasks, and the importance of source services corresponding to the replication tasks Degree, calculating the priority of each copy task, including:
    根据所述各复制任务的触发方式,确定所述各复制任务的第一优先级 取值;Determining, according to the triggering manner of each replication task, a first priority of each replication task Value
    根据所述各复制任务对应的源业务的重要度,确定所述各复制任务的第二优先级取值;Determining, according to the importance of the source service corresponding to each of the replication tasks, a value of the second priority of each of the replication tasks;
    根据所述各复制任务需要复制的数据的产生时间,确定所述各复制任务的第三优先级取值;Determining a third priority value of each of the replication tasks according to a generation time of the data to be copied by each of the replication tasks;
    根据所述各复制任务的第一优先级取值、第二优先级取值以及第三优先级取值,生成所述各复制任务的优先级。The priority of each of the replication tasks is generated according to the first priority value, the second priority value, and the third priority value of each of the replication tasks.
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述各复制任务需要复制的数据的产生时间,确定所述各复制任务的第三优先级取值,包括:The method according to claim 4, wherein the determining the third priority value of each of the replication tasks according to the generation time of the data to be copied by the replication tasks comprises:
    根据公式Pd=9*t/T,确定所述各复制任务的第三优先级取值;Determining, according to the formula P d =9*t/T, the third priority value of each copy task;
    其中,t表示所述各复制任务需要复制的数据的产生时间;Where t represents the time at which the data to be copied by each of the replication tasks is generated;
    T表示所述各复制任务需要复制的数据的生命周期,且0<t<T;T represents the life cycle of the data that each copy task needs to copy, and 0<t<T;
    Pd表示所述各复制任务的第三优先级取值。P d represents the third priority value of each copy task.
  6. 根据权利要求4所述的方法,其特征在于,所述根据所述各复制任务的第一优先级取值、第二优先级取值以及第三优先级取值,生成所述各复制任务的优先级,包括:The method according to claim 4, wherein the generating, according to the first priority value, the second priority value, and the third priority value of each of the replication tasks, generating the replication tasks Priority, including:
    按照由高位到低位的顺序,将所述各复制任务的第一优先级取值、第二优先级取值以及第三优先级取值拼接在一起,以生成所述各复制任务的优先级。The first priority value, the second priority value, and the third priority value of the respective replication tasks are spliced together in order from the high to the low to generate the priorities of the replication tasks.
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述根据所述各复制任务的优先级,执行所述各复制任务,包括:The method according to any one of claims 1-6, wherein the performing the each of the replication tasks according to the priority of the replication tasks comprises:
    根据所述各复制任务的优先级,为所述各复制任务申请带宽资源;Applying bandwidth resources to the replication tasks according to the priorities of the replication tasks;
    基于所申请到的带宽资源,执行所述各复制任务。Each of the replication tasks is performed based on the requested bandwidth resource.
  8. 根据权利要求7所述的方法,其特征在于,所述根据所述各复制 任务的优先级,为所述各复制任务申请带宽资源,包括:The method of claim 7 wherein said copying Priority of the task, applying for bandwidth resources for each of the replication tasks, including:
    根据所述各复制任务的优先级以及预先设置的作业提交限制,对所述各复制任务进行打包处理,以形成至少一个复制作业;And each of the copy tasks is packaged according to a priority of each of the copy tasks and a preset job submission limit to form at least one copy job;
    根据所述至少一个复制作业中各复制作业所包含的复制任务的优先级,确定所述各复制作业的优先级;Determining a priority of each copy job according to a priority of a copy task included in each copy job in the at least one copy job;
    根据所述各复制作业的优先级,为所述各复制作业所包含的复制任务申请带宽资源。The bandwidth resource is requested for the copy task included in each copy job according to the priority of each copy job.
  9. 根据权利要求8所述的方法,其特征在于,所述根据所述各复制任务的优先级以及预先设置的作业提交限制,对所述各复制任务进行打包处理,以形成至少一个复制作业,包括:The method according to claim 8, wherein said copying tasks are packaged according to a priority of said each copy task and a preset job submission limit to form at least one copy job, including :
    按照优先级由高到低的顺序,依次获取复制任务作为当前复制任务;The replication task is sequentially acquired as the current replication task according to the order of priority from high to low;
    若当前复制任务未达到所述作业提交限制,则继续获取其它未达到所述作业提交限制的复制任务,直到未达到所述作业提交限制的多个复制任务的总和达到所述作业提交限制为止,将所述未达到所述作业提交限制的多个复制任务打包,以生成一个复制作业;If the current copy task does not reach the job submission limit, continue to obtain other copy tasks that do not reach the job submission limit, until the sum of the plurality of copy tasks that do not reach the job submission limit reaches the job submission limit. Packaging the plurality of copy tasks that do not meet the job submission limit to generate a copy job;
    若当前复制任务达到所述作业提交限制,则直接将所述当前复制任务作为一个复制作业。If the current copy task reaches the job submission limit, the current copy task is directly used as a copy job.
  10. 根据权利要求8所述的方法,其特征在于,所述作业提交限制包括以下至少一个:The method of claim 8 wherein said job submission limit comprises at least one of:
    文件总个数上限值;The total number of files is the upper limit;
    文件总大小上限值。The upper limit of the total file size.
  11. 一种集群数据复制装置,其特征在于,包括:A cluster data replication device, comprising:
    确定模块,用于确定需要跨集群复制数据的至少一个复制任务;Determining a module for determining at least one replication task that requires data to be replicated across the cluster;
    计算模块,用于计算所述至少一个复制任务中各复制任务的优先级;a calculation module, configured to calculate a priority of each of the at least one replication task;
    执行模块,用于根据所述各复制任务的优先级,执行所述各复制任务。 And an execution module, configured to execute each of the replication tasks according to a priority of each of the replication tasks.
  12. 根据权利要求11所述的装置,其特征在于,所述确定模块具体用于执行以下至少一种操作:The apparatus according to claim 11, wherein the determining module is specifically configured to perform at least one of the following operations:
    定期轮询数据版本管理服务器,在发现有数据的版本发生变化时,确定有需要对所述版本发生变化的数据进行跨集群复制的复制任务;Periodically polling the data version management server, and determining that there is a need to perform a cross-cluster replication replication task on the data whose version changes when the version of the data is found to change;
    获取控制服务器根据收到的复制任务通知消息所下发的复制任务;Obtaining a replication task sent by the control server according to the received replication task notification message;
    其中,所述复制任务通知消息是第一业务在产生新版本数据时上报给所述控制服务器的,或者是需要数据的第二业务在确定所述数据在所述第二业务所在集群中的版本与所述数据所在源集群中的版本不一致时上报给所述控制服务器的。The copy task notification message is reported to the control server when the first service generates the new version data, or the second service that needs the data is determined to be the version of the data in the cluster where the second service is located. Reported to the control server when the version in the source cluster where the data is inconsistent is reported.
  13. 根据权利要求11所述的装置,其特征在于,所述计算模块具体用于:The device according to claim 11, wherein the calculation module is specifically configured to:
    根据所述各复制任务的触发方式、所述各复制任务需要复制的数据的产生时间、以及所述各复制任务对应的源业务的重要度中的至少一个因素,计算所述各复制任务的优先级;Calculating the priority of each of the replication tasks according to at least one of a triggering manner of each of the replication tasks, a generation time of the data to be copied by the replication tasks, and an importance of the source services corresponding to the replication tasks. level;
    其中,所述复制任务对应的源业务是指产生所述复制任务需要复制的数据的业务。The source service corresponding to the replication task refers to a service that generates data that needs to be copied by the replication task.
  14. 根据权利要求13所述的装置,其特征在于,所述计算模块具体用于:The device according to claim 13, wherein the calculation module is specifically configured to:
    根据所述各复制任务的触发方式,确定所述各复制任务的第一优先级取值;Determining, according to the triggering manner of each of the replication tasks, a first priority value of each of the replication tasks;
    根据所述各复制任务对应的源业务的重要度,确定所述各复制任务的第二优先级取值;Determining, according to the importance of the source service corresponding to each of the replication tasks, a value of the second priority of each of the replication tasks;
    根据所述各复制任务需要复制的数据的产生时间,确定所述各复制任务的第三优先级取值;Determining a third priority value of each of the replication tasks according to a generation time of the data to be copied by each of the replication tasks;
    根据所述各复制任务的第一优先级取值、第二优先级取值以及第三优 先级取值,生成所述各复制任务的优先级。According to the first priority value, the second priority value, and the third priority of each replication task. The first level takes a value, and the priority of each copy task is generated.
  15. 根据权利要求14所述的装置,其特征在于,所述计算模块具体用于:The device according to claim 14, wherein the calculation module is specifically configured to:
    根据公式Pd=9*t/T,确定所述各复制任务的第三优先级取值;Determining, according to the formula P d =9*t/T, the third priority value of each copy task;
    其中,t表示所述各复制任务需要复制的数据的产生时间;Where t represents the time at which the data to be copied by each of the replication tasks is generated;
    T表示所述各复制任务需要复制的数据的生命周期,且0<t<T;T represents the life cycle of the data that each copy task needs to copy, and 0<t<T;
    Pd表示所述各复制任务的第三优先级取值。P d represents the third priority value of each copy task.
  16. 根据权利要求14所述的装置,其特征在于,所述计算模块具体用于:The device according to claim 14, wherein the calculation module is specifically configured to:
    按照由高位到低位的顺序,将所述各复制任务的第一优先级取值、第二优先级取值以及第三优先级取值拼接在一起,以生成所述各复制任务的优先级。The first priority value, the second priority value, and the third priority value of the respective replication tasks are spliced together in order from the high to the low to generate the priorities of the replication tasks.
  17. 根据权利要求11-16任一项所述的装置,其特征在于,所述执行模块具体用于:The device according to any one of claims 11 to 16, wherein the execution module is specifically configured to:
    根据所述各复制任务的优先级,为所述各复制任务申请带宽资源;Applying bandwidth resources to the replication tasks according to the priorities of the replication tasks;
    基于所申请到的带宽资源,执行所述各复制任务。Each of the replication tasks is performed based on the requested bandwidth resource.
  18. 根据权利要求17所述的装置,其特征在于,所述执行模块具体用于:The apparatus according to claim 17, wherein the execution module is specifically configured to:
    根据所述各复制任务的优先级以及预先设置的作业提交限制,对所述各复制任务进行打包处理,以形成至少一个复制作业;And each of the copy tasks is packaged according to a priority of each of the copy tasks and a preset job submission limit to form at least one copy job;
    根据所述至少一个复制作业中各复制作业所包含的复制任务的优先级,确定所述各复制作业的优先级;Determining a priority of each copy job according to a priority of a copy task included in each copy job in the at least one copy job;
    根据所述各复制作业的优先级,为所述各复制作业所包含的复制任务申请带宽资源。The bandwidth resource is requested for the copy task included in each copy job according to the priority of each copy job.
  19. 根据权利要求18所述的装置,其特征在于,所述执行模块具体 用于:The apparatus according to claim 18, wherein said execution module is specific Used for:
    按照优先级由高到低的顺序,依次获取复制任务作为当前复制任务;The replication task is sequentially acquired as the current replication task according to the order of priority from high to low;
    若当前复制任务未达到所述作业提交限制,则继续获取其它未达到所述作业提交限制的复制任务,直到未达到所述作业提交限制的多个复制任务的总和达到所述作业提交限制为止,将所述未达到所述作业提交限制的多个复制任务打包,以生成一个复制作业;If the current copy task does not reach the job submission limit, continue to obtain other copy tasks that do not reach the job submission limit, until the sum of the plurality of copy tasks that do not reach the job submission limit reaches the job submission limit. Packaging the plurality of copy tasks that do not meet the job submission limit to generate a copy job;
    若当前复制任务达到所述作业提交限制,则直接将所述当前复制任务作为一个复制作业。If the current copy task reaches the job submission limit, the current copy task is directly used as a copy job.
  20. 根据权利要求18所述的装置,其特征在于,所述作业提交限制包括以下至少一个:The apparatus of claim 18, wherein the job submission limit comprises at least one of the following:
    文件总个数上限值;The total number of files is the upper limit;
    文件总大小上限值。The upper limit of the total file size.
  21. 一种优先级确定方法,其特征在于,包括:A priority determining method, comprising:
    获取需要跨集群复制数据的复制任务的触发方式、所述复制任务需要复制的数据的产生时间、以及所述复制任务对应的源业务的重要度中的至少一个因素,所述复制任务对应的源业务是指产生所述复制任务需要复制的数据的业务;Acquiring at least one of a triggering manner of a replication task that needs to replicate data across the cluster, a generation time of the data that the replication task needs to be replicated, and an importance of the source service corresponding to the replication task, the source corresponding to the replication task Service refers to the service that generates the data that the copy task needs to copy;
    根据所述至少一个因素,计算所述复制任务的优先级。The priority of the copy task is calculated according to the at least one factor.
  22. 一种优先级确定装置,其特征在于,包括:A priority determining apparatus, comprising:
    信息获取模块,用于获取需要跨集群复制数据的复制任务的触发方式、所述复制任务需要复制的数据的产生时间、以及所述复制任务对应的源业务的重要度中的至少一个因素,所述复制任务对应的源业务是指产生所述复制任务需要复制的数据的业务;An information obtaining module, configured to acquire a triggering manner of a replication task that needs to replicate data across the cluster, a generation time of the data to be copied by the replication task, and an importance degree of the source service corresponding to the replication task, where The source service corresponding to the replication task refers to a service that generates data that needs to be copied by the replication task;
    优先级计算模块,用于根据所述至少一个因素,计算所述复制任务的优先级。 a priority calculation module, configured to calculate a priority of the replication task according to the at least one factor.
PCT/CN2017/077500 2016-03-30 2017-03-21 Method for copying clustered data, and method and device for determining priority WO2017167070A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610195827.1A CN107291724A (en) 2016-03-30 2016-03-30 Company-data clone method, priority determine method and device
CN201610195827.1 2016-03-30

Publications (1)

Publication Number Publication Date
WO2017167070A1 true WO2017167070A1 (en) 2017-10-05

Family

ID=59962567

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/077500 WO2017167070A1 (en) 2016-03-30 2017-03-21 Method for copying clustered data, and method and device for determining priority

Country Status (3)

Country Link
CN (1) CN107291724A (en)
TW (1) TW201737108A (en)
WO (1) WO2017167070A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760482A (en) * 2020-06-22 2021-12-07 北京沃东天骏信息技术有限公司 Task processing method, device and system

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110298522A (en) * 2018-03-22 2019-10-01 阿里巴巴集团控股有限公司 The management method and device of work item
CN111124268B (en) * 2018-10-31 2023-05-09 阿里巴巴集团控股有限公司 Data copying method, device and system and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102652423A (en) * 2009-12-11 2012-08-29 国际商业机器公司 Cluster families for cluster selection and cooperative replication
CN103533514A (en) * 2012-07-06 2014-01-22 中兴通讯股份有限公司 Method and system for realizing cluster service priority levels
CN103946844A (en) * 2011-11-29 2014-07-23 国际商业机器公司 Synchronizing updates across cluster filesystems
CN104572305A (en) * 2015-01-26 2015-04-29 赞奇科技发展有限公司 Load-balanced cluster rendering task dispatching method
CN104778080A (en) * 2014-01-14 2015-07-15 中兴通讯股份有限公司 Job scheduling processing method and device based on coprocessor

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722402B (en) * 2012-05-28 2014-03-05 上海微频莱机电科技有限公司 Processing system and method for dispatching multiple tasks in real time in non-preemptive mode
CN103207814B (en) * 2012-12-27 2016-10-19 北京仿真中心 Managing and task scheduling system and dispatching method across cluster resource of a kind of decentration
KR101416280B1 (en) * 2013-01-15 2014-07-08 주식회사 엘지씨엔에스 Event handling system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102652423A (en) * 2009-12-11 2012-08-29 国际商业机器公司 Cluster families for cluster selection and cooperative replication
CN103946844A (en) * 2011-11-29 2014-07-23 国际商业机器公司 Synchronizing updates across cluster filesystems
CN103533514A (en) * 2012-07-06 2014-01-22 中兴通讯股份有限公司 Method and system for realizing cluster service priority levels
CN104778080A (en) * 2014-01-14 2015-07-15 中兴通讯股份有限公司 Job scheduling processing method and device based on coprocessor
CN104572305A (en) * 2015-01-26 2015-04-29 赞奇科技发展有限公司 Load-balanced cluster rendering task dispatching method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760482A (en) * 2020-06-22 2021-12-07 北京沃东天骏信息技术有限公司 Task processing method, device and system

Also Published As

Publication number Publication date
CN107291724A (en) 2017-10-24
TW201737108A (en) 2017-10-16

Similar Documents

Publication Publication Date Title
CN107291547B (en) Task scheduling processing method, device and system
CN108845884B (en) Physical resource allocation method, device, computer equipment and storage medium
CN109983441B (en) Resource management for batch jobs
WO2020147330A1 (en) Data stream processing method and system
CN113238838B (en) Task scheduling method and device and computer readable storage medium
JP6373432B2 (en) Real-time optimization of computing infrastructure in virtual environment
US9307048B2 (en) System and method for proactive task scheduling of a copy of outlier task in a computing environment
WO2017166803A1 (en) Resource scheduling method and device
US8826291B2 (en) Processing system
CN112162865A (en) Server scheduling method and device and server
WO2022007552A1 (en) Processing node management method, configuration method and related apparatus
US10686728B2 (en) Systems and methods for allocating computing resources in distributed computing
JP4992408B2 (en) Job allocation program, method and apparatus
WO2017167070A1 (en) Method for copying clustered data, and method and device for determining priority
EP3556053A1 (en) System and method to handle events using historical data in serverless systems
WO2015100995A1 (en) Intelligent service scheduling method
CN109710416B (en) Resource scheduling method and device
WO2017008477A1 (en) Cluster video analysis method and system
CN111190691A (en) Automatic migration method, system, device and storage medium suitable for virtual machine
WO2016061935A1 (en) Resource scheduling method, device and computer storage medium
CN112910937B (en) Object scheduling method and device in container cluster, server and container cluster
Li et al. Enabling elastic stream processing in shared clusters
CN107430526B (en) Method and node for scheduling data processing
CN108121599A (en) A kind of method for managing resource, apparatus and system
JP2023089891A (en) Cluster capacity expansion method and device

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17773100

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17773100

Country of ref document: EP

Kind code of ref document: A1