CN113806121A - Instance backup abnormity detection method and device, electronic equipment and storage medium - Google Patents

Instance backup abnormity detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113806121A
CN113806121A CN202110181083.9A CN202110181083A CN113806121A CN 113806121 A CN113806121 A CN 113806121A CN 202110181083 A CN202110181083 A CN 202110181083A CN 113806121 A CN113806121 A CN 113806121A
Authority
CN
China
Prior art keywords
backup
instance
availability group
slave
strategy
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.)
Granted
Application number
CN202110181083.9A
Other languages
Chinese (zh)
Other versions
CN113806121B (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.)
Jingdong Technology Holding Co Ltd
Original Assignee
Jingdong Technology Holding 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 Jingdong Technology Holding Co Ltd filed Critical Jingdong Technology Holding Co Ltd
Priority to CN202110181083.9A priority Critical patent/CN113806121B/en
Publication of CN113806121A publication Critical patent/CN113806121A/en
Application granted granted Critical
Publication of CN113806121B publication Critical patent/CN113806121B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides an example backup abnormity detection method, which comprises the steps of obtaining an example backup record of an example high-availability group; obtaining the identification information of the backup object to which the instance backup strategy corresponding to the instance high-availability group belongs from the instance backup record; and judging whether the instance backup strategy of the instance high-availability group is abnormal or not according to the identification information corresponding to the instance backup strategy. According to the method and the device, the automatic detection of the abnormal situation of the instance backup is realized, the timeliness of the detection of the abnormal situation of the instance backup is guaranteed, a series of serious problems of low working efficiency, slow data recovery and the like of database operation and maintenance personnel caused by overlong manual troubleshooting and repair time are avoided, and the efficiency of processing the abnormal situation of the instance backup is improved.

Description

Instance backup abnormity detection method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for detecting backup abnormality of an instance, an electronic device, and a storage medium.
Background
In a management platform of a database, data needs to be backed up and stored in order to protect the data of the database. In backup and storage, a proper backup strategy needs to be selected according to the resource cost of the server, so that the server resource which is compatible with the retention frequency of the data and can also be compatible with the stored data can be achieved, and the use performance of the database can be optimized.
In the related art, the management platform of the database cannot automatically detect and repair the abnormal condition of the backup strategy, when the abnormal condition of the database management platform causes the faults such as inaccurate backup strategy, abnormal backup and the like, manual troubleshooting and repair are needed, so that the abnormal fault is highly dependent on manual work and cannot be solved in time, a series of serious problems such as performance reduction of the database platform, incapability of data recovery and the like occur, and therefore when the abnormal condition of the database platform occurs, the abnormal condition can be timely troubleshot and treated as the problem which needs to be solved currently.
Disclosure of Invention
The present application is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, the first aspect of the present application provides an example backup anomaly detection method.
The second aspect of the present application further provides an example backup anomaly detection apparatus.
A third aspect of the present application provides an electronic device.
A fourth aspect of the present application is directed to a computer-readable storage medium.
A fifth aspect of the present application proposes a computer program product.
The first aspect of the present application provides a method for detecting an instance backup anomaly, including obtaining an instance backup record of a high-availability group of an instance; obtaining the identification information of the backup object to which the instance backup strategy corresponding to the instance high-availability group belongs from the instance backup record; and judging whether the instance backup strategy of the instance high-availability group is abnormal or not according to the identification information corresponding to the instance backup strategy.
In addition, the example backup anomaly detection provided by the first aspect of the present application may also have the following additional technical features:
according to an embodiment of the present application, the determining whether the instance backup policy of the instance high availability group has an abnormality according to the identification information corresponding to the instance backup policy includes: in response to the identification information being non-empty, identifying the backup object identified by the identification information; and determining whether the instance backup strategy of the instance high-availability group has abnormity according to the role attribute of the backup object.
According to an embodiment of the present application, the determining whether an instance backup policy of the instance high availability group has an exception according to the role attribute of the backup object includes: determining that an instance backup strategy of the instance high-availability group has an exception in response to the role attribute representing that the backup object is a master library in the instance high-availability group; and closing the instance backup strategy for the master library, and opening the instance backup strategy for the slave libraries in the instance high-availability group.
According to an embodiment of the present application, the determining whether an instance backup policy of the instance high availability group has an exception according to the role attribute of the backup object includes: in response to the role attribute representing that the backup object is a slave library in the instance high-availability group and the backup object is at least two slave libraries, determining that an exception exists in an instance backup strategy of the instance high-availability group; and selecting one slave library from the at least two slave libraries as a target backup slave library, and closing the example backup strategy for the rest slave libraries in the at least two slave libraries.
According to an embodiment of the present application, the example backup anomaly detection method further includes: in response to the identification information being null, determining that an instance backup policy of the instance high-availability group has an exception; and selecting one slave library from the example high-availability group as a target backup slave library, and starting the example backup strategy for the backup slave library.
According to an embodiment of the present application, the method for detecting an exception of an instance backup further includes: determining a slave library in the example high-availability group which is in the same machine room as the master library; and selecting one slave library from the slave libraries in the same computer room as the target backup slave library.
According to an embodiment of the present application, the method for detecting an exception of an instance backup further includes: judging whether the instance high-availability group is a single instance; identifying a type of the single instance in response to the instance high availability group being a single instance; generating alarm information based on the type of the single instance.
According to an embodiment of the present application, the method for detecting an exception of an instance backup further includes: acquiring the repeated backup times of the high-availability group of the example from the example backup record; and responding to the repeated backup times which are more than or equal to the preset times, and generating a backup failure record for storage.
According to an embodiment of the present application, the method for detecting an exception of an instance backup further includes: detecting whether the instance backup strategy has abnormal configuration, and correcting and/or alarming the instance backup strategy with the abnormal configuration.
According to an embodiment of the present application, the method for detecting an exception of an instance backup further includes: and responding to the end of the abnormal detection, and sending an example backup command to a database according to the backup triggering time in the example backup strategy, wherein the example backup command carries identification information of the slave library to be backed up, and the example backup command is used for indicating the slave library to be backed up to back up according to the example backup strategy.
In order to implement the method for detecting an example backup anomaly provided in the first aspect, a second aspect of the present application further provides an example backup anomaly detection apparatus, including a record obtaining module, configured to obtain an example backup record of an example high-availability group; the identification acquisition module is used for acquiring identification information of a backup object to which the instance backup strategy corresponding to the instance high-availability group belongs from the instance backup record; and the abnormity detection module is used for judging whether the instance backup strategy of the instance high-availability group has abnormity according to the identification information corresponding to the instance backup strategy.
The example backup abnormality detection apparatus provided in the second aspect of the present application may further have the following additional technical features:
according to an embodiment of the application, the anomaly detection module includes: a backup object identification unit configured to identify a backup object identified by the identification information in response to the identification information being non-empty; and the abnormality detection unit is used for determining whether the example backup strategy of the example high-availability group has abnormality or not according to the role attribute of the backup object.
According to an embodiment of the present application, the abnormality detecting unit is further configured to: determining that an instance backup strategy of the instance high-availability group has an exception in response to the role attribute representing that the backup object is a master library in the instance high-availability group; and closing the instance backup strategy for the master library, and opening the instance backup strategy for the slave libraries in the instance high-availability group.
According to an embodiment of the present application, the abnormality detecting unit is further configured to: in response to the role attribute representing that the backup object is a slave library in the instance high-availability group and the backup object is at least two slave libraries, determining that an exception exists in an instance backup strategy of the instance high-availability group; and selecting one slave library from the at least two slave libraries as a target backup slave library, and closing the example backup strategy for the rest slave libraries in the at least two slave libraries.
According to an embodiment of the present application, the abnormality detecting unit is further configured to: in response to the identification information being null, determining that an instance backup policy of the instance high-availability group has an exception; and selecting one slave library from the example high-availability group as a target backup slave library, and starting the example backup strategy for the backup slave library.
According to an embodiment of the present application, the abnormality detecting unit is further configured to: determining a slave library in the example high-availability group which is in the same machine room as the master library; and selecting one slave library from the slave libraries in the same computer room as the target backup slave library.
According to an embodiment of the present application, the instance backup abnormality detection apparatus further includes: the anomaly detection module is used for judging whether the instance high-availability group is a single instance or not and identifying the type of the single instance in response to the instance high-availability group being the single instance; and the alarm module is used for generating alarm information based on the type of the single instance.
According to an embodiment of the present application, the instance backup abnormality detection apparatus further includes: the number obtaining module is used for obtaining the repeated backup number of the high-availability group of the example from the example backup record; and the failure recording module is used for generating a backup failure record for storage in response to the repeated backup times being more than or equal to the preset times.
According to an embodiment of the present application, the instance backup abnormality detection apparatus further includes: and the configuration detection module is used for detecting whether the instance backup strategy has abnormal configuration or not and correcting and/or alarming the instance backup strategy with the abnormal configuration.
According to an embodiment of the present application, the instance backup abnormality detection apparatus further includes: and the updating module is used for responding to the end of the abnormal detection and sending an example backup command to the database according to the backup triggering moment in the example backup strategy, wherein the example backup command carries the identification information of the slave library to be backed up, and the example backup command is used for indicating the slave library to be backed up to back up according to the example backup strategy.
To achieve the above object, a third aspect of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to perform the example backup anomaly detection method set forth in the first aspect.
A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer instructions are configured to cause the computer to execute the example backup anomaly detection method provided in the first aspect.
A fifth aspect of the present application proposes a computer program product comprising a computer program which, when executed by a processor, implements the example backup anomaly detection method proposed according to the first aspect above.
The method and the device for detecting the abnormal instance backup, provided by the application, read the instance backup record of the high-availability group of the instance to acquire the corresponding instance backup strategy and the identification information of the backup object corresponding to the instance backup strategy, and judge whether the instance backup strategy of the high-availability group of the instance is abnormal or not based on the identification information corresponding to the instance backup strategy. According to the method and the device, the automatic detection of the abnormal situation of the instance backup is realized, the timeliness of the detection of the abnormal situation of the instance backup is guaranteed, a series of serious problems of low working efficiency, slow data recovery and the like of database operation and maintenance personnel caused by overlong manual troubleshooting and repair time are avoided, and the efficiency of processing the abnormal situation of the instance backup is improved.
It should be understood that the description herein is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present application will become apparent from the following description.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flowchart illustrating an example backup anomaly detection method according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating an exemplary backup anomaly detection method according to another embodiment of the present application;
FIG. 3 is a flowchart illustrating an example backup anomaly detection method according to another embodiment of the present application;
FIG. 4 is a flowchart illustrating an example backup anomaly detection method according to another embodiment of the present application;
FIG. 5 is a flowchart illustrating an exemplary backup anomaly detection method according to another embodiment of the present application;
FIG. 6 is a flowchart illustrating an example backup anomaly detection method according to another embodiment of the present application;
FIG. 7 is a flowchart illustrating an example backup anomaly detection method according to another embodiment of the present application;
FIG. 8 is a flowchart illustrating an exemplary backup anomaly detection method according to another embodiment of the present application;
FIG. 9 is a block diagram of an exemplary backup anomaly detection apparatus according to an embodiment of the present application;
FIG. 10 is a schematic diagram of an exemplary backup anomaly detection apparatus according to another embodiment of the present application;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
An example backup abnormality detection method, apparatus, electronic device, and storage medium according to embodiments of the present application are described below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of an example backup anomaly detection method according to an embodiment of the present application, and as shown in fig. 1, the example backup anomaly detection method includes:
s101, obtaining an instance backup record of the instance high-availability group.
The database instance may have an instance high availability group, wherein the instance high availability group is comprised of a master library and at least one corresponding slave library. The database instance can be backed up into a plurality of shares, wherein one share is used as a master library, the rest is used as a slave library, the roles of the database instance can be divided into a plurality of shares, wherein one share is used as a master instance, and the rest is used as a slave instance. The master library and the slave library have two roles of the database instance, namely, the master library and the slave library have the same content, but the roles or functions are different, the master library has a read-write function, and the slave library only has a read-only function. When the master library is abnormal, the server replaces the access subject from the master library to the slave library so as to ensure that the user can be normally provided with services.
In a database management platform, the retention of data is very important for a database, so that data generated in the operation process of a database instance needs to be backed up and stored. In the embodiment of the application, the backup condition of the high-availability group of the instance can be recorded, the backup record of the instance of the high-availability group of the instance is generated, and the backup record of the instance is stored in the set position. Further, the instance backup records corresponding to the instance high availability group may be queried based on the identification of the instance high availability group and the storage location of the instance backup records.
The instance backup record records all information of the database instance in the backup process. Optionally, all steps or other operation contents corresponding to all times of the database instance in the backup process may be recorded in sequence of time; optionally, the sequence of the steps of the example backup may be used as an order, and all the steps of the database example in the backup process correspond to time or all the operation contents are recorded.
S102, obtaining the identification information of the backup object to which the instance backup strategy corresponding to the high-availability group of the instance belongs from the instance backup record.
In the embodiment of the application, the instance high-availability group generally configures an instance backup policy in advance, where the instance backup policy includes a backup tool, a backup level, a scheduling time, a backup type, a backup plan, whether a backup file is compressed, whether the backup file is encrypted, and the like used in the database instance backup process. In the implementation, under the normal condition, the slave libraries in the high-availability group of the instance perform real-time data synchronization according to the instance backup strategy.
And the backup object is a master library or a slave library in the instance high-availability group.
Optionally, in a normal operation state, the instance backup policy in the instance high-availability group exists on the slave library, at this time, the backup object to which the instance backup policy belongs is the slave library, and the data of the master library is synchronized to the slave library in real time.
Alternatively, when the running state of the master library is obstructed and normal service cannot be provided for the user, the server replaces the access subject from the master library to the slave library. At this time, the function of the slave library is changed from read only to read and write, and after the replacement is completed, the role of the slave library is changed to the master library. The server selects one of the same instance high availability groups, adds a corresponding instance backup strategy to the database instance corresponding to the original slave library replaced by the master library as the slave library of the original slave library replaced by the master library.
The instance backup record of the database instance in the instance high-availability group can be read, the identification information of the backup object to which the instance backup strategy belongs is recorded in the instance backup record, and the object in the backup state in the instance high-availability group can be determined through the identification information of the backup object. The identification information is generally Address information of the master repository or the slave repository, and optionally, the Address information may include an Internet Protocol Address (IP) and a port number.
If the identification information corresponding to the instance backup strategy identifies the master library in the instance high-availability group, the backup object to which the instance backup strategy belongs is the master library, that is, the instance backup strategy falls on the master library in the instance high-availability group; if the identification information corresponding to the instance backup policy identifies the slave library in the instance high available group, the backup object to which the instance backup policy belongs is the slave library, that is, the instance backup policy falls on the slave library in the instance high available group.
S103, judging whether the instance backup strategy of the instance high-availability group is abnormal or not according to the identification information corresponding to the instance backup strategy.
And judging whether the instance backup strategy of the high-availability group of the instance has abnormity or not through the backup object identified by the identification information corresponding to the instance backup strategy.
In the embodiment of the application, according to the requirement on the backup object in the normal operation state of the high-availability group of the instance, the requirement can be compared with the backup object identified by the acquired identification information corresponding to the current instance backup policy, so as to judge whether the current high-availability group of the instance has the abnormal backup policy. For example, normally, the backup object in the instance high availability group should be a slave library in the instance high availability group. If the identification information corresponding to the instance backup policy identifies that the backup object is the master library in the instance high-availability group, that is, the instance backup policy falls on the master library in the instance high-availability group, it may be determined that the instance backup policy of the current instance high-availability group has a backup abnormality.
According to the method for detecting the abnormal instance backup, the corresponding instance backup strategy is extracted according to the obtained instance backup record of the high-availability group of the instance, the identification information of the backup object of the corresponding instance backup strategy is further obtained, and whether the current instance backup strategy of the high-availability group of the instance is abnormal or not is judged based on the identification information corresponding to the instance backup strategy. According to the method and the device, the automatic detection of the abnormal situation of the instance backup is realized, the timeliness of the detection of the abnormal situation of the instance backup is guaranteed, a series of serious problems of low working efficiency, slow data recovery and the like of database operation and maintenance personnel caused by overlong manual troubleshooting and repair time are avoided, and the efficiency of processing the abnormal situation of the instance backup is improved.
Fig. 2 is a schematic flowchart of an example backup anomaly detection method according to another embodiment of the present application, and as shown in fig. 2, the example backup anomaly detection method includes:
s201, obtaining an instance backup record of the instance high-availability group.
S202, obtaining the identification information of the backup object to which the instance backup strategy corresponding to the high-availability group of the instance belongs from the instance backup record.
Steps S201-S202 can be referred to above and will not be described herein.
S203, in response to the identification information not being empty, identifying the backup object identified by the identification information.
In implementation, when the identification information in the instance high availability group identifies that the object is not empty, it can be understood that the identification information in the current instance high availability group identifies the backup object.
In the embodiment of the application, an object identified by identification information is determined as a backup object, and when the object identified by the identification information is a master library in an instance high-availability group, an instance backup strategy exists in the master library; the instance backup policy exists in the slave repository when the identification information identifies the slave repository in the instance highly available group.
S204, determining whether the instance backup strategy of the instance high-availability group is abnormal or not according to the role attribute of the backup object.
The backup object has role attributes, wherein the role attributes of the backup object are a master library and a slave library in the instance high availability group. Optionally, when the role attribute of the backup object is a master library, it may be understood that the instance backup policy in the current instance high availability group exists on the master library; alternatively, when the role attribute of the backup object is a slave library, it can be understood that the instance backup policy in the currently instance highly available group exists on the slave library.
In the embodiment of the application, whether the instance backup strategy in the current instance high-availability group is abnormal or not is judged based on the state of the instance backup strategy in the normally running instance high-availability group according to the role attribute of the backup object.
In general, an instance backup exception may include an instance backup policy falling on the primary repository; multiple slave libraries simultaneously perform real-time data synchronization, and the like.
For example, when the role attribute of the backup object is characterized as the master library in the instance high availability group, it may be determined that there is an exception to the instance backup policy in the current instance high availability group.
For another example, when the role attribute of the backup object is characterized by the slave libraries in the instance high availability group, and the number is at least two, it may be determined that there is an exception in the instance backup policy in the current instance high availability group.
S205, in response to the role attribute representing that the backup object is the master library in the high-availability group of the instance, determining that the instance backup strategy of the high-availability group of the instance has an exception
In the implementation, the master library of the instance high-availability group can implement real-time synchronization of database data of the master library to the slave library through execution of the instance backup policy, and when the role attribute of the backup object is characterized as the master library in the instance high-availability group, it can be understood that the backup object identified by the identification information corresponding to the instance backup policy is the master library in the instance high-availability group.
S206, closing the instance backup strategy for the master library, and opening the instance backup strategy for the slave library in the instance high-availability group.
The method comprises the steps of closing the instance backup strategy in the master library, selecting one from the corresponding slave libraries, adding the corresponding instance backup strategy to enable the master library and the slave libraries to be normally identified, synchronizing the content of the master library into the slave libraries in real time through the instance backup strategy, and at the moment, enabling an instance backup process to normally run and completing the repair of the abnormal situation by a server.
S207, in response to the fact that the role attributes represent that the backup objects are the slave libraries in the high-availability group of the instances, and the backup objects are at least two slave libraries, it is determined that an exception exists in the instance backup strategy of the high-availability group of the instances.
In the implementation, in a normal case, the master library only needs one slave library to implement real-time synchronization of data, and when the role attribute represents that the backup object is a slave library in the high-availability group of the instance, and the number of the backup objects is at least two slave libraries, it can be understood that at least two slave libraries perform real-time synchronization of data on the master library, and in this case, it can be determined that an instance backup policy of the high-availability group of the instance has an anomaly.
In the embodiment of the application, the number of the slave libraries in the real-time data synchronization state in the high-availability group of the instance may be determined based on the number of the identification information corresponding to the instance backup policy, and if the number of the identified slave libraries is at least two, the content of the master library is synchronized into at least two slave libraries in real time according to the instance backup policy, and the synchronized content of each slave library in the backup state is completely the same. At this time, the resources of the database are unreasonably occupied, which may result in a decrease in the operation speed of the database. In order to avoid unnecessary resource waste and ensure the running speed of the database, when the identification information corresponding to the instance backup strategy identifies at least two slave libraries, the instance backup strategy of the current instance high-availability group can be judged to have abnormity.
S208, selecting one slave library from the at least two slave libraries as a target backup slave library, and closing the instance backup strategy for the rest slave libraries in the at least two slave libraries.
The method comprises the steps that a server selects one target backup slave library corresponding to a master library from all slave libraries identified by identification information, and the example backup strategy existing in the target backup slave library is not modified and changed. Meanwhile, all the other unselected instance backup strategies on the slave library identified by the identification information are closed, so that the contents written and/or modified by the master library are only synchronized to one corresponding slave library in real time, unnecessary resource waste is reduced, and the abnormal condition is repaired.
Optionally, at least two slave libraries in a real-time data synchronization state may be selected according to a machine room location of a physical machine where the master library is located. When the physical machine where the master library is located and the physical machine where the slave library is located are located in the same machine room range, the slave library can realize real-time data synchronization with the master library to the maximum extent according to an example backup strategy, and delay time is reduced. Or, when the master library is abnormal, the service cannot be normally provided, and the switching process is required, the slave libraries in the same machine room consume less time and are easier to operate in the switching process. Therefore, one slave library with the physical machine in the same machine room range as the physical machine in the master library can be selected from at least two slave libraries to serve as a target backup slave library.
It should be particularly noted that the above embodiment is based on an instance backup exception that may be caused when an object identified by identification information in an instance high availability group is not empty, and when an object identified by identification information in an instance high availability group is empty, other instance backup exceptions may be caused.
S209, in response to the identification information being null, determining that an exception exists in the instance backup strategy of the instance high-availability group.
In the implementation, when the identification information corresponding to the instance backup policy is blank, the identification information cannot normally identify the backup object in the instance high-availability group, and it can be understood that, in this case, the instance backup policy does not exist on both the master library and the slave library in the instance high-availability group. Under the condition of no instance backup strategy, the server cannot synchronize the content written and/or modified by the master library to the slave library in real time, so that the current instance high-availability group cannot realize normal instance backup, and therefore it can be judged that the instance backup strategy of the current instance high-availability group is abnormal.
S210, selecting one slave library from the example high-availability group as a target backup slave library, and starting an example backup strategy for the target backup slave library.
Based on that the identification information corresponding to the instance backup policy is blank, the instance backup policy of the instance high-availability group causes an instance backup exception, in the embodiment of the present application, a repair method may be provided that selects one slave library from the current instance high-availability group as a slave library corresponding to the master library, and adds the instance backup policy to the selected slave library, so that the content written and/or modified by the master library may be synchronized to the slave library in real time, thereby completing the repair of the exception condition.
It should be particularly noted that, in the above embodiment, when the abnormal condition that may exist due to the fact that the identification information is identified as blank or not, the abnormal condition may be serial or parallel. And the above embodiments are only examples of the present application and should not be construed as limiting the present application.
According to the method for detecting the abnormal instance backup, the abnormal instance backup of different types is refined according to the condition that an object identified by identification information in an instance high-availability group is blank or not blank, meanwhile, different repair measures are provided according to different abnormal conditions, automatic detection and automatic repair of the abnormal instance backup are achieved, the timeliness of detection and processing of the abnormal instance backup is guaranteed, a series of serious problems that database operation and maintenance personnel are low in working efficiency and slow in data recovery and the like due to overlong manual troubleshooting and repair time are avoided, and the efficiency of processing the abnormal instance backup is improved.
In addition to the abnormal situation of the example backup proposed in the above embodiment, fig. 3 may be combined with fig. 3, where fig. 3 is a schematic flow diagram of an example backup abnormality detection method according to another embodiment of the present application, and as shown in fig. 3, the example backup abnormality detection method includes:
s301, determining the slave libraries in the same machine room with the master library in the high-availability group of the instance.
In the implementation, the resource configuration of the machine room limits that the physical machines where the master library and the corresponding slave libraries are located in the same machine room, and when the master library is abnormal, if switching processing needs to be performed, the slave libraries in the same machine room consume less time and are easier to operate in the switching process.
In the embodiment of the application, in the example high-availability group, the slave libraries on the physical machines which are in the same machine room range as the physical machine to which the master library belongs can be screened out.
One or more slave libraries may be screened.
S302, one slave library is selected from the slave libraries in the same machine room and used as a target backup slave library.
In the embodiment of the application, after determining the slave libraries of the physical machines in the same machine room range in the same example high availability group, the physical machine to which the master library belongs selects one slave library, adds an example backup strategy to the slave library, and takes the selected slave library as a target backup slave library corresponding to the example high availability group to realize normal operation of an example backup process.
In implementation, for slave libraries on a physical machine in the same computer room, one slave library may be selected as a target backup slave library based on relevant factors such as a network state, a relative distance of the physical machine, and the like. For example, in the same example high availability group, when the number of slave libraries on the physical machine located in the same machine room range as the physical machine where the master library is located is two or more, one physical machine with a better network state and a higher network speed may be selected from the slave libraries, and the slave library on the physical machine may be used as a target backup slave library. The network state can influence the synchronization speed, delay time, failure rate and the like when the slave libraries are subjected to real-time data synchronization, so that one slave library with a better network state is selected, the normal operation of instance backup can be ensured to the maximum extent, and the occurrence of failure is avoided.
The method for detecting the abnormal backup of the example determines at least one slave library in the high-availability group of the example, wherein the slave library and the master library are located in the same machine room range, and selects one slave library from the slave libraries as a target backup slave library corresponding to the master library. According to the method and the device, the slave library is determined according to the positions of the physical machines of the master library and the slave library, the optimal selection of the positions of the physical machines of the master library and the slave library is realized, the time consumption for switching the abnormal conditions is shorter, the operation is easier, the automatic detection and the automatic repair of the abnormal conditions of the instance backup are realized, and the efficiency of processing the abnormal conditions of the instance backup is further improved.
On the basis of the foregoing embodiment, with reference to fig. 4, fig. 4 is a schematic flowchart of an example backup anomaly detection method according to another embodiment of the present application, and as shown in fig. 4, the example backup anomaly detection method includes:
s401, judging whether the instance high-availability group is a single instance.
In the embodiment of the application, the number of database instances contained in the instance high-availability group can be obtained, and whether the instance high-availability group is a single instance or not is judged according to the number of the database instances. When there is only one database instance in the instance high availability group, it may be determined that the current instance high availability group is a single instance.
S402, responding to the case high-availability group being the single case, identifying the type of the single case.
After the high-availability group of the instance is determined to be the single instance, the related information of the single instance can be obtained, and the type of the single instance can be determined. For example, it is determined whether the instance high availability group of the single instance is the instance high availability group used for the test, or whether the instance high availability group of the single instance is the instance high availability group that is subjected to the deletion processing after single use, and so on.
And S403, generating alarm information based on the type of the single instance.
And when the high-availability group of the instance is a single instance, setting the abnormal condition to be further checked and processed by a human, and executing an alarm prompt command.
In the embodiment of the application, the alarm information is generated according to the determined type of the high-availability group of the single instance, wherein the alarm information may include a physical machine location where the high-availability group of the single instance is located, a time when the high-availability group of the single instance is found, the determined type of the high-availability group of the single instance, and the like. After the alarm information is generated, the alarm information is immediately sent to a worker, so that the abnormal condition of the single-type example high-availability group can be processed in time.
The warning information can be sent in a mail mode, and can also be sent through communication software, so that the purpose of timely reminding workers is achieved.
The method for detecting the abnormal backup of the example, provided by the application, judges whether the high-availability group of the example is a single example, and generates alarm information based on the type of the identified single example. According to the method and the device, the alarm processing is carried out aiming at the complex abnormal condition of the single instance, the automatic detection and automatic alarm of the abnormal condition of the instance backup are realized, the difficulty of manual screening is reduced, the troubleshooting alarm time is shortened, a worker can timely perform troubleshooting processing on the single instance condition, the timeliness of detection and processing of the abnormal condition of the instance backup is guaranteed, and the efficiency of processing the abnormal condition of the instance backup is improved.
On the basis of the above embodiments, when the example backup fails, with reference to fig. 5, fig. 5 is a schematic flowchart of an example backup abnormality detection method according to another embodiment of the present application, as shown in fig. 5, the example backup abnormality detection method includes:
s501, obtaining the repeated backup times of the high-availability group of the example from the example backup record.
The number of times of duplicate backups of the highly available group of the instance may be obtained from the instance backup record.
Optionally, when the instance high-availability group is backed up, the start instruction may be detected, and at this time, the number of times of backup of the instance high-availability group may be updated by adding 1, and the updated number of times of backup may be recorded in the instance backup record. In implementation, when the backup failure occurs to the instance high-availability group and the maximum backup times allowed by the instance high-availability group are not reached, the instance high-availability group can be repeatedly backed up, and the backup times are updated once each time the instance high-availability group is repeatedly backed up.
Optionally, when the real-time data synchronization of the high-availability group of the instance is started, the start instruction may be detected, the backup identifier of the high-availability group of the instance may be generated in the instance backup record, the number of the backup identifiers of the high-availability group of the instance may be queried from the instance backup record, and then the number of times of duplicate backups corresponding to the high-availability group of the instance may be determined.
Optionally, the instance backup record may also record information such as the starting time and the ending time of each backup of the instance high-availability group.
And S502, generating a backup failure record for storage in response to the fact that the repeated backup times are larger than or equal to the preset times.
In implementation, when the slave library cannot perform real-time data synchronization normally according to the instance backup policy, or when the slave library performs real-time data synchronization operation according to the instance backup policy, the content written and/or updated by the master library is not synchronized to the slave library in real time, it may be determined that the current instance backup fails. Because the reason for the backup failure of the example has uncertainty, the backup failure record needs to be generated and stored and the alarm needs to be reminded, so that the staff can timely perform further investigation and processing.
Alternatively, the real preset number may be set based on the resource configuration. In implementation, for reasonable application of resources, the maximum backup times allowed by the instance high-availability group are often set, and the preset times may be less than or equal to the maximum backup times.
In the embodiment of the application, when the number of times of repeated backup of the determined example high-availability group is greater than or equal to the preset number of times, the backup result in the target backup slave library corresponding to the master library may be checked, and if the slave library does not successfully synchronize the content written and/or modified by the master library, it may be determined that the example backup policy of the example high-availability group is abnormal. And generating an example backup failure record based on the abnormal condition of the example backup, storing the example backup failure record into an abnormal record, generating alarm information from the example backup failure record, and sending the alarm information to a worker.
The example backup failure record may include the number of times of repeated backup of the example backup, information of the master library and the slave library corresponding to the example backup, time of failure of the example backup, and other related information.
The example backup abnormity detection method provided by the application sets the upper limit of the number of times of failed backup of the example high-availability group as a preset number of times, obtains the number of times of repeated backup of the failed backup of the example high-availability group, compares the number of times of repeated backup with the preset number of times, and if the number of times of repeated backup is larger than or equal to the preset number of times, can judge that the example backup strategy of the example high-availability group is abnormal, further generates and stores a backup failure record, and simultaneously alarms workers. According to the method and the device, automatic detection and autonomous judgment of the complex situation of the abnormal situation of the instance backup failure are realized, the manual screening time is shortened, the detection and processing timeliness of the abnormal situation of the instance backup are ensured, and the processing efficiency of the abnormal situation of the instance backup is improved.
On the basis of the foregoing embodiment, when the configuration of the instance backup policy is abnormal, with reference to fig. 6, fig. 6 is a schematic flowchart of an instance backup abnormality detection method according to another embodiment of the present application, as shown in fig. 6, the instance backup abnormality detection method includes:
s601, detecting whether the example backup strategy has abnormal configuration, and correcting and/or alarming the example backup strategy with the abnormal configuration.
In order to realize the normal function of the instance backup strategy, the content of the master library can be backed up to the target backup slave library in real time, and the instance backup strategy is configured with a plurality of functions. The rules of investigation and repair of various abnormal conditions which may occur in the instance backup strategy can be preset and stored in the set position, and the investigation of the instance backup strategy configuration and the repair and/or alarm of the abnormal conditions are realized according to the preset rules.
In the embodiment of the application, in daily operation, the detection on the configuration of the instance backup strategy can be realized, and whether the configuration of the instance backup strategy is abnormal or not can be found in time. When the configuration of the instance backup strategy is found to be abnormal, the abnormal situation which can be autonomously repaired in the rule range of the abnormal situation investigation and repair is checked and stored in advance, and the corresponding repair is carried out after the type of the abnormal situation is judged; for the problems that autonomous repair cannot be carried out in abnormal condition troubleshooting and repairing rules and alarm is needed, alarm information is produced in time and sent to workers; and generating alarm information for the screened problems outside the abnormal condition investigation and repair rules, and sending the alarm information to the staff.
The generated alarm information can be classified according to the importance degree of the abnormal condition, and workers can make different reactions and treatments according to the grade of the alarm information.
Alternatively, a continuous detection of instance backup policy configuration may be initiated from the start runtime.
Alternatively, the detection of the instance backup policy configuration may be initiated at a time set by a human operator.
For example, in the case of setting the instance backup policy, the encryption function of the instance backup is abnormal, which causes that no backup password is added to the file to be encrypted for backup, or the backup password is added to the file not to be backed up, which causes the instance backup process to be abnormal. Under the abnormal condition, the automatic repair cannot be carried out, and warning information needs to be generated to remind workers of manual treatment. When the abnormal condition is detected in the instance backup strategy, the alarm information can be generated based on the related information of the detected abnormal encryption configuration of the instance backup strategy, meanwhile, the corresponding mark is made according to the set level of the alarm information, and the staff is sent, so that the detection of the instance backup strategy configuration is completed.
According to the method for detecting the abnormal instance backup, the abnormally configured instance backup strategy is repaired or warned through detecting the abnormal situation of the configuration of the instance backup strategy. According to the method and the device, the configuration of the instance backup strategy is screened, the occurrence of the instance backup abnormal condition is avoided from the configuration dimension, the failure rate of the instance backup is reduced, the automatic detection and automatic repair and/or alarm of the instance backup abnormal condition are realized, the timeliness of the detection and processing of the instance backup abnormal condition is ensured, and the efficiency of processing the instance backup abnormal condition is improved.
In implementation, when all example backup abnormality detections are finished, with reference to fig. 7, fig. 7 is a schematic flow chart of an example backup abnormality detection method according to another embodiment of the present application, and as shown in fig. 7, the example backup abnormality detection method includes:
and S701, responding to the end of the abnormal detection, and sending an example backup command to the database according to the backup triggering time in the example backup strategy, wherein the example backup command carries the identification information of the slave library to be backed up, and the example backup command is used for indicating the slave library to be backed up to back up according to the example backup strategy.
And the backup triggering moment is preset instance backup starting time, after the anomaly detection is finished, the abnormal instance backup strategy is modified and adjusted according to the abnormal condition investigation and repair result, the adjusted instance backup strategy is sent to the slave library of the corresponding instance highly available group, and the slave library synchronizes the content written in the master library to the target backup slave library in real time according to the adjusted instance backup strategy.
In the embodiment of the application, for the instance backup strategy adjusted in the anomaly detection process, the identification information corresponding to the adjusted instance backup strategy can identify the target backup slave library in the high-availability group of the instance, and the adjusted instance backup strategy is sent to the target backup slave library identified by the identification information according to the identification information. And the target backup slave library synchronizes the data content of the master library to the slave library in real time according to the obtained adjusted instance backup strategy and the obtained backup command.
According to the method for detecting the abnormal instance backup, after the abnormal detection is finished, the adjusted instance backup strategy is sent to the corresponding slave library according to the set time, so that the slave library can start real-time data synchronization work according to the adjusted instance backup strategy. According to the method and the device, automatic updating after the recovery processing of the abnormal case of the instance backup is realized, the timeliness of detection and processing of the abnormal case of the instance backup is ensured, and the processing efficiency of the abnormal case of the instance backup is improved.
To better understand the above embodiments, with reference to fig. 8, fig. 8 is a schematic flowchart of an example backup anomaly detection method according to another embodiment of the present application, and as shown in fig. 8, the example backup anomaly detection method includes:
s801, obtaining an instance backup record.
S802, the abnormal situation of the example backup is detected from multiple angles.
In the embodiment of the application, the multi-angle detection method can comprise the steps of detecting whether an instance backup strategy falls on a master library; whether at least two slave libraries in the example high availability group are in a backup state; whether the master library and the slave library are not in the backup state in the high-availability group of the instance or not is judged, namely the high-availability group of the instance has no instance backup strategy; example high available set is only a single library.
And S803, the instance backup strategy is abnormal, and abnormal repair is carried out.
S804, the example backup strategy exception alarm is given.
And S805, manual processing.
And S806, finishing the abnormal detection of the instance backup, adjusting the instance backup strategy, and sending the adjusted instance backup strategy to the slave library.
And after the instance backup strategy is obtained, the detection of abnormal conditions of the instance backup strategy is started in multiple angles and multiple steps. And repairing and/or alarming the searched abnormal instance backup strategy according to abnormal conditions and processing rules which may occur in the configuration or execution process of the instance backup strategy which is preset and stored in the set position, wherein for the abnormal instance which needs alarming, a worker is sent immediately after the alarming information is generated. And after the abnormal detection and the repair process of the instance backup strategy are finished, sending the instance backup strategy after the repair adjustment to a slave library in the instance high-availability group corresponding to the instance backup strategy, and updating the instance backup strategy at the slave library, so that the slave library starts real-time data synchronization according to the updated instance backup strategy.
The method for detecting the abnormal condition of the example backup realizes automatic detection, automatic repair and/or automatic alarm of the abnormal condition of the example backup, ensures the timeliness of detection and processing of the abnormal condition of the example backup, avoids a series of serious problems of low working efficiency, slow data recovery and the like of database operation and maintenance personnel caused by overlong manual investigation and repair time, and improves the efficiency of processing the abnormal condition of the example backup.
Corresponding to the example backup abnormality detection methods proposed by the above embodiments, an embodiment of the present application also proposes an example backup abnormality detection apparatus, and since the example backup abnormality detection apparatus proposed by the embodiment of the present application corresponds to the example backup abnormality detection methods proposed by the above embodiments, the implementation of the example backup abnormality detection method is also applicable to the example backup abnormality detection apparatus proposed by the embodiment of the present application, and will not be described in detail in the following embodiments.
Fig. 9 is a schematic structural diagram of an example backup abnormality detection apparatus according to an embodiment of the present application, and as shown in fig. 9, the example backup abnormality detection apparatus 900 includes a record obtaining module 91, an identifier obtaining module 92, and an abnormality detection module 93, where
A record obtaining module 91, configured to obtain an instance backup record of the instance high availability group;
an identifier obtaining module 92, configured to obtain, from the instance backup record, identifier information of a backup object to which the instance backup policy belongs, where the instance backup policy corresponds to the high-availability group of the instance;
and an anomaly detection module 93, configured to determine whether the instance backup policy of the instance high-availability group is abnormal according to the identification information corresponding to the instance backup policy.
The example backup abnormity detection device provided by the application extracts the corresponding example backup strategy according to the obtained example backup record of the example high-availability group, further obtains the identification information of the backup object of the corresponding example backup strategy, and judges whether the example backup strategy of the current example high-availability group is abnormal or not based on the identification information corresponding to the example backup strategy. According to the method and the device, the automatic detection of the abnormal situation of the instance backup is realized, the timeliness of the detection of the abnormal situation of the instance backup is guaranteed, the problems that the performance of the database is low and the data cannot be restored due to overlong manual troubleshooting and repairing time are avoided, and the efficiency of processing the abnormal situation of the instance backup is improved.
Fig. 10 is a schematic structural diagram of an example backup anomaly detection apparatus according to another embodiment of the present application, and as shown in fig. 10, the example backup anomaly detection apparatus 1000 includes a record acquisition module 101, an identifier acquisition module 102, an anomaly detection module 103, an alarm module 104, a frequency acquisition module 105, a failure record module 106, a configuration detection module 107, and an update module 108, where:
the record obtaining module 91, the identifier obtaining module 92, and the anomaly detecting module 93 have the same structure and function as the record obtaining module 101, the identifier obtaining module 102, and the anomaly detecting module 103.
In this embodiment, the anomaly detection module 103 further includes:
a backup object identifying unit 1031 for identifying the backup object identified by the identification information in response to the identification information being not empty;
and the anomaly detection unit 1032 is used for determining whether an instance backup strategy of the instance high-availability group has an anomaly according to the role attribute of the backup object.
In this embodiment of the present application, the anomaly detection unit 1032 is further configured to:
determining that an instance backup strategy of the instance high-availability group has abnormity in response to the role attribute characterization backup object being a master library in the instance high-availability group;
and closing the instance backup strategy for the master library, and opening the instance backup strategy for the slave library in the instance high-availability group.
In this embodiment of the application, the anomaly detection unit 132 is further configured to:
in response to the role attribute representing that the backup object is a slave library in the high-availability group of the instance and the backup objects are at least two slave libraries, determining that the instance backup strategy of the high-availability group of the instance has an exception;
and selecting one slave library from the at least two slave libraries as a target backup slave library, and closing the instance backup strategy for the rest slave libraries in the at least two slave libraries.
In this embodiment of the application, the anomaly detection unit 132 is further configured to:
in response to the identification information being null, determining that an instance backup strategy of the instance high-availability group has an exception;
and selecting one slave library from the high-availability group of the instances as a target backup slave library, and opening an instance backup strategy for the backup slave library.
In this embodiment of the application, the anomaly detection unit 132 is further configured to:
determining a slave library in the same machine room as the master library in the example high-availability group;
and selecting one slave library from the slave libraries in the same computer room as a target backup slave library.
In this embodiment of the present application, the example backup abnormality detection apparatus 1000 further includes:
the anomaly detection module 103 is further configured to determine whether the instance high availability group is a single instance, and identify a type of the single instance in response to the instance high availability group being the single instance;
and the alarm module 104 is used for generating alarm information based on the type of the single instance.
In this embodiment of the present application, the example backup anomaly detection apparatus 1000 further includes a number obtaining module 105 and a failure recording module 106, where:
the number obtaining module 105 is configured to obtain the number of times of repeated backup of the high-availability group of the instance from the instance backup record;
and the failure recording module 106 is configured to generate a backup failure record for storage in response to that the number of times of repeated backup is greater than or equal to a preset number of times.
In this embodiment of the present application, the example backup anomaly detection apparatus 1000 further includes a configuration detection module 107, where:
the configuration detection module 107 is configured to detect whether an instance backup policy has an abnormal configuration, and correct and/or alarm the instance backup policy having the abnormal configuration.
In this embodiment of the present application, the example backup anomaly detection apparatus 1000 further includes an updating module 108, where:
and the updating module 108 is configured to send an instance backup command to the database according to the backup trigger time in the instance backup policy in response to the end of the anomaly detection, where the instance backup command carries identification information of the slave library to be backed up, and the instance backup command is used to indicate the slave library to be backed up to back up according to the instance backup policy.
The example backup abnormity detection device provided by the application acquires the example backup strategy by reading the example backup record, starts the abnormal condition detection of the acquired example backup strategy, and makes corresponding repair and/or alarm according to the detected abnormal condition. And for the exception of alarm processing, further investigation and repair are carried out manually. And after all the abnormity detection and repair are finished, sending the adjusted example backup strategy to a corresponding slave library of the machine room, and updating the abnormal example backup strategy, so that the corresponding slave library starts the example backup according to the updated example backup strategy. According to the method and the device, automatic detection, automatic repair and/or automatic alarm of the abnormal situation of the instance backup are realized, the timeliness of detection and processing of the abnormal situation of the instance backup is guaranteed, a series of serious problems of low working efficiency, slow data recovery and the like of database operation and maintenance personnel caused by overlong manual troubleshooting and repair time are avoided, and the efficiency of processing the abnormal situation of the instance backup is improved.
To achieve the above embodiments, the present application also proposes an electronic device, a computer-readable storage medium, and a computer program product.
FIG. 11 shows a schematic block diagram of an example electronic device 1100 that may be used to implement embodiments of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 11, the apparatus 1100 includes a memory 111, a processor 112, and a computer program stored on the memory 111 and executable on the processor 112, and when the processor 112 executes the program instructions, the example backup abnormality detection method proposed by the above-mentioned embodiment is implemented.
The electronic device provided by the embodiment of the application executes a computer program stored in the memory 111 through the processor 112, acquires the instance backup policy by reading the instance backup record, starts detection of abnormal conditions of the acquired instance backup policy, and makes corresponding repair and/or alarm according to the detected abnormal conditions. And for the exception of alarm processing, further investigation and repair are carried out manually. And after all the abnormity detection and repair are finished, sending the adjusted example backup strategy to a corresponding slave library of the machine room, and updating the abnormal example backup strategy, so that the corresponding slave library starts the example backup according to the updated example backup strategy. According to the method and the device, automatic detection, automatic repair and/or automatic alarm of the abnormal situation of the instance backup are realized, the timeliness of detection and processing of the abnormal situation of the instance backup is guaranteed, a series of serious problems of low working efficiency, slow data recovery and the like of database operation and maintenance personnel caused by overlong manual troubleshooting and repair time are avoided, and the efficiency of processing the abnormal situation of the instance backup is improved.
A computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by the processor 112, the computer program implements the example backup anomaly detection method provided in the foregoing embodiments.
The computer-readable storage medium of the embodiment of the application stores a computer program and is executed by a processor, executes the computer program stored in the memory 111 by the processor 112, obtains an instance backup policy by reading an instance backup record, starts abnormal condition detection on the obtained instance backup policy, and makes a corresponding repair and/or alarm according to the detected abnormal condition. And for the exception of alarm processing, further investigation and repair are carried out manually. And after all the abnormity detection and repair are finished, sending the adjusted example backup strategy to a corresponding slave library of the machine room, and updating the abnormal example backup strategy, so that the corresponding slave library starts the example backup according to the updated example backup strategy. According to the method and the device, automatic detection, automatic repair and/or automatic alarm of the abnormal situation of the instance backup are realized, the timeliness of detection and processing of the abnormal situation of the instance backup is guaranteed, a series of serious problems of low working efficiency, slow data recovery and the like of database operation and maintenance personnel caused by overlong manual troubleshooting and repair time are avoided, and the efficiency of processing the abnormal situation of the instance backup is improved.
The computer program product provided by the embodiment of the present application includes a computer program, and when the computer program is executed by a processor, the method for detecting an instance backup abnormality provided by the above embodiment is implemented.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methodologies themselves may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The service end can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service (Virtual Private Server, or VPS for short). The server may also be a server of a distributed system, or a server incorporating a blockchain.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present application can be achieved, and the present invention is not limited herein.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (23)

1. An instance backup anomaly detection method, comprising:
obtaining an example backup record of an example high-availability group;
obtaining the identification information of the backup object to which the instance backup strategy corresponding to the instance high-availability group belongs from the instance backup record;
and judging whether the instance backup strategy of the instance high-availability group is abnormal or not according to the identification information corresponding to the instance backup strategy.
2. The method according to claim 1, wherein the determining whether the instance backup policy of the instance high availability group has an abnormality according to the identification information corresponding to the instance backup policy comprises:
in response to the identification information being non-empty, identifying the backup object identified by the identification information;
and determining whether the instance backup strategy of the instance high-availability group has abnormity according to the role attribute of the backup object.
3. The method for detecting backup exception of instance according to claim 2, wherein said determining whether the backup policy of the instance in the high availability group has exception according to the role attribute of the backup object comprises:
determining that an instance backup strategy of the instance high-availability group has an exception in response to the role attribute representing that the backup object is a master library in the instance high-availability group;
and closing the instance backup strategy for the master library, and opening the instance backup strategy for the slave libraries in the instance high-availability group.
4. The method for detecting backup exception of instance according to claim 2, wherein said determining whether the backup policy of the instance in the high availability group has exception according to the role attribute of the backup object comprises:
in response to the role attribute representing that the backup object is a slave library in the instance high-availability group and the backup object is at least two slave libraries, determining that an exception exists in an instance backup strategy of the instance high-availability group;
and selecting one slave library from the at least two slave libraries as a target backup slave library, and closing the example backup strategy for the rest slave libraries in the at least two slave libraries.
5. The instance backup anomaly detection method according to any of claims 2-4, further comprising:
in response to the identification information being null, determining that an instance backup policy of the instance high-availability group has an exception;
and selecting one slave library from the example high-availability group as a target backup slave library, and starting the example backup strategy for the target backup slave library.
6. The instance backup anomaly detection method according to claim 5, further comprising:
determining a slave library in the example high-availability group which is in the same machine room as the master library;
and selecting one slave library from the slave libraries in the same computer room as the target backup slave library.
7. The instance backup anomaly detection method according to claim 1, further comprising:
judging whether the instance high-availability group is a single instance;
identifying a type of the single instance in response to the instance high availability group being a single instance;
generating alarm information based on the type of the single instance.
8. The instance backup anomaly detection method according to any of claims 1-4, further comprising:
acquiring the repeated backup times of the high-availability group of the example from the example backup record;
and responding to the repeated backup times which are more than or equal to the preset times, and generating a backup failure record for storage.
9. The instance backup anomaly detection method according to any of claims 1-4, further comprising:
detecting whether the instance backup strategy has abnormal configuration, and correcting and/or alarming the instance backup strategy with the abnormal configuration.
10. The instance backup anomaly detection method according to any of claims 1-4, further comprising:
and responding to the end of the abnormal detection, and sending an example backup command to a database according to the backup triggering time in the example backup strategy, wherein the example backup command carries identification information of the slave library to be backed up, and the example backup command is used for indicating the slave library to be backed up to back up according to the example backup strategy.
11. An instance backup anomaly detection apparatus, comprising:
the record acquisition module is used for acquiring the example backup record of the example high-availability group;
the identification acquisition module is used for acquiring identification information of a backup object to which the instance backup strategy corresponding to the instance high-availability group belongs from the instance backup record;
and the abnormity detection module is used for judging whether the instance backup strategy of the instance high-availability group has abnormity according to the identification information corresponding to the instance backup strategy.
12. The instance backup anomaly detection apparatus according to claim 11, wherein said anomaly detection module comprises:
a backup object identification unit configured to identify a backup object identified by the identification information in response to the identification information being non-empty;
and the abnormality detection unit is used for determining whether the example backup strategy of the example high-availability group has abnormality or not according to the role attribute of the backup object.
13. The instance backup anomaly detection apparatus according to claim 12, said anomaly detection unit further configured to:
determining that an instance backup strategy of the instance high-availability group has an exception in response to the role attribute representing that the backup object is a master library in the instance high-availability group;
and closing the instance backup strategy for the master library, and opening the instance backup strategy for the slave libraries in the instance high-availability group.
14. The instance backup anomaly detection apparatus according to claim 12, said anomaly detection unit further configured to:
in response to the role attribute representing that the backup object is a slave library in the instance high-availability group and the backup object is at least two slave libraries, determining that an exception exists in an instance backup strategy of the instance high-availability group;
and selecting one slave library from the at least two slave libraries as a target backup slave library, and closing the example backup strategy for the rest slave libraries in the at least two slave libraries.
15. The instance backup anomaly detection apparatus according to any one of claims 12-14, wherein said anomaly detection unit is further configured to:
in response to the identification information being null, determining that an instance backup policy of the instance high-availability group has an exception;
and selecting one slave library from the example high-availability group as a target backup slave library, and starting the example backup strategy for the backup slave library.
16. The instance backup anomaly detection apparatus according to claim 15, wherein said anomaly detection unit is further configured to:
determining a slave library in the example high-availability group which is in the same machine room as the master library;
and selecting one slave library from the slave libraries in the same computer room as the target backup slave library.
17. The instance backup anomaly detection apparatus according to claim 11, further comprising:
the anomaly detection module is used for judging whether the instance high-availability group is a single instance or not and identifying the type of the single instance in response to the instance high-availability group being the single instance;
and the alarm module is used for generating alarm information based on the type of the single instance.
18. The instance backup anomaly detection apparatus according to any one of claims 11-14, further comprising:
the number obtaining module is used for obtaining the repeated backup number of the high-availability group of the example from the example backup record;
and the failure recording module is used for generating a backup failure record for storage in response to the repeated backup times being more than or equal to the preset times.
19. The instance backup anomaly detection apparatus according to any one of claims 11-14, further comprising:
and the configuration detection module is used for detecting whether the instance backup strategy has abnormal configuration or not and correcting and/or alarming the instance backup strategy with the abnormal configuration.
20. The instance backup anomaly detection apparatus according to any one of claims 11-14, further comprising:
and the updating module is used for responding to the end of the abnormal detection and sending an example backup command to the database according to the backup triggering moment in the example backup strategy, wherein the example backup command carries the identification information of the slave library to be backed up, and the example backup command is used for indicating the slave library to be backed up to back up according to the example backup strategy.
21. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method recited in any one of claims 1-10.
22. A computer readable storage medium, wherein the computer instructions are for causing the computer to perform the method of any one of claims 1-10.
23. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-10.
CN202110181083.9A 2021-02-09 2021-02-09 Instance backup anomaly detection method and device, electronic equipment and storage medium Active CN113806121B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110181083.9A CN113806121B (en) 2021-02-09 2021-02-09 Instance backup anomaly detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110181083.9A CN113806121B (en) 2021-02-09 2021-02-09 Instance backup anomaly detection method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113806121A true CN113806121A (en) 2021-12-17
CN113806121B CN113806121B (en) 2024-05-17

Family

ID=78892804

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110181083.9A Active CN113806121B (en) 2021-02-09 2021-02-09 Instance backup anomaly detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113806121B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102841943A (en) * 2012-08-24 2012-12-26 上海泰宇信息技术有限公司 Data safety supervision early warning and backup strategy system and method
US20160154698A1 (en) * 2014-12-02 2016-06-02 Cleversafe, Inc. Coordinating storage of data in dispersed storage networks
EP3156905A1 (en) * 2015-10-15 2017-04-19 Softthinks System for managing backup strategies
CN107329853A (en) * 2017-06-13 2017-11-07 上海微烛信息技术有限公司 Backup method, standby system and the electronic equipment of data-base cluster
US9934099B1 (en) * 2014-05-29 2018-04-03 EMC IP Holding Company LLC Dynamically pausing large backups
US20190138402A1 (en) * 2017-11-03 2019-05-09 Dell Products L. P. Optimizing database migration in high availability and disaster recovery computing environments
CN111324617A (en) * 2020-02-09 2020-06-23 苏州浪潮智能科技有限公司 Method and equipment for online hot backup of database
CN111752756A (en) * 2020-06-24 2020-10-09 厦门靠谱云股份有限公司 Method for setting database backup strategy through autonomous learning
CN111966520A (en) * 2020-08-10 2020-11-20 上海中通吉网络技术有限公司 Database high-availability switching method, device and system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102841943A (en) * 2012-08-24 2012-12-26 上海泰宇信息技术有限公司 Data safety supervision early warning and backup strategy system and method
US9934099B1 (en) * 2014-05-29 2018-04-03 EMC IP Holding Company LLC Dynamically pausing large backups
US20160154698A1 (en) * 2014-12-02 2016-06-02 Cleversafe, Inc. Coordinating storage of data in dispersed storage networks
EP3156905A1 (en) * 2015-10-15 2017-04-19 Softthinks System for managing backup strategies
CN107329853A (en) * 2017-06-13 2017-11-07 上海微烛信息技术有限公司 Backup method, standby system and the electronic equipment of data-base cluster
US20190138402A1 (en) * 2017-11-03 2019-05-09 Dell Products L. P. Optimizing database migration in high availability and disaster recovery computing environments
CN111324617A (en) * 2020-02-09 2020-06-23 苏州浪潮智能科技有限公司 Method and equipment for online hot backup of database
CN111752756A (en) * 2020-06-24 2020-10-09 厦门靠谱云股份有限公司 Method for setting database backup strategy through autonomous learning
CN111966520A (en) * 2020-08-10 2020-11-20 上海中通吉网络技术有限公司 Database high-availability switching method, device and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
滕斌: "谈汇文系统中Oracle数据库的备份", 镇江高专学报, no. 02 *

Also Published As

Publication number Publication date
CN113806121B (en) 2024-05-17

Similar Documents

Publication Publication Date Title
US20160378583A1 (en) Management computer and method for evaluating performance threshold value
JP6867589B2 (en) Impact range identification program, impact range identification method, and impact range identification device
CN105404581A (en) Database evaluation method and device
CN104583968A (en) Management system and management program
US10048978B2 (en) Apparatus and method for identifying a virtual machine having changeable settings
JP6961740B2 (en) Use of AI to ensure data integrity of industrial controllers
CN113312153B (en) Cluster deployment method and device, electronic equipment and storage medium
CN105354102B (en) A kind of method and apparatus of file system maintenance and reparation
CN113726553A (en) Node fault recovery method and device, electronic equipment and readable storage medium
CN111342986B (en) Distributed node management method and device, distributed system and storage medium
CN110018932B (en) Method and device for monitoring container magnetic disk
CN110874311A (en) Database detection method and device, computer equipment and storage medium
CN110888776A (en) Database health state detection method, device and equipment
CN114338363A (en) Continuous integration method, device, equipment and storage medium
CN113806138A (en) Backup recovery detection method and device for database, electronic equipment and storage medium
CN112214551A (en) Data synchronization method, system, device, electronic equipment and storage medium
CN113806121A (en) Instance backup abnormity detection method and device, electronic equipment and storage medium
CN110968456B (en) Method and device for processing fault disk in distributed storage system
JP2014153736A (en) Fault symptom detection method, program and device
CN111694724A (en) Testing method and device of distributed table system, electronic equipment and storage medium
CN114500106A (en) Security management method, device, equipment and storage medium for server
CN109150596A (en) A kind of SCADA system real time data dump method and device
US20220342788A1 (en) Anomaly location estimating apparatus, method, and program
CN105677515A (en) Online backup method and system for database
KR20170014344A (en) Energy management system

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