CN108667872B - Archiving method and device for scheduling server - Google Patents

Archiving method and device for scheduling server Download PDF

Info

Publication number
CN108667872B
CN108667872B CN201710205845.8A CN201710205845A CN108667872B CN 108667872 B CN108667872 B CN 108667872B CN 201710205845 A CN201710205845 A CN 201710205845A CN 108667872 B CN108667872 B CN 108667872B
Authority
CN
China
Prior art keywords
archiving
target
execution server
archive
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710205845.8A
Other languages
Chinese (zh)
Other versions
CN108667872A (en
Inventor
王宝令
者文明
赵玉开
吴明波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710205845.8A priority Critical patent/CN108667872B/en
Publication of CN108667872A publication Critical patent/CN108667872A/en
Application granted granted Critical
Publication of CN108667872B publication Critical patent/CN108667872B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses an archiving method and device for a scheduling server, wherein the method comprises the following steps: acquiring at least one data table to be archived, and sending a first archiving instruction to a target archiving execution server in the archiving execution server cluster; detecting the running state of the target archive execution server; in response to detecting that the running state of the target archive execution server is down, determining whether the database lock is overtime; in response to determining that the database lock times out, sending second archive instructions to other archive execution servers in the cluster of archive execution servers other than the target archive execution server. According to the embodiment of the application, if the target archiving execution server is determined to be down, archiving is not needed, and only the data table which is not archived is archived, so that the archiving efficiency is improved.

Description

Archiving method and device for scheduling server
Technical Field
The present application relates to the field of computer technologies, and in particular, to the field of internet technologies, and in particular, to a method and an apparatus for archiving a scheduling server.
Background
With the vigorous development of the internet industry, the business scale of the electronic commerce industry is rapidly increased, and massive historical data are accumulated. These historical data are typically stored in a relational database.
In the related art, once a down of a server performing archiving is detected, archiving tasks running on the server fail to be processed, and re-archiving is required, so that the archiving efficiency is low.
Disclosure of Invention
The present application aims to provide an archiving method and apparatus for a scheduling server to solve the technical problems mentioned in the above background section.
In a first aspect, an embodiment of the present application provides an archiving method for a scheduling server, where the scheduling server is communicatively connected to archive execution servers in an archive execution server cluster, and the method includes: the method comprises the steps of obtaining at least one data table to be archived, and sending a first archiving instruction to a target archiving execution server in an archiving execution server cluster so that the target archiving execution server archives the at least one data table in a specified database, wherein the specified database is provided with a database lock, and the database lock is periodically set by the target archiving execution server; detecting the running state of a target archiving execution server; in response to detecting that the running state of the target archive execution server is down, determining whether the database lock is overtime; and in response to determining that the database lock times out, sending second archiving instructions to other archiving execution servers in the archiving execution server cluster, which are different from the target archiving execution server, so that the other archiving execution servers archive the data tables which are not archived in the at least one data table.
In some embodiments, the method further comprises: selecting an archiving execution server which is in operation and is normally loaded from the archiving execution server cluster; and determining the selected archive execution server as a target archive execution server.
In some embodiments, the database lock is set with expiration times that are periodically set by the target archive execution server; and in response to detecting that the running state of the target archive execution server is down, determining whether the database lock is overtime, including: in response to detecting that the operating state of the target archive execution server is down, determining whether the current time is after the expiration time; in response to determining that the current time is after the expiration time, then the database lock is determined to have timed out.
In some embodiments, obtaining at least one data table to be archived, and sending a first archiving instruction to a target archiving execution server in the archiving execution server cluster to enable the target archiving execution server to archive the at least one data table in a specified database includes: and sending a first archiving instruction to the target archiving execution server so that the target archiving execution server archives at least one data table and updates the expiration time to the time which is started from the current time and is after a preset time period.
In some embodiments, detecting the operational state of the target archive execution server comprises: sending a detection instruction to a target archiving execution server, wherein the detection instruction is used for indicating the target archiving execution server to return response information; and if the response information returned by the target archiving execution server is not received within a preset time period from the time of sending the detection instruction, detecting that the running state of the target archiving execution server is down.
In a second aspect, the present application provides an archiving apparatus for a scheduling server, the scheduling server communicatively coupled to archive execution servers in an archive execution server cluster, the apparatus comprising: the system comprises an acquisition unit, a target archiving execution server and a database lock, wherein the acquisition unit is configured to acquire at least one data table to be archived and send a first archiving instruction to the target archiving execution server in an archiving execution server cluster so that the target archiving execution server archives the at least one data table in a specified database, and the specified database is provided with the database lock which is periodically set by the target archiving execution server; the detection unit is configured to detect the running state of the target archiving execution server; the determining unit is configured to determine whether the database lock is overtime or not in response to detecting that the operating state of the target archive execution server is down; and the sending unit is configured to send a second archiving instruction to other archiving execution servers, different from the target archiving execution server, in the archiving execution server cluster in response to determining that the database lock is timed out, so that the other archiving execution servers archive the data tables which are not archived in the at least one data table.
In some embodiments, the apparatus further comprises: the selection unit is configured to select an archive execution server which is in operation and has normal load from the archive execution server cluster; and the target determining unit is configured to determine the selected archive execution server as a target archive execution server.
In some embodiments, the database lock is set with expiration times that are periodically set by the target archive execution server; and a determination unit including: the determining module is configured to determine whether the current time is after the failure time in response to detecting that the operating state of the target archive execution server is down; a timeout determination module configured to determine that the database lock is timed out in response to determining that the current time is after the expiration time.
In some embodiments, the obtaining unit is further configured to: and sending a first archiving instruction to the target archiving execution server so that the target archiving execution server archives at least one data table and updates the expiration time to the time which is started from the current time and is after a preset time period.
In some embodiments, a detection unit, comprises: the detection module is configured to send a detection instruction to the target archiving execution server, wherein the detection instruction is used for indicating the target archiving execution server to return response information; and the state determining module is configured to detect that the operating state of the target archive execution server is down if the response information returned by the target archive execution server is not received within a preset time period from the time of sending the detection instruction.
The archiving method and the archiving device for the scheduling server, which are provided by the application, are characterized by firstly acquiring at least one data table to be archived, sending a first archiving instruction to a target archiving execution server in an archiving execution server cluster so that the target archiving execution server archives the at least one data table in a specified database, wherein the specified database is provided with a database lock, the database lock is periodically set by the target archiving execution server, then detecting the operating state of the target archiving execution server, determining whether the database lock is overtime or not in response to detecting that the operating state of the target archiving execution server is down, and then sending a second archiving instruction to other archiving execution servers different from the target archiving execution server in the archiving execution server cluster in response to determining that the database lock is overtime, so that the other archiving execution servers archive the data table in the at least one data table, The data tables which are not archived are archived, so that when the downtime of the target archiving execution server is detected, whether the target archiving execution server is in the downtime state or not can be further determined by utilizing the database locks, and the accuracy of determining the downtime of the target archiving execution server is improved. And if the target archiving execution server is determined to be down, the archiving is not required to be carried out again, and only the data table which is not archived is archived, so that the archiving efficiency can be improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of an archiving method for a dispatch server in accordance with the present application;
FIG. 3 is a flow diagram of yet another embodiment of an archiving method for a dispatch server in accordance with the present application;
FIG. 4 is a schematic block diagram illustrating one embodiment of an archive for a dispatch server according to the present application;
FIG. 5 is a block diagram of a computer system suitable for use in implementing a server according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the archiving method for a scheduling server or the archiving apparatus for a scheduling server of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include servers 101, 102, 103, 104, 105, networks 109, 110, 111, and terminal devices 106, 107, 108. Networks 109, 110, 111 are the medium used to provide communication links between servers 101, 102, 103, 104, 105 and terminal devices 106, 107, 108. The networks 109, 110, 111 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The server 101 may be a database server in which a database, which may be various relational databases, is installed, and which may be used to store various data, such as product information, transaction information, and the like generated in an electronic commerce platform.
The terminal devices 106, 107, 108 may be various electronic devices having display screens and supporting network communications, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
Server 102 may be communicatively coupled to servers 103, 104, 105 and terminal devices 106, 107, 108. The server 102 may be a server capable of task scheduling. Servers 103, 104, 105 may form a cluster of servers, each server in the cluster may archive data for the data table. Server 102 may receive the data table archiving task and assign the task to one or more of servers 103, 104, 105.
It should be noted that the archiving method for the scheduling server provided in the embodiment of the present application is generally performed by the server 102, and accordingly, the archiving device for the scheduling server is generally disposed in the server 102.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
It should be noted that the database installed in the server 101 may also be installed locally in the server 102, and the server 102 may directly operate on the local database, in this case, the server 101 or the network 109 may not be present in fig. 1.
With continued reference to FIG. 2, a flow 200 of one embodiment of an archiving method for a dispatch server in accordance with the present application is illustrated. The archiving method for the scheduling server comprises the following steps:
step 201, obtaining at least one data table to be archived, and sending a first archiving instruction to a target archiving execution server in the archiving execution server cluster, so that the target archiving execution server archives the at least one data table in a specified database.
In this embodiment, the scheduling server is communicatively coupled to archive execution servers in the cluster of archive execution servers. The electronic device (e.g., the server 102 shown in fig. 1) on which the archiving method for the scheduling server operates obtains at least one data table to be archived from a local server, a terminal device, or another server, and sends a first archiving instruction to a target archiving execution server in the archiving execution server cluster. The first archiving instruction is an instruction for instructing the target archiving execution server to archive the at least one data table in the specified database, and the target archiving execution server can be started to archive the at least one data table. The designated database is provided with a database lock, and the database lock is periodically set by the target archiving execution server.
An archive execution server cluster is a cluster of archive execution servers that can perform an archive task, where the archive task is to store at least one data table. The target archive execution server is a server in the archive execution server cluster designated for archiving the at least one data table. The designated database may be a relational database local to the dispatch server or may be a database in one or more relational database servers.
The archiving tasks may first be distributed to one or more target archive execution servers in the cluster. Specifically, the assignment task may be to send an archiving instruction to the target archive execution server, where the instruction may include information such as an identifier or an address of the at least one data table, so that the target archive execution server finds and archives the at least one data table.
Step 202, detecting the running state of the target archive execution server.
In this embodiment, the data table can be archived only when the operating state of the target archive execution server is in operation rather than down. Therefore, in order to ensure that the target archive execution server can successfully complete the archiving of the at least one data table, the electronic device may periodically detect the operating state of the target archive execution server. Here the operational status of the target archive execution server may be down and running. When the electronic equipment detects that the running state of the target archive execution server is running, no further operation is needed. And when the running state is detected to be down, response needs to be made to ensure that the archiving task is executed completely.
Step 203, in response to detecting that the running status of the target archive execution server is down, determining whether the database lock is overtime.
In this embodiment, if the electronic device detects that the operating state of the target archive execution server is down, the target archive execution server may be down currently. However, there is still a possibility that the target archive execution server is not down, that is, there may be a communication failure between the electronic device and the target archive execution server, so that the detection result of the electronic device is incorrect. Therefore, to further determine if the target archive execution server is down, it may be checked if the database lock has timed out.
The database locks of the designated database are periodically set by the target archive execution server, and if the target archive execution server is down, the database locks cannot be updated, so that the database locks are overtime. In this way, it may be determined whether the target archive execution server has indeed been down by determining whether the database lock has timed out.
And step 204, in response to determining that the database lock times out, sending a second archiving instruction to other archiving execution servers in the archiving execution server cluster, which are different from the target archiving execution server, so that the other archiving execution servers archive the data tables which are not archived in the at least one data table.
In this embodiment, if the electronic device determines that the database lock times out, it may be determined that the target archive execution server cannot continue archiving and another archive execution server is required to continue archiving tasks. Therefore, the electronic device responds after determining that the database lock times out, and sends a second archiving instruction to other archiving execution servers in the archiving execution server cluster, wherein the other archiving execution servers are different from the target archiving execution server, and the second archiving instruction is an instruction for instructing other archiving execution servers to archive the data table which is not archived in the at least one data table. This allows at least one data table to be archived by reassigning the archiving task.
The other archive servers herein are not limited to one server, and may be plural. At least one data table may be archived in units of one data table. And after archiving each data table, the target archiving execution server may feed back to the electronic device that the data table is archived, so that the electronic device locally modifies the archiving progress of at least one data table, that is, modifies the state corresponding to the archived data table to be archived. Therefore, once it is determined that the target archiving execution server has gone down through the timeout of the database lock, the electronic device may determine the unarchived data table in the at least one data table by checking the archiving progress, so that other archiving execution servers continue to archive the at least one data table.
In some application scenarios of this embodiment, the scheduling server is communicatively connected to an archive execution server in an archive execution server cluster, and the method includes: the scheduling server acquires at least one data table to be archived, and sends a first archiving instruction to a target archiving execution server in the archiving execution server cluster so that the target archiving execution server archives the at least one data table in a database of the scheduling server. And a database lock is arranged in a database of the scheduling server, and is periodically set by the target filing execution server. And then, the scheduling server detects the running state of the target archive execution server. And the scheduling server determines whether the database lock is overtime or not in response to detecting that the running state of the target archive execution server is down. And finally, in response to determining that the database lock is timed out, the scheduling server sends a second archiving instruction to other archiving execution servers in the archiving execution server cluster, wherein the other archiving execution servers are different from the target archiving execution server, so that the other archiving execution servers archive the data tables which are not archived in the at least one data table.
The present embodiment can determine the true operational status of the target archive server through the database lock without two (or more) servers archiving the same data table due to the network failure between the electronic device and the target archive server. Meanwhile, the situation that the data tables archived by the target archiving server are archived again under the condition that the target archiving server is down can be avoided, so that the repeated work of equipment can be reduced, the archiving efficiency is improved, and the situation that repeated data tables exist in the database due to repeated archiving can also be avoided.
With further reference to fig. 3, a flow 300 of yet another embodiment of an archiving method for a scheduling server is illustrated. The process 300 of the archiving method for scheduling server includes the following steps:
in step 301, an archive execution server that is in operation and is normally loaded is selected from the archive execution server cluster.
In this embodiment, the scheduling server is communicatively coupled to archive execution servers in the cluster of archive execution servers. The scheduling server selects one (or more) archiving execution servers in operation from the archiving execution server cluster, and the load of the archiving execution servers is normal. The normal load may be that the CPU usage of the archive execution server is below a preset threshold.
Step 302, determining the selected archive execution server as a target archive execution server.
In this embodiment, after the scheduling server selects the archive execution server, the selected archive execution server may be determined as a target archive execution server to archive the at least one data table.
Step 303, obtaining at least one data table to be archived, and sending a first archiving instruction to a target archiving execution server in the archiving execution server cluster, so that the target archiving execution server archives the at least one data table and updates the expiration time to the time after a preset time period elapses from the current time.
In this embodiment, the database lock is provided with expiration times that are periodically set by the target archive execution server. The scheduling server is communicatively coupled to the archive execution servers in the cluster of archive execution servers. The scheduling server acquires at least one data table to be archived from a local server, a terminal device or other servers, and sends a first archiving instruction to a target archiving execution server in the archiving execution server cluster. The first archiving instruction is an instruction for instructing the target archiving execution server to archive the at least one data table in the specified database, and the target archiving execution server can be started to archive the at least one data table. The designated database is provided with a database lock, and the database lock is periodically set by the target archiving execution server. The target archiving server sets the failure time of the database lock every other preset time period, so that the scheduling server can determine whether the target archiving execution server is down according to the updating condition of the failure time.
In particular, the database lock may be embodied in a table of records in the specified database. The table here is a table in which database lock related data is recorded. The record of the table includes a field "time to failure".
For example, the target archive server may use 10 seconds as a period of the set expiration time, that is, a preset time period, and when the target archive execution server starts archiving in the database, the time is 00:00:00, and at this time, the expiration time for the target archive execution server to update the database lock is 00:00: 10. By time 00:00:09, the target archive execution server updates the expiration time again to 00:00: 20.
After the target archive execution server is determined, a plurality of database instances of the database can be further specified to be classified into a database instance set, and the data table structures of the data tables of the database instances in the database instance set are the same. And then archiving the data table of the database instance in the database instance set to serve as an archiving task to be distributed to the target archiving server. Thus, each archiving task may not be limited to being associated with a particular database instance, but rather a collection of database instances. Therefore, when the task definition is carried out, the database tables in the database instance set do not need to be specifically distributed to each database instance, but are distributed to the corresponding database instance set (or database instance group).
The division of the database instance set can be performed according to the table structure of the data table, that is, a plurality of database instances with the same table structure are combined into the database instance set.
Step 304, sending a detection instruction to the target archive execution server.
In this embodiment, the detection instruction is used to instruct the target archive execution server to return response information. The scheduling server may send a detection instruction to the target archive execution server to detect whether the target archive execution server is down. The scheduling server detects the operating state of the target archive execution server according to whether the response information of the target archive execution server is received, and if the response information is not received, the scheduling server can determine that the target archive execution server is down.
Step 305, if no response information returned by the target archive execution server is received within a preset time period from the time of sending the detection instruction, detecting that the operating state of the target archive execution server is down.
In this embodiment, if the scheduling server does not receive the response information returned by the target archive execution server within the preset time period, it may be determined that the target archive execution server is detected to be down. The preset time period is a time period of a preset duration calculated by the scheduling server from the time of sending the detection instruction.
For example, the preset time duration set in the scheduling server is 15 seconds, and the scheduling server generally receives the response information returned by the target archive execution server in the 5 th second after sending the detection instruction. If the scheduling server has not received the response information by the 15 th second, it may be determined that the archive execution server is detected as down.
Step 306, in response to detecting that the operating status of the target archive execution server is down, determining whether the current time is after the expiration time.
In this embodiment, if it is detected that the operating status of the target archive execution server is down, the scheduling server responds to determine whether the current time is after the failure time of the database lock, so as to determine whether the database lock is overtime.
In particular, the current time may be compared to the expiration time of the database lock to determine whether the database lock has timed out.
In response to determining that the current time is after the expiration time, then the database lock is determined to have timed out, step 307.
In this embodiment, if the scheduling server determines that the current time is after the expiration time after comparing the current time with the expiration time, it may determine that the database lock is timed out. Specifically, the target archive execution server needs to update the expiration time within a preset period. If the target archive execution server does not update the failure time of the database lock within the set period of one cycle, the scheduling server can further determine that the target archive execution server is down on the basis that the scheduling server does not receive the response information.
And step 308, in response to determining that the database lock times out, sending a second archiving instruction to other archiving execution servers in the archiving execution server cluster, which are different from the target archiving execution server, so that the other archiving execution servers archive the data tables which are not archived in the at least one data table.
In this embodiment, if the scheduling server determines that the database lock times out, it may be determined that the target archive execution server cannot continue archiving and another archive execution server is required to continue to execute the archive task. Therefore, the scheduling server responds after determining that the database lock times out, and sends a second archiving instruction to other archiving execution servers in the archiving execution server cluster, wherein the second archiving instruction is an instruction for instructing other archiving execution servers to archive the data tables which are not archived in the at least one data table. This allows at least one data table to be archived by reassigning the archiving task.
In the embodiment, the archiving execution servers which are in operation and normally loaded are selected, so that the data table can be prevented from being distributed to the overloaded or down archiving execution server for archiving, and the probability of archiving errors is reduced. Meanwhile, the load of each archiving execution server can be balanced, and the problem that one or more archiving execution servers are overloaded and the CPU utilization rate of other archiving execution servers is low is avoided.
With further reference to fig. 4, as an implementation of the method shown in the above figures, the present application provides an embodiment of an archive apparatus for a scheduling server, which corresponds to the embodiment of the method shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 4, the archive apparatus 400 for the scheduling server of the present embodiment includes: an obtaining unit 401, configured to obtain at least one data table to be archived, and send a first archiving instruction to a target archiving execution server in an archiving execution server cluster, so that the target archiving execution server archives the at least one data table in a specified database, where the specified database is provided with a database lock, and the database lock is periodically set by the target archiving execution server; a detection unit 402 configured to detect an operation state of the target archive execution server; a determining unit 403, configured to determine whether the database lock is overtime in response to detecting that the operating state of the target archive execution server is down; a sending unit 404, configured to, in response to determining that the database lock times out, send a second archiving instruction to another archiving execution server in the archiving execution server cluster different from the target archiving execution server, so that the other archiving execution server archives the data table, which is not archived, in the at least one data table.
In this embodiment, the scheduling server is communicatively coupled to archive execution servers in the cluster of archive execution servers. The obtaining unit 401 (for example, the server 102 shown in fig. 1) on which the archiving method for the scheduling server operates obtains at least one data table to be archived from a local server, a terminal device, or another server, and sends a first archiving instruction to a target archiving execution server in the archiving execution server cluster. The first archiving instruction is an instruction for instructing the target archiving execution server to archive the at least one data table in the specified database, and the target archiving execution server can be started to archive the at least one data table. The designated database is provided with a database lock, and the database lock is periodically set by the target archiving execution server.
In this embodiment, in order to ensure that the target archive execution server can successfully complete the archiving of the at least one data table, the detection unit 402 may periodically detect the operating state of the target archive execution server. Here the operational status of the target archive execution server may be down and running.
In this embodiment, the determining unit 403 detects that the operating status of the target archive execution server is down, and then the target archive execution server may be down currently. However, there is a possibility that the target archive execution server is not down, that is, there is a communication failure between the determining unit 403 and the target archive execution server, so that the detection result of the determining unit 403 is incorrect. Therefore, to further determine if the target archive execution server is down, it may be checked if the database lock has timed out.
In this embodiment, if the sending unit 404 determines that the database lock times out, it may be determined that the target archive execution server cannot continue archiving and another archive execution server is required to continue the archiving task. Therefore, the sending unit 404 responds after determining that the database lock times out, and sends a second archiving instruction to other archiving execution servers in the archiving execution server cluster different from the target archiving execution server, where the second archiving instruction is an instruction instructing other archiving execution servers to archive the data table which is not archived in the at least one data table. This allows at least one data table to be archived by reassigning the archiving task.
In some optional implementations of this embodiment, the archive device 400 further includes: an extracting unit (not shown) configured to extract an archive execution server that is in operation and is normally loaded from the archive execution server cluster; and a target determination unit (not shown) configured to determine the selected archive execution server as a target archive execution server.
In some optional implementation manners of the embodiment, the database lock is provided with expiration time, and the expiration time is periodically set by the target archive execution server; and a determination unit 403 (not shown) including: a determining module (not shown) configured to determine whether the current time is after the expiration time in response to detecting that the operating status of the target archive execution server is down; a timeout determination module (not shown) configured to determine that the database lock is timed out in response to determining that the current time is after the expiration time.
In some optional implementations of this embodiment, the obtaining unit 401 is further configured to: and sending a first archiving instruction to the target archiving execution server so that the target archiving execution server archives at least one data table and updates the expiration time to the time which is started from the current time and is after a preset time period.
In some optional implementations of this embodiment, the detecting unit 402 includes: a detection module (not shown) configured to send a detection instruction to the target archive execution server, where the detection instruction is used to instruct the target archive execution server to return response information; and a state determining module (not shown) configured to detect that the operating state of the target archive execution server is down if the response information returned by the target archive execution server is not received within a preset time period from the time when the detection instruction is sent.
Referring now to FIG. 5, a block diagram of a computer system 500 suitable for use in implementing a server according to embodiments of the present application is shown. The server shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
FIG. 5 illustrates a schematic diagram of a computer system suitable for use in implementing a server according to embodiments of the present application. As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the method of the present application when executed by the Central Processing Unit (CPU) 501. It should be noted that the computer readable medium of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a detection unit, a determination unit, and a transmission unit. The names of these units do not in some cases constitute a limitation on the unit itself, for example, the acquiring unit may also be described as a "unit that acquires at least one data table to be archived".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: the method comprises the steps of obtaining at least one data table to be archived, and sending a first archiving instruction to a target archiving execution server in an archiving execution server cluster so that the target archiving execution server archives the at least one data table in a specified database, wherein the specified database is provided with a database lock, and the database lock is periodically set by the target archiving execution server; detecting the running state of a target archiving execution server; in response to detecting that the running state of the target archive execution server is down, determining whether the database lock is overtime; and in response to determining that the database lock times out, sending second archiving instructions to other archiving execution servers in the archiving execution server cluster, which are different from the target archiving execution server, so that the other archiving execution servers archive the data tables which are not archived in the at least one data table.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (10)

1. An archiving method for a scheduling server, the scheduling server communicatively coupled to archive execution servers in a cluster of archive execution servers, the method comprising:
the method comprises the steps of obtaining at least one data sheet to be archived, and sending a first archiving instruction to a target archiving execution server in an archiving execution server cluster so that the target archiving execution server archives the at least one data sheet in a specified database, wherein the specified database is provided with a database lock, the database lock is provided with failure time, and the failure time is periodically set by the target archiving execution server;
detecting the running state of the target archive execution server;
in response to detecting that the running state of the target archive execution server is down, determining whether the database lock is overtime;
in response to determining that the database lock times out, sending a second archiving instruction to other archiving execution servers in the archiving execution server cluster, which are different from the target archiving execution server, so that the other archiving execution servers archive the data tables which are not archived in the at least one data table;
determining whether the database lock is overtime in response to detecting that the operating status of the target archive execution server is down, including:
in response to detecting that the operating state of the target archive execution server is down, determining whether the current time is after the expiration time;
in response to determining that the current time is after the expiration time, determining that the database lock is timed out.
2. Archiving method for a scheduling server according to claim 1, characterized in that it further comprises:
selecting an archive execution server which is in operation and is normally loaded from the archive execution server cluster;
and determining the selected archive execution server as the target archive execution server.
3. The archive method for the scheduling server according to claim 1, wherein the obtaining at least one data table to be archived, sending a first archive instruction to a target archive execution server in the archive execution server cluster to enable the target archive execution server to archive the at least one data table in a specified database, comprises:
and sending a first archiving instruction to the target archiving execution server so that the target archiving execution server archives the at least one data table and updates the expiration time to the time after a preset time period from the current time.
4. The archive method for the scheduling server according to claim 1, wherein the detecting the operation status of the target archive execution server includes:
sending a detection instruction to the target archive execution server, wherein the detection instruction is used for indicating the target archive execution server to return response information;
and if the response information returned by the target archive execution server is not received within a preset time period from the time of sending the detection instruction, detecting that the running state of the target archive execution server is down.
5. An archive apparatus for a dispatch server, the dispatch server communicatively coupled to archive execution servers in a cluster of archive execution servers, the apparatus comprising:
the system comprises an acquisition unit, a first storage unit and a second storage unit, wherein the acquisition unit is configured to acquire at least one data table to be stored, and send a first storage instruction to a target storage execution server in a storage execution server cluster so as to enable the target storage execution server to store the at least one data table in a specified database, the specified database is provided with a database lock, the database lock is provided with failure time, and the failure time is periodically set by the target storage execution server;
a detection unit configured to detect an operation state of the target archive execution server;
a determining unit configured to determine whether the database lock is timed out in response to detecting that the operating status of the target archive execution server is down;
a sending unit, configured to send a second archiving instruction to other archiving execution servers in the archiving execution server cluster different from the target archiving execution server in response to determining that the database lock is timed out, so that the other archiving execution servers archive the data tables which are not archived in the at least one data table;
the determination unit includes:
a determining module configured to determine whether the current time is after the expiration time in response to detecting that the operating status of the target archive execution server is down;
a timeout determination module configured to determine that the database lock is timed out in response to determining that the current time is after the expiration time.
6. Archive device for scheduling servers according to claim 5, characterized in that it further comprises:
the selecting unit is configured to select an archive execution server which is in operation and has normal load from the archive execution server cluster;
and the target determining unit is configured to determine the selected archiving execution server as the target archiving execution server.
7. The archive device for the scheduling server of claim 5, wherein the obtaining unit is further configured to:
and sending a first archiving instruction to the target archiving execution server so that the target archiving execution server archives the at least one data table and updates the expiration time to the time after a preset time period from the current time.
8. The archive device for the scheduling server according to claim 5, wherein the detection unit includes:
a detection module configured to send a detection instruction to the target archive execution server, where the detection instruction is used to instruct the target archive execution server to return response information;
and the state determining module is configured to detect that the running state of the target archive execution server is down if the response information returned by the target archive execution server is not received within a preset time period from the time of sending the detection instruction.
9. A server, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN201710205845.8A 2017-03-31 2017-03-31 Archiving method and device for scheduling server Active CN108667872B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710205845.8A CN108667872B (en) 2017-03-31 2017-03-31 Archiving method and device for scheduling server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710205845.8A CN108667872B (en) 2017-03-31 2017-03-31 Archiving method and device for scheduling server

Publications (2)

Publication Number Publication Date
CN108667872A CN108667872A (en) 2018-10-16
CN108667872B true CN108667872B (en) 2021-04-30

Family

ID=63786730

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710205845.8A Active CN108667872B (en) 2017-03-31 2017-03-31 Archiving method and device for scheduling server

Country Status (1)

Country Link
CN (1) CN108667872B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109471745A (en) * 2018-10-18 2019-03-15 中国银行股份有限公司 Delay machine server task processing method and system based on server cluster
CN109981459B (en) * 2019-02-28 2021-02-19 联想(北京)有限公司 Information sending method, client and computer readable storage medium
CN111405015B (en) * 2020-03-09 2022-09-30 中国建设银行股份有限公司 Data processing method, device, equipment and storage medium
CN114416728A (en) * 2021-12-27 2022-04-29 炫彩互动网络科技有限公司 Server archiving and file reading method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853182A (en) * 2010-05-05 2010-10-06 中兴通讯股份有限公司 Task execution method and device based on database
CN102081623A (en) * 2009-11-30 2011-06-01 中国移动通信集团浙江有限公司 Method and system for detecting database abnormality
CN102156729A (en) * 2011-03-29 2011-08-17 北京京东世纪贸易有限公司 System and method for monitoring database servers
CN105302657A (en) * 2015-11-05 2016-02-03 网易宝有限公司 Abnormal condition analysis method and apparatus
CN105577718A (en) * 2014-10-15 2016-05-11 卓望数码技术(深圳)有限公司 Intelligent network information acquisition method and network information acquisition system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9031980B2 (en) * 2012-10-05 2015-05-12 Dell Products, Lp Metric gathering and reporting system for identifying database performance and throughput problems

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102081623A (en) * 2009-11-30 2011-06-01 中国移动通信集团浙江有限公司 Method and system for detecting database abnormality
CN101853182A (en) * 2010-05-05 2010-10-06 中兴通讯股份有限公司 Task execution method and device based on database
CN102156729A (en) * 2011-03-29 2011-08-17 北京京东世纪贸易有限公司 System and method for monitoring database servers
CN105577718A (en) * 2014-10-15 2016-05-11 卓望数码技术(深圳)有限公司 Intelligent network information acquisition method and network information acquisition system
CN105302657A (en) * 2015-11-05 2016-02-03 网易宝有限公司 Abnormal condition analysis method and apparatus

Also Published As

Publication number Publication date
CN108667872A (en) 2018-10-16

Similar Documents

Publication Publication Date Title
CN107666525B (en) Method and device for IP allocation of cluster container
CN108667872B (en) Archiving method and device for scheduling server
CN105787077B (en) Data synchronization method and device
US9940598B2 (en) Apparatus and method for controlling execution workflows
CN110225078B (en) Application service updating method, system and terminal equipment
US20190188070A1 (en) Method and system for resolving error in open stack operating system
CN108933695B (en) Method and apparatus for processing information
CN111026572A (en) Fault processing method and device of distributed system and electronic equipment
CN111338834B (en) Data storage method and device
CN109472540B (en) Service processing method and device
CN109828830B (en) Method and apparatus for managing containers
CN114090113B (en) Method, device, equipment and storage medium for dynamically loading data source processing plug-in
CN110688305B (en) Test environment synchronization method, device, medium and electronic equipment
CN110737655B (en) Method and device for reporting data
CN110737548A (en) Data request method and server
CN109218338B (en) Information processing system, method and device
CN109120433B (en) Method and apparatus for containerized deployment of hosts
CN112148705A (en) Data migration method and device
JP2013114437A (en) System construction support method
CN111262727B (en) Service capacity expansion method, device, equipment and storage medium
CN106933449B (en) Icon processing method and device
US10291700B2 (en) Network optimized scan with dynamic fallback recovery
CN110580216A (en) application extraction and detection method and device
CN113138772B (en) Construction method and device of data processing platform, electronic equipment and storage medium
CN111290873B (en) Fault processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant