CN118606104A - A file detection and repair method, device and system - Google Patents
A file detection and repair method, device and system Download PDFInfo
- Publication number
- CN118606104A CN118606104A CN202410569566.XA CN202410569566A CN118606104A CN 118606104 A CN118606104 A CN 118606104A CN 202410569566 A CN202410569566 A CN 202410569566A CN 118606104 A CN118606104 A CN 118606104A
- Authority
- CN
- China
- Prior art keywords
- file
- copy
- damaged
- block
- replica
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operations
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1435—Saving, restoring, recovering or retrying at system level using file system or storage system metadata
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operations
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1464—Management of the backup or restore process for networked environments
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operations
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1469—Backup restoration techniques
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/13—File access structures, e.g. distributed indices
- G06F16/137—Hash-based
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/14—Details of searching files based on file metadata
- G06F16/148—File search processing
- G06F16/152—File search processing using file content signatures, e.g. hash values
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Quality & Reliability (AREA)
- Library & Information Science (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本公开实施例提供一种文件的检测和修复方法、装置和系统,涉及分布式文件系统技术领域。该方法的具体实施方式包括:接收一个或多个文件检测任务;响应于文件检测任务,根据端点配置中的元数据服务器地址,访问元数据服务器,从元数据服务器中读取文件检测任务对应的待检测文件的元数据信息;将待检测文件的元数据信息与对应的服务节点上存储的文件副本进行对比,确定各个文件副本中的损坏副本、以及各个损坏副本的损坏类型;根据损坏类型,对损坏副本进行备份修复或者同步修复。该实施方式能够缩短检测耗时和计算资源消耗,提升检测效率,降低系统负载,提升修复效率,兜底极限全损坏场景,保证数据内容的准确度和完整度,提升用户访问体验。
The disclosed embodiments provide a method, device and system for detecting and repairing files, and relate to the technical field of distributed file systems. The specific implementation of the method includes: receiving one or more file detection tasks; in response to the file detection task, accessing the metadata server according to the metadata server address in the endpoint configuration, and reading the metadata information of the file to be detected corresponding to the file detection task from the metadata server; comparing the metadata information of the file to be detected with the file copy stored on the corresponding service node, determining the damaged copy in each file copy, and the damage type of each damaged copy; and backing up and repairing or synchronously repairing the damaged copy according to the damage type. This implementation can shorten the detection time and computing resource consumption, improve detection efficiency, reduce system load, improve repair efficiency, cover the extreme full damage scenario, ensure the accuracy and integrity of the data content, and improve the user access experience.
Description
技术领域Technical Field
本公开涉及分布式文件系统技术领域,尤其涉及一种文件的检测和修复方法、装置和系统。The present disclosure relates to the technical field of distributed file systems, and in particular to a method, device and system for detecting and repairing files.
背景技术Background Art
随着大数据技术的不断发展,具有安全性和可靠性高、扩展性强、存取效率高且用户无感等优点的分布式文件系统(Distributed File System,DFS)被广泛应用,以glusterFS(简称GFS)为例,用户通过虚拟端口向GFS的客户端发送数据处理请求,响应于数据处理请求,客户端与对应的GFS的服务端交互,执行数据的读/写、修改、删除等操作。With the continuous development of big data technology, distributed file systems (DFS) with the advantages of high security and reliability, strong scalability, high access efficiency and user-imperceptibleness have been widely used. Taking glusterFS (GFS for short) as an example, the user sends a data processing request to the GFS client through the virtual port. In response to the data processing request, the client interacts with the corresponding GFS server to perform data read/write, modify, delete and other operations.
为了保证数据的准确性和完整性,只能利用自带的文件损坏修复命令Heal对损坏数据进行修复,Heal的修复模式包括自动扫描修复和指定路径修复两种,自动扫描修复是指定期扫描全盘数据,定位其中的损坏数据并修复;指定路径修复是指在用户访问过程中发现数据损坏时,主动上报损坏数据所在的路径,由GFS调用Heal命令进行修复。In order to ensure the accuracy and integrity of the data, the damaged data can only be repaired using the built-in file damage repair command Heal. The repair modes of Heal include automatic scanning repair and specified path repair. Automatic scanning repair refers to regularly scanning the entire disk data, locating the damaged data and repairing it; specified path repair means that when data damage is found during user access, the path where the damaged data is located is actively reported, and GFS calls the Heal command to repair it.
然而,由于GFS没有集中式的元数据管理中心,自动扫描修复方式需要全盘扫描,一方面,修复过程耗时长,使得修复成本大大增加;另一方面,定期扫描的方式对于文件损坏的感知过于滞后,同时修复需要占用系统资源,使得服务器负载加大、正常的用户请求响应迟缓,皆会导致用户访问体验较差。面对海量文件(亿级甚至更大),指定路径修复的方式过于随机、不确定性较高,不仅滞后而且无法遍及全部损坏数据,导致数据完整性和准确性低下。However, since GFS does not have a centralized metadata management center, the automatic scanning and repair method requires a full disk scan. On the one hand, the repair process is time-consuming, which greatly increases the repair cost. On the other hand, the regular scanning method is too slow to perceive file damage. At the same time, the repair requires system resources, which increases the server load and slows down the response to normal user requests, all of which lead to poor user access experience. Faced with massive files (hundreds of millions or even larger), the specified path repair method is too random and has high uncertainty. It is not only delayed but also unable to cover all damaged data, resulting in low data integrity and accuracy.
发明内容Summary of the invention
有鉴于此,本公开实施例提供一种文件的检测和修复方法、装置和系统,能够解决全盘扫描修复耗时很长、修复所需资源等成本过高,系统负载大随之性能下降,影响用户的正常数据访问、正常的用户请求响应迟缓,无法对全副本皆缺损的文件进行修复;指定路径修复不确定性较高,无法遍及全部损坏数据,导致数据完整性和准确性低下,皆使得修复过于滞后、用户访问体验较差的问题。In view of this, the embodiments of the present disclosure provide a file detection and repair method, device and system, which can solve the problems that the full disk scanning and repair takes a long time, the cost of resources required for repair is too high, the system load is heavy and the performance decreases accordingly, which affects the user's normal data access, the normal user request response is slow, and the files whose copies are all missing cannot be repaired; the specified path repair has high uncertainty and cannot cover all damaged data, resulting in low data integrity and accuracy, all of which make the repair too delayed and the user access experience poor.
为实现上述目的,根据本公开的一方面,提供了一种文件的检测和修复方法,所述方法应用于GFS服务端的GFS服务节点,所述方法包括:To achieve the above object, according to one aspect of the present disclosure, a method for detecting and repairing a file is provided, the method being applied to a GFS service node of a GFS server, the method comprising:
接收一个或多个文件检测任务;Receive one or more file detection tasks;
响应于所述文件检测任务,根据端点配置中的元数据服务器地址,访问元数据服务器,从所述元数据服务器中读取所述文件检测任务对应的待检测文件的元数据信息;In response to the file detection task, access the metadata server according to the metadata server address in the endpoint configuration, and read metadata information of the file to be detected corresponding to the file detection task from the metadata server;
将所述待检测文件的元数据信息与对应的服务节点上存储的文件副本进行对比,确定各个所述文件副本中的损坏副本、以及各个所述损坏副本的损坏类型;Comparing the metadata information of the file to be detected with the file copies stored on the corresponding service node, determining the damaged copies among the file copies and the damage type of each damaged copy;
根据所述损坏类型,对所述损坏副本进行备份修复或者同步修复。According to the damage type, the damaged copy is backed up and repaired or synchronously repaired.
根据本公开的另一方面,提供了一种文件的检测和修复装置,所述装置应用于GFS服务端的GFS服务节点,所述装置包括:According to another aspect of the present disclosure, a file detection and repair device is provided, the device is applied to a GFS service node of a GFS server, and the device includes:
接收模块,用于接收一个或多个文件检测任务;A receiving module, used for receiving one or more file detection tasks;
读取模块,用于响应于所述文件检测任务,根据端点配置中的元数据服务器地址,访问元数据服务器,从所述元数据服务器中读取所述文件检测任务对应的待检测文件的元数据信息;A reading module, configured to access the metadata server in response to the file detection task according to the metadata server address in the endpoint configuration, and read metadata information of the file to be detected corresponding to the file detection task from the metadata server;
对比模块,用于将所述待检测文件的元数据信息与对应的服务节点上存储的文件副本进行对比,确定各个所述文件副本中的损坏副本、以及各个所述损坏副本的损坏类型;A comparison module, used to compare the metadata information of the file to be detected with the file copies stored on the corresponding service node, to determine the damaged copies among the file copies and the damage type of each damaged copy;
修复模块,用于根据所述损坏类型,对所述损坏副本进行备份修复或者同步修复。The repair module is used to perform backup repair or synchronous repair on the damaged copy according to the damage type.
根据本公开的再一方面,提供了一种文件的检测和修复系统,包括:由包括文件的检测和修复装置的多个GFS服务节点组成的GFS服务端、GFS客户端和元数据服务器。According to another aspect of the present disclosure, a file detection and repair system is provided, including: a GFS server consisting of multiple GFS service nodes including file detection and repair devices, a GFS client, and a metadata server.
根据本公开的还一个方面,提供了一种电子设备,包括:According to another aspect of the present disclosure, there is provided an electronic device, including:
处理器;以及Processor; and
存储程序的存储器,Memory for storing programs,
其中,所述程序包括指令,所述指令在由所述处理器执行时使所述处理器执行所述文件的检测和修复方法。The program includes instructions, which, when executed by the processor, cause the processor to execute the file detection and repair method.
根据本公开实施例的又一个方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行所述文件的检测和修复方法。According to another aspect of the embodiments of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the file detection and repair method.
本申请实施例中提供的一个或多个技术方案,通过引入元数据服务器,用于存储全部文件的元数据信息,从而后续检测过程中基于元数据信息定位损坏文件,并根据损坏副本的损坏类型确定不同的修复方式,可以实现缩短检测耗时和计算资源消耗,提升检测效率,降低系统负载,达到检测成本降低和系统性能提升的双重效果;并且,以并发修复提高修复速度,提升修复效率,同时备份修复兜底极限全损坏场景,保证了数据内容的准确度和完整度,保障用户的正常数据访问及请求的即时响应,提升用户访问体验的技术效果。One or more technical solutions provided in the embodiments of the present application, by introducing a metadata server for storing metadata information of all files, can locate damaged files based on the metadata information in the subsequent detection process, and determine different repair methods according to the damage type of the damaged copy, thereby shortening the detection time and computing resource consumption, improving the detection efficiency, reducing the system load, and achieving the dual effects of reducing the detection cost and improving the system performance; and, by using concurrent repair to improve the repair speed and efficiency, while backing up and repairing to cover the extreme full damage scenario, the accuracy and integrity of the data content are guaranteed, the user's normal data access and the immediate response to the request are guaranteed, and the user's access experience is improved.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
在下面结合附图对于示例性实施例的描述中,本公开的更多细节、特征和优点被公开,在附图中:Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:
图1示出了根据本公开示例性实施例的文件的检测和修复方法的流程图;FIG1 shows a flow chart of a method for detecting and repairing a file according to an exemplary embodiment of the present disclosure;
图2示出了根据本公开示例性实施例的GFS服务端的示意图;FIG2 shows a schematic diagram of a GFS server according to an exemplary embodiment of the present disclosure;
图3示出了根据本公开示例性实施例的用户与GFS的交互示意图;FIG3 is a schematic diagram showing interaction between a user and a GFS according to an exemplary embodiment of the present disclosure;
图4示出了根据本公开示例性实施例的文件检测任务的触发方法的流程图;FIG4 shows a flow chart of a method for triggering a file detection task according to an exemplary embodiment of the present disclosure;
图5示出了根据本公开示例性实施例的文件的检测和修复系统的示意图;FIG5 shows a schematic diagram of a file detection and repair system according to an exemplary embodiment of the present disclosure;
图6示出了根据本公开示例性实施例的元数据信息的生成方法的流程图;FIG6 shows a flow chart of a method for generating metadata information according to an exemplary embodiment of the present disclosure;
图7示出了根据本公开示例性实施例的文件的存储方法的流程图;FIG7 shows a flowchart of a method for storing a file according to an exemplary embodiment of the present disclosure;
图8示出了根据本公开示例性实施例的文件的检测方法的流程图;FIG8 shows a flow chart of a method for detecting a file according to an exemplary embodiment of the present disclosure;
图9示出了根据本公开示例性实施例的文件的修复方法的流程图;FIG9 shows a flow chart of a method for repairing a file according to an exemplary embodiment of the present disclosure;
图10示出了根据本公开示例性实施例的备份修复的方法的流程图;FIG10 shows a flowchart of a backup and restoration method according to an exemplary embodiment of the present disclosure;
图11示出了根据本公开示例性实施例的同步修复的方法的流程图;FIG11 shows a flow chart of a synchronous repair method according to an exemplary embodiment of the present disclosure;
图12示出了根据本公开示例性实施例的系统指标的监控方法的流程图;FIG12 shows a flow chart of a method for monitoring system indicators according to an exemplary embodiment of the present disclosure;
图13示出了根据本公开示例性实施例的文件的检测和修复装置的示意性框图;FIG13 shows a schematic block diagram of a file detection and repair device according to an exemplary embodiment of the present disclosure;
图14示出了能够用于实现本公开的实施例的示例性电子设备的结构框图。FIG. 14 shows a block diagram of an exemplary electronic device that can be used to implement an embodiment of the present disclosure.
具体实施方式DETAILED DESCRIPTION
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and/or in parallel. In addition, the method embodiments may include additional steps and/or omit the steps shown. The scope of the present disclosure is not limited in this respect.
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“在本公开实施例中”表示“至少一个实施例”;术语“另一示例性实施例”表示“至少一个另外的实施例”。其他术语的相关定义将在下文描述中给出。需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "in the embodiment of the present disclosure" means "at least one embodiment"; the term "another exemplary embodiment" means "at least one other embodiment". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
MurMurHash算法:是一种经过广泛测试且速度很快的非加密哈希函数,存在多种变体,名字来自两个基本运算,即multiply和rotate(尽管该算法实际上使用shift和xor而不是rotate)。MurMurHash算法包括多种版本,不同版本对应相同或者不同位数的哈希值,比如,MurmurHash2产生32位或64位哈希值,MurmurHash3可以产生32位或128位哈希值,MurmurHash2-160生成160位哈希值MurMurHash algorithm: is a widely tested and fast non-cryptographic hash function with many variants. Its name comes from two basic operations, multiply and rotate (although the algorithm actually uses shift and xor instead of rotate). MurMurHash algorithm includes multiple versions, with different versions corresponding to the same or different number of bits of hash value. For example, MurmurHash2 produces 32-bit or 64-bit hash values, MurmurHash3 can produce 32-bit or 128-bit hash values, and MurmurHash2-160 produces 160-bit hash values.
CityHash算法:是Google发布的字符串散列算法,和murmurhash一样,属于非加密型hash算法。CityHash算法包括CityHash64、CityHash128等,可以产生64位、128位或者256位的哈希值(也称,散列值)。CityHash algorithm: It is a string hash algorithm released by Google. Like murmurhash, it is a non-encrypted hash algorithm. CityHash algorithms include CityHash64, CityHash128, etc., which can generate 64-bit, 128-bit or 256-bit hash values (also called hash values).
endpoint:是一种网络地址的抽象,可以体现为“IP地址+端口”或者“域名+端口”,可以用于服务器的请求监听、和/或流量路由等,比如,服务器创建endpoint对象,endpoint对象中绑定了网络地址,由此,服务器接收到服务请求时,即可访问endpoint对象中的网络地址。Endpoint: is an abstraction of a network address, which can be expressed as "IP address + port" or "domain name + port". It can be used for server request monitoring and/or traffic routing. For example, the server creates an endpoint object, and the network address is bound to the endpoint object. Therefore, when the server receives a service request, it can access the network address in the endpoint object.
concurrentHashMap:是一个支持高并发更新与查询的哈希表,无论是读操作还是写操作都能保证很高的性能,在进行读操作时(几乎)不需要加锁,而在写操作时通过锁分段技术只对操作的段加锁而不影响客户端对其它段的访问。concurrentHashMap: is a hash table that supports high-concurrency updates and queries. It guarantees high performance for both read and write operations. It (almost) does not require locking during read operations, and during write operations, it uses lock segmentation technology to lock only the segment being operated without affecting the client's access to other segments.
现有的GFS出现数据损坏时,通常只能通过自带的Heal功能进行修复,由于其缺乏集中式的元数据管理中心,Heal命令的自动扫描需要全盘扫描,修复耗时很长,修复所需资源等成本过高;加之文件锁的互斥等,会加重整个系统的负载,降低GFS性能,影响到正常用户的数据访问。面对海量文件,全盘扫描的方式处理损坏文件不仅过于滞后,而且无法对全副本皆缺损的文件进行修复,导致数据完整性和准确性低下。When data in the existing GFS is damaged, it can usually only be repaired through the built-in Heal function. Due to the lack of a centralized metadata management center, the automatic scanning of the Heal command requires a full disk scan, which takes a long time to repair and the cost of resources required for repair is too high. In addition, the mutual exclusion of file locks will increase the load on the entire system, reduce GFS performance, and affect normal users' data access. Faced with massive files, the full disk scan method is not only too slow to handle damaged files, but also unable to repair files with all copies missing, resulting in low data integrity and accuracy.
通过本公开的文件的检测和修复方法,引入元数据服务器,针对定期检测任务和数据处理请求响应异常报错触发的响应式检测任务,利用元数据对比定位损坏文件,大大缩短检测耗时,降低检测成本;针对不同的修复类型,利用同步修复提升修复速率、备份修复兜底极限场景,实现高效的文件修复。Through the file detection and repair method disclosed in the present invention, a metadata server is introduced, and for responsive detection tasks triggered by abnormal errors in response to regular detection tasks and data processing requests, metadata comparison is used to locate damaged files, which greatly shortens the detection time and reduces the detection cost. For different repair types, synchronous repair is used to improve the repair rate, and backup repair is used to provide a bottom-line repair for extreme scenarios, thereby achieving efficient file repair.
以下参照附图描述本公开的方案。Aspects of the present disclosure are described below with reference to the accompanying drawings.
图1示出了根据本公开示例性实施例的文件的检测和修复方法的流程图,如图1所示,本公开的文件的检测和修复方法包括如下步骤:FIG. 1 shows a flow chart of a method for detecting and repairing a file according to an exemplary embodiment of the present disclosure. As shown in FIG. 1 , the method for detecting and repairing a file of the present disclosure includes the following steps:
在本公开实施例中,本公开的文件的检测和修复方法应用于GFS服务端,如图2所示,GFS服务端包括多个GFS服务节点,每个GFS服务节点包括一个glusterfsd进程、一个BMST线程(Background Master Scanning Thread,即后台线程)以及由BMST线程生成的多个BWST线程(Background Worker Scanning Thread,即工作线程)组成的线程池,多个BWST线程由BMST线程统一管理。其中,本公开的文件的检测和修复方法由BMST线程和BWST线程执行。In the disclosed embodiment, the file detection and repair method of the disclosed embodiment is applied to the GFS server. As shown in FIG2 , the GFS server includes multiple GFS service nodes, each of which includes a glusterfsd process, a BMST thread (Background Master Scanning Thread, i.e., background thread) and a thread pool composed of multiple BWST threads (Background Worker Scanning Thread, i.e., worker threads) generated by the BMST thread, and multiple BWST threads are uniformly managed by the BMST thread. The file detection and repair method of the disclosed embodiment is executed by the BMST thread and the BWST thread.
步骤101,接收一个或多个文件检测任务。Step 101: Receive one or more file detection tasks.
在本公开实施例中,各个GFS服务节点的BMST线程接收文件检测任务,文件检测任务可以由各个GFS服务节点的glusterfsd进程定期触发,定期频率可以根据需要进行选择性设置,比如,定期频率为1小时触发一次;或者,定期频率可以根据各个GFS服务节点的空闲时段进行适应性设置,比如,GFS服务节点1的空闲时段为工作日的10:00-23:00、GFS服务节点2的空闲时段为非工作日的21:00-8:00,设置GFS服务节点1的定期频率为工作日的11:00-22:00、GFS服务节点2的定期频率为非工作日的22:00-7:00。In the disclosed embodiment, the BMST thread of each GFS service node receives the file detection task, and the file detection task can be periodically triggered by the glusterfsd process of each GFS service node. The periodic frequency can be selectively set as needed, for example, the periodic frequency is triggered once every hour; or, the periodic frequency can be adaptively set according to the idle period of each GFS service node. For example, the idle period of GFS service node 1 is 10:00-23:00 on weekdays, and the idle period of GFS service node 2 is 21:00-8:00 on non-working days. The periodic frequency of GFS service node 1 is set to 11:00-22:00 on weekdays, and the periodic frequency of GFS service node 2 is set to 22:00-7:00 on non-working days.
或者,文件检测任务可以由各个GFS客户端响应于用户的数据处理请求而触发,如图3所示,GFS包括GFS客户端和GFS服务端,相应地,如图4所示,本公开的文件检测任务的触发方法包括如下步骤:Alternatively, the file detection task may be triggered by each GFS client in response to a user's data processing request. As shown in FIG3 , the GFS includes a GFS client and a GFS server. Accordingly, as shown in FIG4 , the triggering method of the file detection task of the present disclosure includes the following steps:
步骤401,接收一个或多个GFS客户端发送的请求操作、和/或操作对象。Step 401: Receive a request operation and/or an operation object sent by one or more GFS clients.
在本公开实施例中,用户通过用户终端下发数据处理请求,数据处理请求的类型多种多样,比如,数据处理请求可以是数据写入请求、数据读取请求、数据修改请求、数据删除请求等,对应的请求操作可以是写入操作、读取操作、修改操作、删除操作等。In the disclosed embodiment, the user issues a data processing request through a user terminal. The types of data processing requests are various. For example, the data processing request may be a data write request, a data read request, a data modification request, a data deletion request, etc. The corresponding request operations may be a write operation, a read operation, a modification operation, a deletion operation, etc.
进一步地,用户终端会将接收到的数据处理请求发送给GFS客户端,GFS客户端接收到数据处理请求后,对数据处理请求进行分析处理,并将对应的请求操作、和/或操作对象发送至对应的GFS服务节点的glusterfsd进程,比如,对于数据写入请求,操作对象为待写入文件、请求操作为写入;又比如,对于数据读取请求,操作对象为待读取文件,请求操作为读取。Furthermore, the user terminal will send the received data processing request to the GFS client. After receiving the data processing request, the GFS client will analyze and process the data processing request, and send the corresponding request operation and/or operation object to the glusterfsd process of the corresponding GFS service node. For example, for a data write request, the operation object is the file to be written and the request operation is write; for another example, for a data read request, the operation object is the file to be read and the request operation is read.
步骤402,响应于所述请求操作、和/或所述操作对象,确定文件处理结果,并返回所述GFS客户端。Step 402: Determine the file processing result in response to the request operation and/or the operation object, and return it to the GFS client.
在本公开实施例中,需要说明的是,由于在响应用户数据处理请求时,必须存在至少两个以上的文件副本为正常副本,实现副本之间的一致性校验,才可保证向GFS客户端返回的文件的数据内容的准确性,进而确保GFS客户端返回的数据处理结果的正确性,也即,至少两个以上文件副本为正常副本,才可正确响应用户数据处理请求。因此,一旦用户的数据处理请求未响应,GFS客户端即可确定数据处理请求对应的请求文件的正常副本数量不足,故而直接触发与数据处理请求的请求文件对应的文件检测任务,以修复损坏副本响应用户。In the disclosed embodiment, it should be noted that, when responding to a user data processing request, there must be at least two or more normal copies of the file, and consistency verification between the copies is implemented to ensure the accuracy of the data content of the file returned to the GFS client, thereby ensuring the correctness of the data processing result returned by the GFS client, that is, at least two or more file copies are normal copies, and the user data processing request can be correctly responded to. Therefore, once the user's data processing request is not responded to, the GFS client can determine that the number of normal copies of the request file corresponding to the data processing request is insufficient, and thus directly trigger the file detection task corresponding to the request file of the data processing request to repair the damaged copy and respond to the user.
进一步地,响应于GFS客户端发送的请求操作、和/或操作对象,各个GFS服务节点的glusterfsd进程对操作对象执行请求操作,确定文件处理结果并返回GFS客户端,GFS客户端在预设时间内未接收到文件处理结果、或者接收到的文件处理结果不符合要求时,确定请求文件的文件副本存在问题,触发文件检测任务。也就是说,在正确响应用户数据处理请求之前,先对存在问题的请求文件的文件副本进行检测,定位损坏副本并修复,避免将错误处理结果发送给用户、或者长时间未响应导致用户访问体验较差等现象的发生Furthermore, in response to the request operation and/or operation object sent by the GFS client, the glusterfsd process of each GFS service node performs the request operation on the operation object, determines the file processing result and returns it to the GFS client. When the GFS client does not receive the file processing result within the preset time, or the received file processing result does not meet the requirements, it is determined that there is a problem with the file copy of the requested file, and the file detection task is triggered. In other words, before correctly responding to the user's data processing request, the file copy of the problematic requested file is first detected, the damaged copy is located and repaired, so as to avoid sending the wrong processing result to the user, or not responding for a long time, resulting in a poor user access experience, etc.
更进一步地,GFS客户端触发的文件检测任务的检测对象通常为操作对象。比如,对于数据读取请求,操作对象为待读取文件,文件检测任务的检测对象即为待读取文件;又比如,对于数据修改请求,操作对象为待修改文件,文件检测任务的检测对象即为待修改文件。Furthermore, the detection object of the file detection task triggered by the GFS client is usually the operation object. For example, for a data read request, the operation object is the file to be read, and the detection object of the file detection task is the file to be read; for another example, for a data modification request, the operation object is the file to be modified, and the detection object of the file detection task is the file to be modified.
步骤403,接收所述GFS客户端触发的文件检测任务。Step 403: Receive the file detection task triggered by the GFS client.
在本公开实施例中,通过本公开的文件检测任务的触发方法,实现GFS服务端上文件的响应式检测任务的触发,后续即可对用户请求的文件进行检测,以提前确定是否存在损坏并及时修复,防止修复滞后,保证返回给用户的数据是完整且准确的,保障用户的正常访问以及正常请求响应,提升用户访问服务体验。In the disclosed embodiments, the triggering method of the file detection task of the disclosed embodiment is used to trigger the responsive detection task of the file on the GFS server. Subsequently, the file requested by the user can be detected to determine in advance whether there is any damage and repair it in time to prevent repair delays, ensure that the data returned to the user is complete and accurate, ensure the user's normal access and normal request response, and improve the user's access service experience.
步骤102,响应于所述文件检测任务,根据端点配置中的元数据服务器地址,访问元数据服务器,从所述元数据服务器中读取所述文件检测任务对应的待检测文件的元数据信息。Step 102: In response to the file detection task, access the metadata server according to the metadata server address in the endpoint configuration, and read metadata information of the file to be detected corresponding to the file detection task from the metadata server.
在本公开实施例中,如图5所示,本公开的文件的检测和修复系统包括GFS、元数据服务器和备份服务器,元数据服务器和备份服务器皆独立于GFS配置,GFS服务端、GFS客户端、元数据服务器和备份服务器可以是物理机、虚拟机、物理机上的容器、和/或虚拟机上的容器等多种形式。比如,GFS服务端为物理机,物理机包括多块磁盘,可用于配置多个GFS服务节点,一个GFS服务节点使用的磁盘数量可以根据需要进行选择性设置。In the embodiment of the present disclosure, as shown in FIG5 , the file detection and repair system of the present disclosure includes GFS, a metadata server and a backup server. The metadata server and the backup server are both independent of the GFS configuration. The GFS server, the GFS client, the metadata server and the backup server can be in various forms such as a physical machine, a virtual machine, a container on a physical machine, and/or a container on a virtual machine. For example, the GFS server is a physical machine, and the physical machine includes multiple disks, which can be used to configure multiple GFS service nodes. The number of disks used by a GFS service node can be selectively set as needed.
进一步地,为了保证元数据服务的健壮性,元数据服务器采用和GFS服务端相同的多机房多节点布置模式,节点数为大于等于3的奇数,比如,3节点或者5节点,节点之间基于rAFT协议通信,主节点进行新增、修改、更新等操作,主节点操作完成后同步给其他从节点,从节点接收到新增、修改、更新等命令时只能做转发、分发等操作,转发、分发给主节点进行处理。Furthermore, in order to ensure the robustness of the metadata service, the metadata server adopts the same multi-computer room and multi-node layout mode as the GFS server. The number of nodes is an odd number greater than or equal to 3, for example, 3 nodes or 5 nodes. The nodes communicate based on the rAFT protocol. The master node performs operations such as adding, modifying, and updating. After the master node completes the operation, it synchronizes it to other slave nodes. When the slave node receives commands such as adding, modifying, and updating, it can only perform operations such as forwarding and distributing, and forwarding and distributing them to the master node for processing.
在本公开实施例中,如图5所示,本公开的文件的检测和修复系统中,每个GFS服务节点的glusterfsd进程分别为对应的BMST线程创建一个endpoint对象,对象信息包括元数据服务器的元数据服务器地址和备份服务器的备份服务器地址,元数据服务器地址和备份服务器地址的地址形式为元数据服务器的域名和备份服务器的域名,如此这般,BMST线程即可基于域名访问元数据服务器和备份服务器,无论元数据服务器地址和备份服务器地址的实际IP如何变化,对于BMST线程来说皆是无感、透明的,不会影响GFS服务节点对元数据服务器和备份服务器的访问。In an embodiment of the present disclosure, as shown in Figure 5, in the file detection and repair system of the present disclosure, the glusterfsd process of each GFS service node creates an endpoint object for the corresponding BMST thread, and the object information includes the metadata server address of the metadata server and the backup server address of the backup server. The address format of the metadata server address and the backup server address is the domain name of the metadata server and the domain name of the backup server. In this way, the BMST thread can access the metadata server and the backup server based on the domain name. No matter how the actual IP address of the metadata server address and the backup server address changes, it is imperceptible and transparent to the BMST thread, and will not affect the GFS service node's access to the metadata server and the backup server.
更进一步地,响应于定期触发或者基于数据处理请求触发的文件检测任务,GFS服务节点根据endpoint对象中的配置的元数据服务器地址,访问元数据服务器,元数据服务器存储了GFS服务端的各个文件对应的元数据信息,如图6所示,本公开的元数据信息的生成方法包括如下步骤:Furthermore, in response to a file detection task that is triggered periodically or based on a data processing request, the GFS service node accesses the metadata server according to the metadata server address configured in the endpoint object. The metadata server stores metadata information corresponding to each file on the GFS server. As shown in FIG6 , the method for generating metadata information disclosed in the present invention includes the following steps:
在本公开实施例中,本公开的元数据信息的生成方法由GFS客户端执行。In the embodiment of the present disclosure, the method for generating metadata information of the present disclosure is executed by a GFS client.
步骤601,接收待写入文件。Step 601, receiving a file to be written.
在本公开实施例中,GFS客户端接收待写入文件,待写入文件可以由用户通过终端下发的数据写入请求等获得。In the disclosed embodiment, the GFS client receives the file to be written, and the file to be written can be obtained by a data writing request sent by a user through a terminal.
步骤602,计算所述待写入文件的文件名称的名称哈希值,作为存储键。Step 602: Calculate the name hash value of the file name to be written as the storage key.
在本公开实施例中,各个服务节点上每一个文件的文件名称都是唯一的,因此,对应的名称哈希值自然也是唯一的,如果待写入文件的文件名称与已有文件的文件名称相同,写入时会直接覆盖已有文件。In the disclosed embodiment, the file name of each file on each service node is unique, so the corresponding name hash value is naturally unique. If the file name of the file to be written is the same as the file name of an existing file, the existing file will be directly overwritten when written.
进一步地,GFS客户端根据预置的哈希算法计算待写入文件的文件名称的名称哈希值,作为待写入文件的元数据信息的key。其中,名称哈希值的哈希算法可以根据需要进行选择性设置,比如,名称哈希值的哈希算法为murmurhash算法、cityhash算法等。Furthermore, the GFS client calculates the name hash value of the file name to be written according to a preset hash algorithm as the key of the metadata information of the file to be written. The hash algorithm of the name hash value can be selectively set as needed, for example, the hash algorithm of the name hash value is murmurhash algorithm, cityhash algorithm, etc.
步骤603,按照预设步长将所述待写入文件切分为多个文件块,计算每一个待写入文件的文件块的文件块哈希值,组成块哈希数组。Step 603: divide the file to be written into multiple file blocks according to a preset step size, calculate the file block hash value of each file block of the file to be written, and form a block hash array.
在本公开实施例中,预设步长可以根据需要进行选择性设置,比如,预设步长为1M,待写入文件为100M,则GFS客户端将待写入文件切分为100个文件块(下文表示为“chunk”。In the disclosed embodiment, the preset step size can be selectively set as needed. For example, if the preset step size is 1M and the file to be written is 100M, the GFS client will divide the file to be written into 100 file blocks (hereinafter referred to as "chunk").
进一步地,GFS客户端根据预设的哈希算法,分别计算切分后的各个chunk的块哈希值,得到各个chunk的chunk哈希值,组成待写入文件的块哈希数组。Furthermore, the GFS client calculates the block hash value of each chunk after segmentation according to a preset hash algorithm, obtains the chunk hash value of each chunk, and forms a block hash array of the file to be written.
更进一步地,可以对各个chunk进行编号,比如,chunk编号为0-99,“0”对应第一个chunk的chunk哈希值、“1”对应第二个chunk的chunk哈希值、……、“99”对应第一百个chunk的chunk哈希值,chunk编号作为各个chunk的偏移量,后续可以用于损坏副本检测及修复的校验核对。Furthermore, each chunk can be numbered, for example, chunk numbers are 0-99, "0" corresponds to the chunk hash value of the first chunk, "1" corresponds to the chunk hash value of the second chunk, ..., "99" corresponds to the chunk hash value of the hundredth chunk, and the chunk number serves as the offset of each chunk, which can be subsequently used for verification and checking of damaged copy detection and repair.
步骤604,将所述待写入文件的文件名称、文件大小、创建时间、修改时间、块哈希数组的组合作为键值。Step 604: Use the combination of the file name, file size, creation time, modification time, and block hash array of the file to be written as a key value.
在本公开实施例中,得到各个chunk的chunk哈希值以后,GFS客户端将待写入文件的其它信息与chunk哈希数组组合,得到待写入文件的元数据信息的键值。其中,其它信息可以根据需要进行选择性设置,比如,其它信息包括文件大小、创建时间、修改时间等。In the disclosed embodiment, after obtaining the chunk hash value of each chunk, the GFS client combines other information of the file to be written with the chunk hash array to obtain the key value of the metadata information of the file to be written. The other information can be selectively set as needed, for example, the other information includes file size, creation time, modification time, etc.
进一步地,GFS客户端将待写入文件的文件名称、文件大小、创建时间、修改时间、块哈希数组组合,作为待写入文件的元数据信息的value。Furthermore, the GFS client combines the file name, file size, creation time, modification time, and block hash array of the file to be written as the value of the metadata information of the file to be written.
步骤605,确定所述存储键和所述键值组成的键值对为所述待写入文件的元数据信息。Step 605: Determine that the key-value pair consisting of the storage key and the key value is the metadata information of the file to be written.
在本公开实施例中,GFS客户端将步骤602得到的待写入文件的key和步骤604得到的待写入文件的value组合为键值对[key,value],确定键值对[key,value]为待写入文件的元数据信息。In the disclosed embodiment, the GFS client combines the key of the file to be written obtained in step 602 and the value of the file to be written obtained in step 604 into a key-value pair [key, value], and determines that the key-value pair [key, value] is metadata information of the file to be written.
在本公开实施例中,通过本公开的元数据信息的生成方法,针对每一个文件的文件名称进行哈希计算,得到文件的元数据信息的key;再将文件切分为多个块,分别计算每个文件块的哈希值,组合文件的其他信息得到文件的元数据信息的value;由key-value键值对生成文件的元数据信息,由此实现每个文件元数据信息的唯一标识,后续检测过程中即可基于元数据信息进行对比,无需进行整个文件的内容比对,从而大大减小修复耗时和修复所需资源等修复成本。In an embodiment of the present disclosure, through the metadata information generation method of the present disclosure, a hash calculation is performed on the file name of each file to obtain the key of the metadata information of the file; the file is then divided into multiple blocks, the hash value of each file block is calculated respectively, and the other information of the file is combined to obtain the value of the metadata information of the file; the metadata information of the file is generated by the key-value key-value pair, thereby realizing the unique identification of the metadata information of each file, and the subsequent detection process can be compared based on the metadata information without the need to compare the contents of the entire file, thereby greatly reducing the repair cost such as the time and resources required for repair.
进一步地,GFS客户端获得待写入文件的元数据信息后,将待写入文件的元数据信息发送至元数据服务器,由元数据服务器进行存储。同时,GFS客户端将待写入文件分别存储至GFS服务端和备份服务器,如图7所示,本公开的文件的存储方法包括如下步骤:Furthermore, after the GFS client obtains the metadata information of the file to be written, it sends the metadata information of the file to be written to the metadata server, which stores it. At the same time, the GFS client stores the file to be written to the GFS server and the backup server respectively. As shown in FIG7 , the file storage method disclosed in the present invention includes the following steps:
在本公开实施例中,本公开的文件的存储方法由GFS客户端执行。In the embodiment of the present disclosure, the file storage method of the present disclosure is executed by a GFS client.
步骤701,将所述待写入文件的元数据信息发送至所述元数据服务器的各个服务节点。Step 701: Send the metadata information of the file to be written to each service node of the metadata server.
步骤702,接收所述元数据服务器的各个服务节点返回的写入结果,判断是否超过半数以上的元数据信息的写入结果为写入成功,如果是,转至步骤703;如果否,转至步骤705。Step 702 , receiving the writing results returned by each service node of the metadata server, and determining whether the writing results of more than half of the metadata information are successful. If yes, go to step 703 ; if not, go to step 705 .
在本公开实施例中,在存储元数据信息时,按照多个信息副本的形式进行存储,信息副本的副本数量为大于1的奇数,多个信息副本中的一个为主副本,主副本所在的服务节点即为主节点,在后续的元数据信息读取等过程中,基于同机房优先逻辑,优先由多个信息副本中的主副本所在的主节点与GFS服务端等交互。其中,元数据服务器的各个服务节点以concurrentHashMap的形式存储各个文件的元数据信息。In the disclosed embodiment, when storing metadata information, it is stored in the form of multiple copies of information, the number of copies of information is an odd number greater than 1, one of the multiple copies of information is a master copy, and the service node where the master copy is located is the master node. In the subsequent metadata information reading process, based on the same computer room priority logic, the master node where the master copy of the multiple copies of information is located will be prioritized to interact with the GFS server, etc. Among them, each service node of the metadata server stores the metadata information of each file in the form of concurrentHashMap.
进一步地,多个信息副本所在的服务节点将待写入文件的元数据信息的写入结果返回GFS客户端,GFS客户端根据写入结果为写入成功的服务节点的数量,确定是否进行待写入文件的写入操作。Furthermore, the service nodes where the multiple information copies are located return the writing result of the metadata information of the file to be written to the GFS client, and the GFS client determines whether to perform the writing operation of the file to be written according to the number of service nodes whose writing results are successful.
更进一步地,在超过半数的信息副本的写入结果为写入成功的情况下,确定待写入文件的元数据信息写入成功,GFS客户端再进行待写入文件向GFS服务器和备份服务器的写入操作。Furthermore, when the writing result of more than half of the information copies is successful, it is determined that the metadata information of the file to be written is written successfully, and the GFS client then performs the writing operation of the file to be written to the GFS server and the backup server.
步骤703,确定所述待写入文件对应于所述GFS服务端的多个服务节点和对应于所述备份服务器的多个服务节点。Step 703: Determine the multiple service nodes of the GFS server and the multiple service nodes of the backup server corresponding to the file to be written.
在本公开实施例中,在待写入文件的元数据信息写入成功的情况下,GFS客户端根据待写入文件的文件大小、副本数量以及各个GFS服务节点的节点容量等,确定可以写入的GFS服务端的多个服务节点的节点标识,多个服务节点的数量与文件副本的副本数量相同,同样为大于1的奇数,多个文件副本中的一个为主副本,主副本对应的GFS服务节点为主节点,在后续的元数据信息、备份副本读取等过程中,基于同机房优先逻辑,优先由文件副本中的主副本所在的主节点的BMST线程与元数据服务器、备份服务器等交互。In the disclosed embodiment, when the metadata information of the file to be written is written successfully, the GFS client determines the node identifiers of multiple service nodes of the GFS server that can be written according to the file size of the file to be written, the number of copies, and the node capacity of each GFS service node. The number of multiple service nodes is the same as the number of copies of the file copy, which is also an odd number greater than 1. One of the multiple file copies is the primary copy, and the GFS service node corresponding to the primary copy is the primary node. In the subsequent metadata information, backup copy reading, etc., based on the same computer room priority logic, the BMST thread of the primary node where the primary copy of the file copy is located will interact with the metadata server, backup server, etc.
同理,在待写入文件的元数据信息写入成功的情况下,GFS客户端根据待写入文件的文件大小、副本数量以及备份服务器的各个服务节点的节点容量等,确定可以写入的备份服务器的多个服务节点的节点标识,多个服务节点的数量与备份副本的副本数量相同,同样为大于1的奇数,多个备份副本中的一个为主副本,主副本对应的备份服务器的服务节点为主节点,在后续的备份副本读取等过程中,基于同机房优先逻辑,优先由备份副本中的主副本所在的主节点与GFS服务端等交互。Similarly, when the metadata information of the file to be written is written successfully, the GFS client determines the node identifiers of multiple service nodes of the backup server that can be written based on the file size of the file to be written, the number of copies, and the node capacity of each service node of the backup server. The number of multiple service nodes is the same as the number of copies of the backup copy, which is also an odd number greater than 1. One of the multiple backup copies is the primary copy, and the service node of the backup server corresponding to the primary copy is the primary node. In the subsequent backup copy reading process, based on the same computer room priority logic, the primary node where the primary copy in the backup copy is located will interact with the GFS server first.
进一步地,可以将待写入文件对应的GFS服务端的服务节点的节点标识和备份服务器的服务节点的节点标识添加至待写入文件的元数据信息。Furthermore, the node identifier of the service node of the GFS server corresponding to the file to be written and the node identifier of the service node of the backup server may be added to the metadata information of the file to be written.
步骤704,将所述待写入文件的文件块分别发送至所述GFS服务端的多个服务节点中的主节点以及所述备份服务器的多个服务节点中的主节点。Step 704: Send the file blocks to be written to the file to be written to the master node among the multiple service nodes of the GFS server and the master node among the multiple service nodes of the backup server respectively.
在本公开实施例中,GFS客户端将确定的多个服务节点中除主节点以外的从节点的节点标识和待写入文件的文件块发送给确定的GFS服务端的多个服务节点中的主节点,使得主节点落盘待写入文件的文件块,并向其它从节点同步,使得各个从节点落盘待写入文件的文件块,由此,即可实现待写入文件的多个文件副本的存储。In the disclosed embodiment, the GFS client sends the node identifiers of the slave nodes other than the master node among the determined multiple service nodes and the file blocks of the files to be written to the master node among the determined multiple service nodes of the GFS server, so that the master node writes the file blocks of the files to be written to the disk, and synchronizes with other slave nodes, so that each slave node writes the file blocks of the files to be written to the disk, thereby realizing the storage of multiple file copies of the files to be written.
进一步地,备份服务器的备份副本的写入与GFS服务端同理,在此不再赘述。Furthermore, the writing of the backup copy of the backup server is the same as that of the GFS server, which will not be repeated here.
步骤705,确定所述待写入文件的元数据信息的写入结果为写入失败,回滚所述元数据服务器。Step 705: Determine that the writing result of the metadata information of the file to be written is a writing failure, and roll back the metadata server.
在本公开实施例中,在超过半数的信息副本的写入结果为写入失败的情况下,确定待写入文件的元数据信息的写入结果为写入失败,将元数据服务器回滚至待写入文件的元数据信息写入之前的状态。In the disclosed embodiment, when the writing result of more than half of the information copies is write failure, it is determined that the writing result of the metadata information of the file to be written is write failure, and the metadata server is rolled back to the state before the metadata information of the file to be written was written.
在本公开实施例中,通过本公开的文件的存储方法,能够实现待写入文件的元数据信息的存储以及GFS服务端、备份服务器的待写入文件的文件副本落盘,由此,文件的元数据信息存储至元数据服务器、文件副本分别存储至GFS服务端和备份服务器,元数据服务器的元数据信息即可用于后续的文件是否损坏检测,进而无需进行整个文件的内容比对,大大减小修复耗时和修复所需资源等修复成本;GFS服务端写入的文件用以执行后续的数据处理请求、文件检测任务等操作,备份服务器写入的文件用以兜底GFS服务端的文件副本全损坏的极限情况。In the disclosed embodiment, through the file storage method of the disclosed embodiment, it is possible to realize the storage of metadata information of the file to be written and the placement of file copies of the file to be written on the GFS server and the backup server. As a result, the metadata information of the file is stored in the metadata server, and the file copy is stored in the GFS server and the backup server respectively. The metadata information of the metadata server can be used for subsequent file damage detection, and there is no need to compare the contents of the entire file, which greatly reduces the repair time and repair costs such as the resources required for repair; the files written by the GFS server are used to execute subsequent data processing requests, file detection tasks and other operations, and the files written by the backup server are used to cover the extreme case where the file copy of the GFS server is completely damaged.
步骤103,将所述待检测文件的元数据信息与对应的服务节点上存储的文件副本进行对比,确定各个所述文件副本中的损坏副本、以及各个所述损坏副本的损坏类型。Step 103: Compare the metadata information of the file to be detected with the file copies stored on the corresponding service nodes to determine the damaged copies among the file copies and the damage type of each damaged copy.
在本公开实施例中,将待检测文件的元数据信息与对应的服务节点上存储的文件副本挨个对比,先对比元数据信息的文件大小与副本大小进行粗筛;在文件大小与副本大小相同的情况下再遍历文本块的哈希值进行细筛,直至各个文件副本的文本块遍历完毕,确定存在损坏的损坏副本以及损坏副本的损坏类型,后续可以基于不同的损坏类型采取不同的修复方式修复损坏副本。In the disclosed embodiment, the metadata information of the file to be detected is compared one by one with the file copy stored on the corresponding service node, and the file size of the metadata information is first compared with the copy size for coarse screening; when the file size and the copy size are the same, the hash value of the text block is traversed for fine screening until the text blocks of each file copy are traversed, and the existence of damaged copies and the damage type of the damaged copies are determined. Subsequently, different repair methods can be adopted to repair the damaged copies based on different damage types.
进一步地,如图8所示,本公开的文件的检测方法包括如下步骤:Further, as shown in FIG8 , the file detection method disclosed in the present invention includes the following steps:
在本公开实施例中,本公开损坏副本及损坏类型的确定方法由与待检测文件对应的各个GFS服务节点执行。In the embodiment of the present disclosure, the method for determining the damaged replica and the damage type of the present disclosure is executed by each GFS service node corresponding to the file to be detected.
步骤801,查找与所述文件名称相同的副本名称。Step 801, searching for a copy name that is identical to the file name.
在本公开实施例中,对于定期触发的文件检测任务,glusterfsd进程启动后,各个GFS服务节点还将启动一个BMST线程,待检测文件的主副本所在的GFS服务节点的BMST线程访问元数据服务器,读取待检测文件的元数据信息并分发给各个从副本所在的GFS服务节点的BMST线程,由此,待检测文件对应的各个GFS服务节点即可从节点自身查找与待检测文件的文件名称相同的副本名称。In the disclosed embodiment, for periodically triggered file detection tasks, after the glusterfsd process is started, each GFS service node will also start a BMST thread. The BMST thread of the GFS service node where the primary copy of the file to be detected is located accesses the metadata server, reads the metadata information of the file to be detected and distributes it to the BMST threads of the GFS service nodes where the slave copies are located. As a result, each GFS service node corresponding to the file to be detected can search for the copy name that is the same as the file name of the file to be detected from the node itself.
进一步地,各个GFS服务节点的BMST线程将待检测文件的元数据信息分发给各个BWST线程,每个BWST线程维护一个线程队列,线程队列用于承载待检测文件的元数据信息,使得各个BWST线程按序进行队列内各个待检测文件的文件检测,,其中,线程队列的检测顺序为先进先出。Furthermore, the BMST thread of each GFS service node distributes the metadata information of the files to be detected to each BWST thread. Each BWST thread maintains a thread queue, which is used to carry the metadata information of the files to be detected, so that each BWST thread performs file detection on each file to be detected in the queue in sequence, where the detection order of the thread queue is first-in-first-out.
更进一步地,BMST线程向各个BWST线程分发待检测文件的元数据信息时,会根据各个BWST线程的线程队列的队列长度,优先将待检测文件的元数据信息分发给队列长度最小的BWST线程,以查找与待检测文件的文件名称相同的副本名称。Furthermore, when the BMST thread distributes metadata information of the file to be detected to each BWST thread, it will preferentially distribute the metadata information of the file to be detected to the BWST thread with the smallest queue length based on the queue length of the thread queue of each BWST thread, so as to find the copy name that is the same as the file name of the file to be detected.
或者,在本公开实施例中,对于响应式触发的文件检测任务,glusterfsd进程启动后,各个GFS服务节点还将启动一个BMST线程,待检测文件的主副本所在的GFS服务节点的BMST线程访问元数据服务器,读取待检测文件的元数据信息并分发给各个从副本所在的GFS服务节点的BMST线程,BMST线程优先将待检测文件的元数据信息分发给队列长度最小的BWST线程,以查找与待检测文件的文件名称相同的副本名称。Alternatively, in the disclosed embodiment, for a responsively triggered file detection task, after the glusterfsd process is started, each GFS service node will also start a BMST thread. The BMST thread of the GFS service node where the primary copy of the file to be detected is located accesses the metadata server, reads the metadata information of the file to be detected and distributes it to the BMST threads of the GFS service nodes where the slave copies are located. The BMST thread preferentially distributes the metadata information of the file to be detected to the BWST thread with the smallest queue length to find a copy name that is the same as the file name of the file to be detected.
步骤802,将所述待检测文件的文件大小与所述副本名称对应的文件副本的副本大小进行对比。Step 802: Compare the file size of the to-be-detected file with the copy size of the file copy corresponding to the copy name.
在本公开实施例中,待检测文件的元数据信息中包括待检测文件的文件大小,BWST线程将待检测文件的文件大小与查找到的副本名称对应的文件副本的副本大小进行对比。In the disclosed embodiment, the metadata information of the file to be detected includes the file size of the file to be detected, and the BWST thread compares the file size of the file to be detected with the copy size of the file copy corresponding to the found copy name.
步骤803,判断所述待检测文件的文件大小与所述副本名称对应的文件副本的副本大小是否相同,如果是,转至步骤804;如果否,转至步骤814。Step 803 , determining whether the file size of the file to be detected is the same as the copy size of the file copy corresponding to the copy name, if yes, go to step 804 ; if no, go to step 814 .
在本公开实施例中,比如,待检测文件ABC在GPS服务节点1、GPS服务节点2、GPS服务节点3上各有一个文件副本,分别为ABC-1、ABC-2、ABC-3,因此,分别判断文件ABC的文件大小与ABC-1的副本大小、ABC-2的副本大小、ABC-3的副本大小是否相同。In the disclosed embodiment, for example, the file ABC to be detected has a file copy on GPS service node 1, GPS service node 2, and GPS service node 3, respectively, which are ABC-1, ABC-2, and ABC-3. Therefore, it is determined whether the file size of file ABC is the same as the copy size of ABC-1, the copy size of ABC-2, and the copy size of ABC-3.
步骤804,将所述文件副本的第一个副本块作为当前副本块、所述待检测文件的第一个文件块作为当前文件块。Step 804: Use the first replica block of the file replica as the current replica block and the first file block of the file to be detected as the current file block.
在本公开实施例中,待检测文件的元数据信息中还包括待检测文件被切分后的各个文件块的哈希值,比如,待检测文件ABC按照预设偏移量被切分为6块,各个文件块的哈希值分别为metaABC-1、metaABC-2、metaABC-3、metaABC-4、metaABC-5、metaABC-6。In the disclosed embodiment, the metadata information of the file to be detected also includes the hash values of each file block after the file to be detected is divided. For example, the file ABC to be detected is divided into 6 blocks according to a preset offset, and the hash values of each file block are metaABC-1, metaABC-2, metaABC-3, metaABC-4, metaABC-5, and metaABC-6 respectively.
进一步地,在待检测文件的文件大小与副本名称对应的文件副本的副本大小相同的情况下,逐个对比待检测文件的元数据信息中各个文本块的哈希值和文件副本中各个文本块的哈希值,具体地:Furthermore, when the file size of the file to be detected is the same as the copy size of the file copy corresponding to the copy name, the hash value of each text block in the metadata information of the file to be detected and the hash value of each text block in the file copy are compared one by one, specifically:
将文件副本的第一个副本块作为当前副本块、待检测文件的第一个文件块作为当前文件块。比如,GPS服务节点1的BWST线程将ABC-1的第一个副本块作为当前副本块、GPS服务节点2的BWST线程将ABC-2的第一个副本块作为当前副本块、GPS服务节点3的BWST线程将ABC-3的第一个副本块作为当前副本块。The first replica block of the file replica is used as the current replica block, and the first file block of the file to be detected is used as the current file block. For example, the BWST thread of GPS service node 1 uses the first replica block of ABC-1 as the current replica block, the BWST thread of GPS service node 2 uses the first replica block of ABC-2 as the current replica block, and the BWST thread of GPS service node 3 uses the first replica block of ABC-3 as the current replica block.
步骤805,计算所述当前副本块的哈希值。Step 805, calculating the hash value of the current replica block.
在本公开实施例中,比如,GPS服务节点1的BWST线程计算ABC-1的当前副本块的哈希值hash(ABC-1-1)、GPS服务节点2的BWST线程计算ABC-2的当前副本块的哈希值hash(ABC-2-1)、GPS服务节点3的BWST线程计算ABC-3的当前副本块的哈希值hash(ABC-3-1)。In the disclosed embodiment, for example, the BWST thread of GPS service node 1 calculates the hash value hash(ABC-1-1) of the current replica block of ABC-1, the BWST thread of GPS service node 2 calculates the hash value hash(ABC-2-1) of the current replica block of ABC-2, and the BWST thread of GPS service node 3 calculates the hash value hash(ABC-3-1) of the current replica block of ABC-3.
步骤806,判断所述当前副本块的哈希值和所述当前文件块的哈希值是否相等,如果是,转至步骤807;如果否,转至步骤808。Step 806, determine whether the hash value of the current replica block is equal to the hash value of the current file block, if yes, go to step 807; if not, go to step 808.
在本公开实施例中,比如,GPS服务节点1的BWST线程将当前副本块的哈希值hash(ABC-1-1)与元数据信息中的当前文本块的哈希值(metaABC-1)进行对比、GPS服务节点2的BWST线程将当前副本块的哈希值hash(ABC-2-1)与元数据信息中的当前文本块的哈希值metaABC-1进行对比、GPS服务节点3的BWST线程将当前副本块的哈希值hash(ABC-3-1)与元数据信息中的当前文本块的哈希值metaABC-1进行对比,以此类推。In the disclosed embodiment, for example, the BWST thread of GPS service node 1 compares the hash value hash(ABC-1-1) of the current replica block with the hash value (metaABC-1) of the current text block in the metadata information, the BWST thread of GPS service node 2 compares the hash value hash(ABC-2-1) of the current replica block with the hash value metaABC-1 of the current text block in the metadata information, and the BWST thread of GPS service node 3 compares the hash value hash(ABC-3-1) of the current replica block with the hash value metaABC-1 of the current text block in the metadata information, and so on.
步骤807,将所述当前副本块的下一副本块更新为当前副本块、所述当前文件块的下一文件块更新为当前文件块,转至步骤805。Step 807 , update the next replica block of the current replica block to the current replica block, and update the next file block of the current file block to the current file block, and go to step 805 .
在本公开实施例中,在当前副本块的哈希值和当前文件块的哈希值相等的情况下,将当前副本块的下一副本块更新为当前副本块、当前文件块的下一文件块更新为当前文件块,按序进行对比。比如,GPS服务节点1的BWST线程更新ABC-1的第二个副本块为当前副本块、GPS服务节点2的BWST线程更新ABC-2的第二个副本块为当前副本块、GPS服务节点3的BWST线程更新ABC-3的第二个副本块为当前副本块。In the disclosed embodiment, when the hash value of the current replica block is equal to the hash value of the current file block, the next replica block of the current replica block is updated to the current replica block, and the next file block of the current file block is updated to the current file block, and the comparison is performed in order. For example, the BWST thread of GPS service node 1 updates the second replica block of ABC-1 to the current replica block, the BWST thread of GPS service node 2 updates the second replica block of ABC-2 to the current replica block, and the BWST thread of GPS service node 3 updates the second replica block of ABC-3 to the current replica block.
步骤808,确定所述当前副本块为损坏块且所述文件副本为损坏副本。Step 808: Determine that the current copy block is a damaged block and the file copy is a damaged copy.
在本公开实施例中,在当前副本块的哈希值和当前文件块的哈希值不等的情况下,确定当前副本块为损坏块且与损坏块对应的文件副本为损坏副本。比如,GPS服务节点1的BWST线程检测发现ABC-1的第四个副本块为损坏块,文件副本ABC-1为损坏副本。In the disclosed embodiment, when the hash value of the current replica block is not equal to the hash value of the current file block, the current replica block is determined to be a damaged block and the file replica corresponding to the damaged block is a damaged replica. For example, the BWST thread of GPS service node 1 detects and finds that the fourth replica block of ABC-1 is a damaged block, and the file replica ABC-1 is a damaged replica.
进一步地,从损坏副本的损坏块的块标识开始统计,直至损坏副本的最后一个副本块的块标识,得到损坏块标识组。比如,GPS服务节点1的BWST线程从损坏块的块标识ABC-1-4开始统计,直至损坏副本ABC-1的最后一个副本块的块标识ABC-1-6,得到损坏块标识组(ABC-1-4,ABC-1-5,ABC-1-6),文件副本ABC-1为损坏副本。Furthermore, statistics are counted from the block identifier of the damaged block of the damaged copy until the block identifier of the last copy block of the damaged copy, to obtain a damaged block identifier group. For example, the BWST thread of GPS service node 1 starts counting from the block identifier ABC-1-4 of the damaged block until the block identifier ABC-1-6 of the last copy block of the damaged copy ABC-1, to obtain a damaged block identifier group (ABC-1-4, ABC-1-5, ABC-1-6), and the file copy ABC-1 is a damaged copy.
步骤809,统计所述待检测文件的损坏副本的副本数量,判断所述待检测文件的损坏副本的副本数量是否等于对应的文本副本的副本总数,如果是,转至步骤810;如果否,转至步骤811。Step 809, counting the number of damaged copies of the file to be detected, and determining whether the number of damaged copies of the file to be detected is equal to the total number of corresponding text copies; if so, go to step 810; if not, go to step 811.
步骤810,确定所述损坏副本的损坏类型为第一类型。Step 810: Determine that the damage type of the damaged copy is the first type.
步骤811,判断所述文件副本中除所述损坏副本以外的正常副本的副本数量是否大于等于并发阈值,如果是,转至步骤812;如果否,转至步骤813。Step 811, determine whether the number of normal copies of the file except the damaged copy is greater than or equal to the concurrency threshold, if yes, go to step 812; if not, go to step 813.
在本公开实施例中,并发阈值大于等于2,使得后续修复过程中可以从多个副本并发同步,提高修复效率。In the disclosed embodiment, the concurrency threshold is greater than or equal to 2, so that multiple replicas can be synchronized concurrently during the subsequent repair process, thereby improving the repair efficiency.
进一步地,优选地,并发阈值为2。Further, preferably, the concurrency threshold is 2.
步骤812,确定所述损坏副本的损坏类型为第二类型。Step 812: Determine that the damage type of the damaged copy is the second type.
步骤813,确定所述损坏副本的损坏类型为第三类型。Step 813: Determine that the damage type of the damaged copy is the third type.
步骤814,确定与所述副本名称对应的文件副本为所述损坏副本,转至步骤809。Step 814 , determining that the file copy corresponding to the copy name is the damaged copy, and going to step 809 .
在本公开实施例中,在待检测文件的文件大小与副本名称对应的文件副本的副本大小不同的情况下,确定与副本名称对应的文件副本为损坏副本。In the disclosed embodiment, when the file size of the to-be-detected file is different from the copy size of the file copy corresponding to the copy name, it is determined that the file copy corresponding to the copy name is a damaged copy.
进一步地,GFS服务端创建临时存储区,将损坏副本备份,临时存储区的大小可以根据需要进行选择性设置,比如,临时存储区为100G。Furthermore, the GFS server creates a temporary storage area to back up the damaged copy. The size of the temporary storage area can be selectively set as needed. For example, the temporary storage area is 100G.
在本公开实施例中,通过本公开的文件的检测方法,由于BMST线程直接先读取元数据信息进行对比判断待检测文件是否存在损坏,而非直接全盘扫描,可以大大降低检测成本,进而缩短文件的检测耗时、减小检测资源的占用,降低检测成本,进而使得系统负载减小、系统性能提升,保证用户的正常数据访问、以及正常请求响应,提升用户访问体验。In the disclosed embodiment, through the file detection method of the disclosed embodiment, since the BMST thread directly reads the metadata information for comparison to determine whether the file to be detected is damaged, rather than directly scanning the entire disk, the detection cost can be greatly reduced, thereby shortening the file detection time, reducing the occupancy of detection resources, and reducing the detection cost, thereby reducing the system load and improving the system performance, ensuring the user's normal data access and normal request response, and improving the user's access experience.
步骤104,根据所述损坏类型,对所述损坏副本进行备份修复或者同步修复。Step 104: Perform backup repair or synchronous repair on the damaged copy according to the damage type.
在本公开实施例中,不同的损坏类型可以采用不同的修复方式进行修复,以在损坏较小的时候直接利用副本同步,损坏较大的时候利用备份服务器兜底修复,可以最大限度地保证文件数据内容的准确,同时降低修复成本。In the disclosed embodiment, different types of damage can be repaired using different repair methods, such as directly using replica synchronization when the damage is minor, and using a backup server for backup repair when the damage is major, which can maximize the accuracy of the file data content while reducing the cost of repair.
进一步地,如图9所示,本公开的文件的修复方法包括:Further, as shown in FIG9 , the file repair method of the present disclosure includes:
步骤901,判断所述损坏副本的损坏类型是否为第一类型,如果是,转至步骤902;如果否,转至步骤903。Step 901, determine whether the damage type of the damaged copy is the first type, if yes, go to step 902; if no, go to step 903.
步骤902,采用备份修复的方式修复所述损坏副本。Step 902: Repair the damaged copy by using a backup repair method.
在本公开实施例中,如图10所示,本公开的备份修复的方法包括如下步骤:In an embodiment of the present disclosure, as shown in FIG10 , the backup and repair method of the present disclosure includes the following steps:
步骤1001,根据端点配置中的备份服务器地址,访问备份服务器。Step 1001: access the backup server according to the backup server address in the endpoint configuration.
在本公开实施例中,损坏副本所在的GFS服务节点的BMST线程从endpoint对象中读取备份服务器地址,访问备份服务器以读取损坏副本的备份副本。In the disclosed embodiment, the BMST thread of the GFS service node where the damaged copy is located reads the backup server address from the endpoint object and accesses the backup server to read the backup copy of the damaged copy.
步骤1002,根据所述损坏副本的副本名称,从所述备份服务器上读取所述损坏副本的备份副本。Step 1002: Read the backup copy of the damaged copy from the backup server according to the copy name of the damaged copy.
步骤1003,利用所述备份副本覆盖所述损坏副本。Step 1003: Use the backup copy to overwrite the damaged copy.
在本公开实施例中,损坏副本所在的GFS服务节点的BMST线程将读取到的备份副本覆盖损坏副本。In the disclosed embodiment, the BMST thread of the GFS service node where the damaged copy is located overwrites the damaged copy with the backup copy read.
在本公开实施例中,通过本公开的备份修复的方法,对于第一类型的损坏副本进行备份修复,实现极端场景——即文件副本全故障下的文件修复,以提高修复效率,降低修复成本,保证文件数据内容的准确度,提高用户访问体验。In the embodiment of the present disclosure, the backup and repair method of the present disclosure is used to perform backup and repair on the damaged copy of the first type, thereby realizing an extreme scenario, that is, file repair under a complete failure of the file copy, so as to improve the repair efficiency, reduce the repair cost, ensure the accuracy of the file data content, and improve the user access experience.
进一步地,还可以对修复后的副本进行兜底校验,判断各个副本块的哈希值与备份服务器中的是否一致,以保证修复的准确性。Furthermore, the repaired replica can be verified to determine whether the hash value of each replica block is consistent with that in the backup server to ensure the accuracy of the repair.
步骤903,采用同步修复的方式修复所述损坏副本。Step 903: Repair the damaged copy by synchronous repair.
在本公开实施例中,如图11所示,本公开的同步修复的方法包括如下步骤:In an embodiment of the present disclosure, as shown in FIG11 , the synchronous repair method of the present disclosure includes the following steps:
步骤1101,判断所述损坏副本的损坏类型是否为第二类型,如果是,转至步骤1102;如果否,转至步骤1103。Step 1101, determine whether the damage type of the damaged copy is the second type, if yes, go to step 1102; if no, go to step 1103.
步骤1102,采用并发同步的方式修复所述损坏副本。Step 1102, repair the damaged copy by concurrent synchronization.
在本公开实施例中,在损坏副本的损坏类型为第二类型的情况下,表明正常副本的副本数量大于等于并发阈值,故而存在多个正常副本,可以并发向损坏副本同步损坏块的数据内容,大大提高修复速度,提升修复效率。In the embodiment of the present disclosure, when the damage type of the damaged copy is the second type, it indicates that the number of normal copies is greater than or equal to the concurrency threshold, so there are multiple normal copies, and the data content of the damaged block can be synchronized to the damaged copy concurrently, which greatly improves the repair speed and improves the repair efficiency.
步骤11021,分配损坏块标识组的各个块标识,为所述损坏副本对应的各个正常副本匹配至少一个目标块标识。Step 11021, assign each block identifier of the damaged block identifier group, and match at least one target block identifier for each normal copy corresponding to the damaged copy.
在本公开实施例中,损坏副本所在的GFS服务节点的BMST线程将损坏块标识组中的块标识分配至正常副本所在的GFS服务节点的BMST线程,使得各个正常副本所在的GFS服务节点的BMST线程匹配至少一个目标块标识,并发向损坏副本所在的GFS服务节点的BMST线程同步损坏块对应的数据内容,以修复损坏副本。其中,分配的方式可以是平均分配。In the disclosed embodiment, the BMST thread of the GFS service node where the damaged replica is located distributes the block identifiers in the damaged block identifier group to the BMST thread of the GFS service node where the normal replica is located, so that the BMST thread of the GFS service node where each normal replica is located matches at least one target block identifier, and sends the data content corresponding to the damaged block to the BMST thread of the GFS service node where the damaged replica is located to synchronize, so as to repair the damaged replica. The distribution method may be average distribution.
进一步地,对于无法平均分配的、剩余的块标识可以随机选择正常副本对应的BMST线程,也即,根据剩余的块标识的个数,随机选择相应个数的正常副本所在的BMST线程进行分配,被分配的剩余的块标识也属于被选择的正常副本匹配的目标块标识。比如,GPS服务节点1的BWST线程将损坏块标识组(ABC-1-4,ABC-1-5,ABC-1-6)平均分配至正常副本ABC-2、ABC-3所在的服务节点,平均分配至正常副本ABC-2、ABC-3时会剩余一个块标识,随机选择正常副本ABC-2进行分配,故而正常副本ABC-2的目标块标识包括ABC-1-4、ABC-1-5、正常副本ABC-3的目标块标识为ABC-1-6。Furthermore, for the remaining block identifiers that cannot be evenly distributed, the BMST threads corresponding to the normal replicas can be randomly selected, that is, according to the number of remaining block identifiers, the BMST threads where the normal replicas of the corresponding number are located are randomly selected for distribution, and the remaining block identifiers that are distributed also belong to the target block identifiers that match the selected normal replicas. For example, the BWST thread of GPS service node 1 evenly distributes the damaged block identifier group (ABC-1-4, ABC-1-5, ABC-1-6) to the service nodes where the normal replicas ABC-2 and ABC-3 are located. When evenly distributing to the normal replicas ABC-2 and ABC-3, there will be one block identifier left. The normal replica ABC-2 is randomly selected for distribution, so the target block identifiers of the normal replica ABC-2 include ABC-1-4 and ABC-1-5, and the target block identifier of the normal replica ABC-3 is ABC-1-6.
步骤11022,根据所述目标块标识,利用从各个所述正常副本同步的副本块覆盖所述损坏副本中对应块标识的副本块。Step 11022: Based on the target block identifier, the replica blocks synchronized from the normal replicas are used to overwrite the replica blocks corresponding to the block identifier in the damaged replica.
在本公开实施例中,各个正常副本所在的GFS服务节点的BMST线程将匹配到的目标块标识对应的副本块发送给损坏副本所在的GFS服务节点的BMST线程;损坏副本所在的GFS服务节点的BMST线程根据目标块标识,利用从各个正常副本所在的GFS服务节点同步到的副本块覆盖损坏副本中对应块标识的副本块。比如,正常副本ABC-2所在的GFS服务节点2的BMST线程将匹配到的ABC-1-4和ABC-1-5对应的ABC-2-4和ABC-2-5的副本块发送给损坏副本ABC-1所在的GFS服务节点1的BMST线程、正常副本ABC-3所在的GFS服务节点3的BMST线程将匹配到的ABC-1-6对应的ABC-3-6的副本块发送给损坏副本所在的GFS服务节点1的BMST线程;损坏副本ABC-1所在的GFS服务节点1的BMST线程接收到ABC-2-4、ABC-2-5、ABC-3-6对应的副本块后,分别利用ABC-2-4、ABC-2-5、ABC-3-6对应的副本块覆盖损坏副本ABC-1中ABC-1-4、ABC-1-5、ABC-1-6的副本块。In the disclosed embodiment, the BMST thread of the GFS service node where each normal replica is located sends the replica block corresponding to the matched target block identifier to the BMST thread of the GFS service node where the damaged replica is located; the BMST thread of the GFS service node where the damaged replica is located uses the replica blocks synchronized from the GFS service nodes where each normal replica is located to overwrite the replica block with the corresponding block identifier in the damaged replica based on the target block identifier. For example, the BMST thread of GFS service node 2 where the normal replica ABC-2 is located sends the replica blocks of ABC-2-4 and ABC-2-5 corresponding to the matched ABC-1-4 and ABC-1-5 to the BMST thread of GFS service node 1 where the damaged replica ABC-1 is located, and the BMST thread of GFS service node 3 where the normal replica ABC-3 is located sends the replica block of ABC-3-6 corresponding to the matched ABC-1-6 to the BMST thread of GFS service node 1 where the damaged replica is located; after the BMST thread of GFS service node 1 where the damaged replica ABC-1 is located receives the replica blocks corresponding to ABC-2-4, ABC-2-5, and ABC-3-6, it uses the replica blocks corresponding to ABC-2-4, ABC-2-5, and ABC-3-6 to overwrite the replica blocks of ABC-1-4, ABC-1-5, and ABC-1-6 in the damaged replica ABC-1 respectively.
步骤1103,采用单独同步的方式修复所述损坏副本。Step 1103: Repair the damaged copy by using a separate synchronization method.
在本公开实施例中,在损坏副本的损坏类型为第三类型的情况下,表明正常副本的副本数量小于异步阈值,仅存在一个正常副本,故而用该正常副本向各个损坏副本同步。In the embodiment of the present disclosure, when the damage type of the damaged replica is the third type, it indicates that the number of normal replicas is less than the asynchronous threshold, and there is only one normal replica, so the normal replica is used to synchronize with each damaged replica.
步骤11031,接收正常副本同步的与损坏块标识组的各个块标识匹配的副本块。Step 11031, receiving replica blocks synchronized with normal replicas that match the respective block identifiers of the damaged block identifier group.
在本公开实施例中,在仅存在一个正常副本的情况下,该正常副本所在的GFS服务节点的BMST线程将损坏块标识组中各个块标识对应的副本块发送给损坏副本所在的GFS服务节点的BMST线程。In the embodiment of the present disclosure, when there is only one normal replica, the BMST thread of the GFS service node where the normal replica is located sends the replica blocks corresponding to each block identifier in the damaged block identifier group to the BMST thread of the GFS service node where the damaged replica is located.
步骤11032,利用从所述正常副本同步的副本块覆盖所述损坏副本中与所述损坏块标识组的各个块标识对应的副本块。Step 11032: Use the replica blocks synchronized from the normal replica to overwrite the replica blocks corresponding to the block identifiers of the damaged block identifier group in the damaged replica.
在本公开实施例中,损坏副本所在的GFS服务节点的BMST线程根据损坏块标识组的各个块标识,利用从正常副本所在的GFS服务节点同步到的副本块覆盖损坏副本中对应块标识的副本块。比如,损坏副本ABC-1的损坏块标识组为(ABC-1-4,ABC-1-5,ABC-1-6)、损坏副本ABC-2的损坏块标识组为(ABC-2-1,ABC-2-2,ABC-2-3,ABC-2-4,ABC-2-5,ABC-2-6),正常副本ABC-3所在的GFS服务节点3的BMST线程向损坏副本ABC-1所在的GFS服务节点1的BMST线程同步ABC-3-4、ABC-3-5、ABC-3-6的副本块,正常副本ABC-3所在的GFS服务节点3的BMST线程向损坏副本ABC-2所在的GFS服务节点2的BMST线程同步ABC-3-1、ABC-3-2、ABC-3-3、ABC-3-4、ABC-3-5、ABC-3-6的副本块,In the disclosed embodiment, the BMST thread of the GFS service node where the damaged replica is located uses the replica blocks synchronized from the GFS service node where the normal replica is located to overwrite the replica blocks with corresponding block identifiers in the damaged replica according to the block identifiers of the damaged block identifier group. For example, the damaged block identification group of the damaged replica ABC-1 is (ABC-1-4, ABC-1-5, ABC-1-6), and the damaged block identification group of the damaged replica ABC-2 is (ABC-2-1, ABC-2-2, ABC-2-3, ABC-2-4, ABC-2-5, ABC-2-6). The BMST thread of GFS service node 3 where the normal replica ABC-3 is located synchronizes the replica blocks of ABC-3-4, ABC-3-5, and ABC-3-6 to the BMST thread of GFS service node 1 where the damaged replica ABC-1 is located. The BMST thread of GFS service node 3 where the normal replica ABC-3 is located synchronizes the replica blocks of ABC-3-1, ABC-3-2, ABC-3-3, ABC-3-4, ABC-3-5, and ABC-3-6 to the BMST thread of GFS service node 2 where the damaged replica ABC-2 is located.
损坏副本ABC-1所在的GFS服务节点1的BMST线程接收到ABC-3-4、ABC-3-5、ABC-3-6对应的副本块后,分别利用ABC-3-4、ABC-3-5、ABC-3-6对应的副本块覆盖损坏副本ABC-1中ABC-1-4、ABC-1-5、ABC-1-6的副本块;损坏副本ABC-2所在的GFS服务节点2的BMST线程接收到ABC-3-1、ABC-3-2、ABC-3-3、ABC-3-4、ABC-3-5、ABC-3-6对应的副本块后,分别利用ABC-3-1、ABC-3-2、ABC-3-3、ABC-3-4、ABC-3-5、ABC-3-6对应的副本块覆盖损坏副本ABC-2中ABC-2-1、ABC-2-2、ABC-2-3、ABC-2-4、ABC-2-5、ABC-2-6的副本块。After the BMST thread of GFS service node 1 where the damaged replica ABC-1 is located receives the replica blocks corresponding to ABC-3-4, ABC-3-5, and ABC-3-6, it uses the replica blocks corresponding to ABC-3-4, ABC-3-5, and ABC-3-6 to overwrite the replica blocks of ABC-1-4, ABC-1-5, and ABC-1-6 in the damaged replica ABC-1 respectively; after the BMST thread of GFS service node 2 where the damaged replica ABC-2 is located receives the replica blocks corresponding to ABC-3-1, ABC-3-2, ABC-3-3, ABC-3-4, ABC-3-5, and ABC-3-6, it uses the replica blocks corresponding to ABC-3-1, ABC-3-2, ABC-3-3, ABC-3-4, ABC-3-5, and ABC-3-6 to overwrite the replica blocks of ABC-2-1, ABC-2-2, ABC-2-3, ABC-2-4, ABC-2-5, and ABC-2-6 in the damaged replica ABC-2 respectively.
在本公开实施例中,通过本公开的同步修复的方法,利用正常副本并发或者单独同步覆盖损坏副本,实现损坏副本的修复,可以大大提高修复速度,提升修复效率,保证文件数据内容的准确性。In the embodiment of the present disclosure, through the synchronous repair method of the present disclosure, the damaged copy is repaired by using the normal copy concurrently or individually to synchronously overwrite the damaged copy, which can greatly improve the repair speed, improve the repair efficiency, and ensure the accuracy of the file data content.
在本公开实施例中,通过本公开的文件的检测和修复方法,引入元数据服务器,用于存储全部文件的元数据信息,从而后续检测过程中基于元数据信息定位损坏文件,大大缩短检测耗时和计算资源消耗,提升了检测效率,降低了系统负载,实现检测成本降低和系统性能提升的双重效果;并且,根据损坏副本的损坏类型确定不同的修复方式,以并发修复提高修复速度,提升修复效率,同时备份修复兜底极限全损坏场景,保证了数据内容的准确度和完整度,保障用户的正常数据访问及请求的即时响应,提升用户访问体验。In the disclosed embodiments, through the file detection and repair method disclosed in the present invention, a metadata server is introduced to store metadata information of all files, so that damaged files can be located based on the metadata information in the subsequent detection process, which greatly shortens the detection time and computing resource consumption, improves the detection efficiency, reduces the system load, and achieves the dual effects of reduced detection costs and improved system performance; and, different repair methods are determined according to the damage type of the damaged copy, and concurrent repair is used to increase the repair speed and improve the repair efficiency. At the same time, backup and repair cover the extreme full damage scenario, ensuring the accuracy and completeness of the data content, guaranteeing the user's normal data access and immediate response to requests, and improving the user access experience.
进一步地,在文件的检测和修复过程中,可以生成对应的检测日志和修复日志,记录各种检测信息和修复信息,以便后续进行审计。Furthermore, during the detection and repair process of the file, corresponding detection logs and repair logs may be generated to record various detection information and repair information for subsequent auditing.
更进一步地,在文件的检测和修复过程中,监控各个GFS服务节点的节点指标,以适时进行限速控制,避免GFS的负载明显波动影响在线访问用户,使得用户日常访问无感,提升用户访问体验,如图12所示,本公开的系统指标的监控方法包括如下步骤:Furthermore, during the detection and repair process of files, the node indicators of each GFS service node are monitored to perform speed limit control in a timely manner to avoid the obvious fluctuation of GFS load affecting online access users, so that users do not feel any daily access and improve the user access experience. As shown in FIG12 , the system indicator monitoring method disclosed in the present invention includes the following steps:
步骤1201,监控各个GFS服务节点的节点指标。Step 1201, monitor the node indicators of each GFS service node.
在本公开实施例中,各个GFS服务节点上可以设置监控代理,用以实时或者定期监控节点指标,节点指标包括CPU空闲百分比、平均负载、服务器进程的CPU占用率、和/或服务器进程的每秒读写字节数。In the disclosed embodiment, a monitoring agent may be set on each GFS service node to monitor node indicators in real time or periodically, including CPU idle percentage, average load, CPU occupancy of the server process, and/or the number of bytes read and written per second of the server process.
进一步地,定期监控的监控频率可以根据需要进行选择性设置,比如,监控频率为每隔3秒监测一次,或者,监控频率可以与文件检测任务的定期频率相同。Furthermore, the monitoring frequency of the periodic monitoring can be selectively set as needed, for example, the monitoring frequency is once every 3 seconds, or the monitoring frequency can be the same as the periodic frequency of the file detection task.
步骤1202,判断各个所述节点指标是否超过对应的指标阈值,如果是,转至步骤1203;如果否,转至步骤1201。Step 1202, determine whether each of the node indicators exceeds the corresponding indicator threshold, if yes, go to step 1203; if no, go to step 1201.
在本公开实施例中,各个节点指标的指标阈值可以根据需要进行选择性设置,比如,CPU空闲百分比阈值为50%,CPU空闲百分比超过50%即表明GFS服务节点空闲比很低、过于繁忙;平均负载通过统计单位时间内的cpu平均使用核数确定,单位时间可以是1min、3min、5min等,平均负载阈值可以是48核/min;服务器进程的CPU占用率阈值为60%等。In the disclosed embodiment, the indicator thresholds of each node indicator can be selectively set as needed. For example, the CPU idle percentage threshold is 50%. If the CPU idle percentage exceeds 50%, it means that the GFS service node has a very low idle ratio and is too busy. The average load is determined by counting the average number of CPU cores used per unit time. The unit time can be 1min, 3min, 5min, etc. The average load threshold can be 48 cores/min. The CPU occupancy threshold of the server process is 60%, etc.
步骤1203,暂停响应所述文件检测任务。Step 1203, suspending response to the file detection task.
在本公开实施例中,在任一节点指标超过对应的指标阈值的情况下,GFS服务节点的BMST线程停止文件检测任务的下发,并给管理的各个BMWT线程发送停止信号。In the disclosed embodiment, when any node indicator exceeds the corresponding indicator threshold, the BMST thread of the GFS service node stops sending file detection tasks and sends a stop signal to each managed BMWT thread.
在本公开实施例中,通过本公开的系统指标的监控方法,对各个GFS服务节点进行监控,防止GFS的明显负载波动对用户访问造成影响,从而在提升检测和修复效率的同时,保障用户的日常正常访问,提升用户访问体验。In the disclosed embodiment, each GFS service node is monitored through the system indicator monitoring method disclosed in the present invention to prevent obvious load fluctuations of GFS from affecting user access, thereby improving detection and repair efficiency while ensuring users' daily normal access and improving user access experience.
图13是根据本公开实施例的文件的检测和修复装置的主要模块的示意图,如图13所示,本公开的文件的检测和修复装置1300应用于GFS服务端的GFS服务节点,包括:FIG. 13 is a schematic diagram of the main modules of the file detection and repair device according to an embodiment of the present disclosure. As shown in FIG. 13 , the file detection and repair device 1300 of the present disclosure is applied to a GFS service node of a GFS server, including:
接收模块1301,用于接收一个或多个文件检测任务。The receiving module 1301 is used to receive one or more file detection tasks.
读取模块1302,用于响应于所述文件检测任务,根据端点配置中的元数据服务器地址,访问元数据服务器,从所述元数据服务器中读取所述文件检测任务对应的待检测文件的元数据信息。The reading module 1302 is used to access the metadata server in response to the file detection task according to the metadata server address in the endpoint configuration, and read the metadata information of the file to be detected corresponding to the file detection task from the metadata server.
对比模块1303,用于将所述待检测文件的元数据信息与对应的服务节点上存储的文件副本进行对比,确定各个所述文件副本中的损坏副本、以及各个所述损坏副本的损坏类型。The comparison module 1303 is used to compare the metadata information of the file to be detected with the file copy stored on the corresponding service node, and determine the damaged copy in each of the file copies and the damage type of each of the damaged copies.
修复模块1304,用于根据所述损坏类型,对所述损坏副本进行备份修复或者同步修复。The repair module 1304 is used to perform backup repair or synchronous repair on the damaged copy according to the damage type.
在本公开实施例中,如图5所示的文件的检测和修复系统的交互过程包括:In the embodiment of the present disclosure, the interactive process of the file detection and repair system shown in FIG5 includes:
GFS服务节点的glusterfsd进程定期触发文件检测任务,或者,GFS服务节点的glusterfsd进程接收GFS客户端触发的文件检测任务;The glusterfsd process of the GFS service node periodically triggers the file detection task, or the glusterfsd process of the GFS service node receives the file detection task triggered by the GFS client;
GFS服务节点将文件检测任务发送给BMST线程;The GFS service node sends the file detection task to the BMST thread;
BMST线程响应于文件检测任务,根据端点配置中的元数据服务器地址,访问元数据服务器;The BMST thread responds to the file detection task and accesses the metadata server according to the metadata server address in the endpoint configuration;
元数据服务器根据待检测文件的文件名称,读取待检测文件的元数据信息,并返回BMST线程;The metadata server reads the metadata information of the file to be detected according to the file name of the file to be detected, and returns it to the BMST thread;
BMST线程将待检测文件的元数据信息与文件副本进行对比,确定文件副本中的损坏副本、以及损坏副本的损坏类型;The BMST thread compares the metadata information of the file to be detected with the file copy to determine the damaged copy in the file copy and the damage type of the damaged copy;
BMST线程根据损坏副本的损坏类型,对损坏副本进行备份修复或者同步修复,具体地:The BMST thread performs backup repair or synchronous repair on the damaged replica according to the damage type of the damaged replica. Specifically:
损坏副本的损坏类型为第一类型,根据端点配置中的备份服务器地址,访问备份服务器,从所述备份服务器上读取损坏副本的备份副本,利用备份副本覆盖损坏副本;The damage type of the damaged copy is the first type, accessing the backup server according to the backup server address in the endpoint configuration, reading the backup copy of the damaged copy from the backup server, and overwriting the damaged copy with the backup copy;
损坏副本的损坏类型为第二类型,分配损坏块标识组的各个块标识,为损坏副本对应的各个正常副本匹配至少一个目标块标识,利用从各个正常副本同步的副本块覆盖损坏副本中对应块标识的副本块;The damage type of the damaged replica is the second type, each block identifier of the damaged block identifier group is allocated, at least one target block identifier is matched for each normal replica corresponding to the damaged replica, and the replica blocks synchronized from each normal replica are used to overwrite the replica blocks corresponding to the block identifiers in the damaged replica;
损坏副本的损坏类型为第三类型,利用从正常副本同步的副本块覆盖损坏副本中与损坏块标识组的各个块标识对应的副本块。The damage type of the damaged replica is the third type, and the replica blocks corresponding to the respective block identifiers of the damaged block identifier group in the damaged replica are overwritten with the replica blocks synchronized from the normal replica.
本公开示例性实施例还提供一种电子设备,包括:至少一个处理器;以及与至少一个处理器通信连接的存储器。所述存储器存储有能够被所述至少一个处理器执行的计算机程序,所述计算机程序在被所述至少一个处理器执行时用于使所述电子设备执行根据本公开实施例的方法。The exemplary embodiment of the present disclosure also provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program that can be executed by the at least one processor, and the computer program is used to cause the electronic device to perform the method according to the embodiment of the present disclosure when executed by the at least one processor.
本公开示例性实施例还提供一种存储有计算机程序的非瞬时计算机可读存储介质,其中,所述计算机程序在被计算机的处理器执行时用于使所述计算机执行根据本公开实施例的方法。The exemplary embodiments of the present disclosure also provide a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute the method according to the embodiments of the present disclosure.
本公开示例性实施例还提供一种计算机程序产品,包括计算机程序,其中,所述计算机程序在被计算机的处理器执行时用于使所述计算机执行根据本公开实施例的方法。The exemplary embodiments of the present disclosure further provide a computer program product, including a computer program, wherein when the computer program is executed by a processor of a computer, the computer is used to enable the computer to perform the method according to the embodiments of the present disclosure.
参考图14,现将描述可以作为本公开的服务器或客户端的电子设备1400的结构框图,其是可以应用于本公开的各方面的硬件设备的示例。电子设备旨在表示各种形式的数字电子的计算机设备,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。With reference to Figure 14, the structural block diagram of the electronic device 1400 that can be used as the server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer equipment, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can 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 merely examples, and are not intended to limit the implementation of the present disclosure described and/or required herein.
如图14所示,电子设备1400包括计算单元1401,其可以根据存储在只读存储器(ROM)1402中的计算机程序或者从存储单元1408加载到随机访问存储器(RAM)1403中的计算机程序,来执行各种适当的动作和处理。在RAM1403中,还可存储设备1400操作所需的各种程序和数据。计算单元1401、ROM1402以及RAM1403通过总线1404彼此相连。输入/输出(I/O)接口1405也连接至总线1404。As shown in FIG. 14 , the electronic device 1400 includes a computing unit 1401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1402 or a computer program loaded from a storage unit 1408 into a random access memory (RAM) 1403. In the RAM 1403, various programs and data required for the operation of the device 1400 can also be stored. The computing unit 1401, the ROM 1402, and the RAM 1403 are connected to each other via a bus 1404. An input/output (I/O) interface 1405 is also connected to the bus 1404.
电子设备1400中的多个部件连接至I/O接口1405,包括:输入单元1406、输出单元1407、存储单元1408以及通信单元1409。输入单元1406可以是能向电子设备1400输入信息的任何类型的设备,输入单元1406可以接收输入的数字或字符信息,以及产生与电子设备的用户设置和/或功能控制有关的键信号输入。输出单元1407可以是能呈现信息的任何类型的设备,并且可以包括但不限于显示器、扬声器、视频/音频输出终端、振动器和/或打印机。存储单元1408可以包括但不限于磁盘、光盘。通信单元1409允许电子设备1400通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据,并且可以包括但不限于调制解调器、网卡、红外通信设备、无线通信收发机和/或芯片组,例如蓝牙TM设备、WiFi设备、WiMax设备、蜂窝通信设备和/或类似物。Multiple components in the electronic device 1400 are connected to the I/O interface 1405, including: an input unit 1406, an output unit 1407, a storage unit 1408, and a communication unit 1409. The input unit 1406 can be any type of device that can input information to the electronic device 1400, and the input unit 1406 can receive input digital or character information, and generate key signal input related to user settings and/or function control of the electronic device. The output unit 1407 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video/audio output terminal, a vibrator, and/or a printer. The storage unit 1408 can include but is not limited to a disk, an optical disk. The communication unit 1409 allows the electronic device 1400 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and/or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and/or the like.
计算单元1401可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元1401的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元1401执行上文所描述的各个方法和处理。例如,在一些实施例中,图1、图4、图6至图12的方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元1408。在一些实施例中,计算机程序的部分或者全部可以经由ROM1402和/或通信单元1409而被载入和/或安装到电子设备1400上。在一些实施例中,计算单元1401可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行图1、图4、图6至图12的方法。The computing unit 1401 may be a variety of general and/or special processing components with processing and computing capabilities. Some examples of the computing unit 1401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1401 performs the various methods and processes described above. For example, in some embodiments, the methods of Figures 1, 4, 6 to 12 may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1408. In some embodiments, part or all of the computer program may be loaded and/or installed on the electronic device 1400 via ROM 1402 and/or communication unit 1409. In some embodiments, the computing unit 1401 may be configured to perform the methods of Figures 1, 4, 6 to 12 in any other appropriate manner (e.g., by means of firmware).
用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。The program code for implementing the method of the present disclosure 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, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions/operations specified in the flow chart and/or block diagram. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A 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, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
如本公开使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and/or data to a programmable processor.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein 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 the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the 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 can be received in any form (including acoustic input, voice input, or tactile input).
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
Claims (20)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410569566.XA CN118606104A (en) | 2024-05-09 | 2024-05-09 | A file detection and repair method, device and system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410569566.XA CN118606104A (en) | 2024-05-09 | 2024-05-09 | A file detection and repair method, device and system |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN118606104A true CN118606104A (en) | 2024-09-06 |
Family
ID=92550480
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410569566.XA Pending CN118606104A (en) | 2024-05-09 | 2024-05-09 | A file detection and repair method, device and system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118606104A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN121050947A (en) * | 2025-10-28 | 2025-12-02 | 苏州元脑智能科技有限公司 | Disaster recovery data restoration methods, equipment, storage media and software products |
-
2024
- 2024-05-09 CN CN202410569566.XA patent/CN118606104A/en active Pending
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN121050947A (en) * | 2025-10-28 | 2025-12-02 | 苏州元脑智能科技有限公司 | Disaster recovery data restoration methods, equipment, storage media and software products |
| CN121050947B (en) * | 2025-10-28 | 2026-02-06 | 苏州元脑智能科技有限公司 | Disaster recovery data restoration methods, equipment, storage media and software products |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10896102B2 (en) | Implementing secure communication in a distributed computing system | |
| US11281644B2 (en) | Blockchain logging of data from multiple systems | |
| US12105735B2 (en) | Asynchronous accounting method and apparatus for blockchain, medium and electronic device | |
| CN112084258A (en) | A data synchronization method and device | |
| US9026679B1 (en) | Methods and apparatus for persisting management information changes | |
| EP4213038A1 (en) | Data processing method and apparatus based on distributed storage, device, and medium | |
| EP2330519A1 (en) | Distributed file system and data block consistency managing method thereof | |
| US20130198134A1 (en) | Online verification of a standby database in log shipping physical replication environments | |
| WO2022111188A1 (en) | Transaction processing method, system, apparatus, device, storage medium, and program product | |
| CN112235405A (en) | Distributed storage system and data delivery method | |
| CN110377664B (en) | Data synchronization method, device, server and storage medium | |
| CN112579550B (en) | Metadata information synchronization method and system of distributed file system | |
| CN110413694A (en) | Metadata management method and relevant apparatus | |
| CN119557373A (en) | Data storage method, device, system and storage medium | |
| CN118606104A (en) | A file detection and repair method, device and system | |
| WO2022121387A1 (en) | Data storage method and apparatus, server, and medium | |
| CN118796932A (en) | Data synchronization method, device, equipment and storage medium | |
| US11698914B1 (en) | Serverless managed bulk import on a global NoSQL database with selective back pressure | |
| CN115495436A (en) | Database upgrade method and device | |
| CN111404737B (en) | Disaster recovery processing method and related device | |
| CN120631658A (en) | Data backup method, setting and storage medium based on distributed database | |
| CN116974983A (en) | Data processing methods, devices, computer-readable media and electronic equipment | |
| CN114691781A (en) | Data synchronization method, system, device, equipment and medium | |
| CN111078418B (en) | Operation synchronization method, device, electronic equipment and computer readable storage medium | |
| KR20180095004A (en) | High Throughput, High Reliability Data Processing 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 |