Disk capacity management method and device for database cluster, equipment and medium

By configuring disk quota templates and dynamically managing disk usage in the database cluster, the problems of resource waste and insufficiency in existing technologies are solved, and efficient disk capacity management and balanced resource allocation are achieved.

CN121879677APending Publication Date: 2026-04-17JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JINZHUAN INFORMATION TECHNOLOGY CO LTD
Filing Date
2025-12-29
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing technologies, the disk capacity management solutions for database clusters cannot adapt to the online expansion scenarios of the underlying storage. They lack a clear default value inheritance mechanism and configuration conflict resolution scheme, and cannot take into account both standardized management and personalized needs, resulting in resource waste or insufficiency. Furthermore, the alarm function and handling strategy are disconnected.

Method used

By configuring directory storage limits based on disk quota templates when allocating new nodes to target shards, collecting disk information periodically, calculating usage, and managing access when thresholds are reached, the system supports a combination of percentage and fixed capacity limits to achieve dynamic adaptation and immediate effect.

Benefits of technology

It improves management efficiency, reduces repetitive configuration workload, adapts to changes in storage resources, ensures system stability, achieves balanced resource allocation among multiple tenants, and reduces performance loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121879677A_ABST
    Figure CN121879677A_ABST
Patent Text Reader

Abstract

The invention discloses a disk capacity management method and device for a database cluster, equipment and a medium. Comprising the following steps: when a new node is allocated to a target fragment, performing directory storage quota configuration on a disk mounted in the new node according to a disk quota template of the target fragment; wherein the disk limit template comprises a directory type, a capacity limit type, a capacity limit value, an alarm threshold and a full strategy; regularly collecting disk storage information in the target node, and calculating the disk utilization rate of the first directory according to the collected current disk capacity, the used capacity of the first directory and the capacity limit value of the first directory; and comparing the disk usage rate of the first directory with the alarm threshold value of the first directory, and performing access management on the target node when determining that the disk usage rate is higher than the alarm threshold value of the first directory or the usage rate is full. By adopting the technical scheme, the directory use capacity can be monitored and dynamically managed based on the multi-stage disk quota configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of disk resource management technology, and in particular to a method, apparatus, device, and medium for managing disk capacity in a database cluster. Background Technology

[0002] When multiple tenants share storage resources in a database cluster, disk capacity quota management directly affects the continuity of tenant services, resource utilization efficiency, and the isolation effect between multiple tenants.

[0003] In existing technologies, database clusters typically monitor disk usage by setting a fixed disk capacity threshold and triggering an alarm when the threshold is reached.

[0004] However, existing solutions only support disk quota settings with fixed size thresholds, and the alarm function and subsequent handling strategies are disconnected, making it difficult to adapt to online expansion scenarios of underlying storage. They cannot restore access control of nodes, and tenant-level and shard-level quota configurations are mixed. They lack a clear default value inheritance mechanism and configuration conflict resolution scheme, and cannot take into account both standardized management and personalized needs. Summary of the Invention

[0005] This invention provides a method, apparatus, device, and medium for managing disk capacity in a database cluster, which can monitor and dynamically manage directory usage capacity based on multi-level disk quota configuration.

[0006] According to one aspect of the present invention, a method for disk capacity management of a database cluster is provided, comprising:

[0007] When allocating a new node to a target shard, the disks mounted in the new node are configured with directory storage quotas according to the disk quota template of the target shard; wherein, the disk quota template includes directory type, capacity quota type, capacity quota value, alarm threshold and full quota policy;

[0008] Periodically collect disk storage information from the target node, and calculate the disk utilization rate of the first directory based on the collected current disk capacity, the used capacity of the first directory, and the capacity limit of the first directory.

[0009] The disk usage rate of the first directory is compared with the alarm threshold of the first directory, and when it is determined that the disk usage rate is higher than the alarm threshold of the first directory or reaches the full usage rate, access management is performed on the target node.

[0010] According to another aspect of the present invention, a disk capacity management device for a database cluster is provided, comprising:

[0011] The disk capacity quota configuration module is used to configure directory storage quotas for the disks mounted in the new nodes when allocating new nodes to the target shard, based on the disk quota template of the target shard; wherein, the disk quota template includes directory type, capacity quota type, capacity quota value, alarm threshold and full quota policy;

[0012] The disk utilization calculation module is used to periodically collect disk storage information in the target node and calculate the disk utilization of the first directory based on the collected current disk capacity, the used capacity of the first directory, and the capacity limit of the first directory.

[0013] The access management module is used to compare the disk usage rate of the first directory with the alarm threshold of the first directory, and to perform access management on the target node when it is determined that the disk usage rate is higher than the alarm threshold of the first directory or reaches the full usage rate.

[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0015] At least one processor; and

[0016] A memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the disk capacity management method for a database cluster according to any embodiment of the present invention.

[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the disk capacity management method for a database cluster according to any embodiment of the present invention.

[0019] The technical solution of this invention, when allocating a new node to a target shard, configures directory storage quotas for the disks mounted on the new node according to the disk quota template of the target shard. It periodically collects disk storage information from the target node and calculates the disk utilization rate of the first directory based on the collected current disk capacity, the used capacity of the first directory, and the capacity quota value of the first directory. The disk utilization rate of the first directory is compared with the alarm threshold of the first directory. When it is determined that the disk utilization rate is higher than the alarm threshold of the first directory or reaches the maximum utilization limit, access management is implemented on the target node. It significantly improves management efficiency, enabling tenants to define disk quota templates once and reuse them in batches at the shard level, greatly reducing repetitive configuration workload. Existing shards can also be adjusted to meet personalized needs. The combination of percentage and fixed capacity quotas can dynamically adapt to changes in storage resources and accommodate online expansion of underlying storage, avoiding resource waste or insufficiency caused by fixed thresholds. Quota changes take effect immediately without restarting instances, ensuring system stability in multi-tenant shared scenarios. Through precise quota control at the shard level, it can achieve balanced distribution of cluster storage resources among multiple tenants, reducing performance loss caused by resource contention.

[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart of a disk capacity management method for a database cluster according to Embodiment 1 of the present invention;

[0023] Figure 2 This is a schematic diagram of the physical layer structure of a database cluster according to an embodiment of the present invention;

[0024] Figure 3 This is a flowchart of another database cluster disk capacity management method provided in Embodiment 2 of the present invention;

[0025] Figure 4 This is a schematic diagram of the structure of a disk capacity management device for a database cluster according to Embodiment 3 of the present invention;

[0026] Figure 5This is a schematic diagram of the structure of an electronic device that implements the disk capacity management method for a database cluster according to an embodiment of the present invention. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] Example 1

[0030] Figure 1 This is a flowchart of a disk capacity management method for a database cluster according to Embodiment 1 of the present invention. This embodiment is applicable to situations where disk capacity is dynamically managed based on disk quota templates. This method can be executed by a disk capacity management device for the database cluster. This device can be implemented in hardware and / or software and is generally configured in a computer or processor with data processing capabilities. Figure 1 As shown, the method includes:

[0031] S110. When allocating a new node for the target shard, configure the directory storage quota for the disk mounted in the new node according to the disk quota template of the target shard.

[0032] Optionally, a database cluster is a distributed or centralized data storage and management system composed of multiple computing nodes and data nodes working collaboratively through a network and combined with shared storage. It supports multi-tenant resource sharing and physical and logical layer isolation, and serves as the basic carrier for the operation of shards and nodes.

[0033] Figure 2This is a schematic diagram of the physical layer structure of an optional database cluster. Figure 2 The diagram illustrates a database cluster consisting of three databases. In each database, CN Pod is a compute node, DN Pod is a data node, IA is an insight platform data collection plugin, CM Replica is a cluster manager replica, and the shared storage LVM volume is a logical volume management volume. The insight platform data collection plugin is used to collect the disk storage information of the nodes. The cluster management replica is used for management operations such as resource allocation after tenant registration, node scheduling of new shards, issuance and execution of disk quota templates, sending of read-only control commands, and coordination of expansion adjustments. The logical volume management volume is used to provide actual storage space for the data nodes.

[0034] Optionally, the database cluster can support multi-tenant registration. Each tenant can correspond to an independent business entity. Each tenant has its own dedicated nodes, shards, directories, and disk quotas. It can define its own disk quota template. A shard can refer to the smallest logical storage and processing unit of tenant data. It is a partial data carrier after the tenant's complete dataset has been horizontally split. Each shard needs to be deployed on a specific data node. Nodes can provide a running environment for shards. In this invention, a node can refer to a data node. Each node mounts one or more disks and allocates its mounted disk space to shards according to the directory's purpose. Disks provide actual storage space for directories and are the data storage carriers. Disks can be mounted to nodes in the form of logical volume management volumes. Directories are the functional partition units of disks. Each type of directory is mounted independently on the disk, thereby realizing the separation and management of data with different functions.

[0035] Optionally, the target shard can refer to a new shard generated for the tenant or an old shard that has been expanded. During the shard generation or expansion process, new nodes need to be allocated to the target shard.

[0036] The disk quota template includes directory type, capacity quota type, capacity quota value, alarm threshold, and full quota policy.

[0037] Optionally, in the technical solution of this embodiment of the invention, the directory type may include an installation directory, a data directory, and a log directory. All three directories are mounted independently on the disk, thereby achieving differentiated management of the directories.

[0038] Optionally, the capacity limit type can include percentage and fixed capacity. The capacity limit type is used to describe the upper limit constraint of the specified directory type on the disk. If the capacity limit type is percentage, the capacity limit value is the percentage of the total disk capacity set for the specified directory type, such as 80%. If the capacity limit type is fixed capacity, the capacity limit value is the absolute storage size of the specified directory type on the disk, such as 100GB.

[0039] Optionally, the alarm threshold is a preset disk usage warning threshold, and the full usage policy is the handling rule when the directory usage reaches the full usage. For example, when the directory usage reaches the full usage, read-only control of the node where it is located can be triggered. If a tenant accesses the node, only read-only operations can be performed.

[0040] Optionally, when allocating a new node for the target shard, the cluster manager of the database cluster first filters and determines the new node that is suitable for the deployment requirements of the target shard based on the resource load of each data node in the cluster. Then, it calls the disk quota template bound to the target shard, converts the capacity quota method and quota value into environment variables and injects them into the container of the new node. It also allocates independent storage space for the installation directory, data directory and log directory in the disk mounted on the new node, completes the directory storage quota configuration of the new node, and ensures that different directories are subject to differentiated management according to the template.

[0041] The disk capacity management method for the database cluster may further include:

[0042] When a tenant registers in the database cluster, the disk quota template selected by the tenant for each directory type is bound to the tenant.

[0043] When a tenant creates a new shard, the new shard is configured according to the disk quota template bound to the tenant;

[0044] If a tenant initiates a template update request for an already created shard, the disk quota template for the already created shard will be updated according to the disk quota configuration information currently selected by the user. Based on the updated disk quota template, the directory storage quota will be updated for the disks mounted on each node corresponding to the already created shard.

[0045] Optionally, tenant registration refers to the process by which a tenant establishes an independent resource isolation domain in the database cluster. When a tenant registers in the database cluster, the database cluster receives the registration request submitted by the tenant, parses information such as the tenant identifier, business type, and resource requirements, allocates a unique namespace and service account to the tenant, and provides multiple preset disk quota templates for the tenant to choose from. The tenant can select the appropriate template for the installation directory, data directory, and log directory, or customize the template parameters. The database cluster binds the disk quota templates corresponding to each directory type selected by the tenant to the tenant and stores them in the template library as the default configuration pool for the tenant.

[0046] Optionally, when a tenant creates a new shard, the cluster manager of the database cluster retrieves the disk quota template bound to that tenant from the template library. When the new shard starts, it implements standardized configuration of the new shard based on the disk quota template bound to that tenant, without requiring the tenant to repeatedly define control rules.

[0047] Optionally, a template update request can refer to a tenant-initiated request to modify the quota rules of an existing sharded disk, including configuration information such as new quota type, quota value, alarm threshold, and full quota policy.

[0048] Optionally, if a tenant initiates a template update request for an already created shard, the database cluster receives the disk quota configuration information currently selected by the user, determines the content of the change, and updates the disk quota template for the already created shard after verifying the legality and compatibility of the configuration information. Then, through the insight platform, an update command is issued, and the database agent can call the control group hot reloading technology to update the directory storage quota of the disks mounted on each node corresponding to the created shard. The updated quota takes effect immediately without restarting the node or shard instance, and does not affect the normal operation of the current business of the shard.

[0049] S120. Periodically collect disk storage information in the target node, and calculate the disk utilization rate of the first directory based on the collected current disk capacity, the used capacity of the first directory, and the capacity limit of the first directory.

[0050] Optionally, the database cluster can periodically collect disk storage information from the nodes through collection plugins deployed on each data node. The disk storage information can include the current disk capacity and the used capacity of the installation directory, data directory, and log directory. The target node can refer to any data node with shards deployed.

[0051] Optionally, the first directory can refer to any type of directory currently being calculated. Based on the current disk capacity and the capacity limit of the first directory, the available disk capacity of the first directory, i.e., the full capacity, can be determined. For example, if the current disk capacity is 100G and the capacity limit of the first directory is 40%, it means that the capacity limit type is percentage, and the first directory can use 40% of the current disk capacity, i.e., the full capacity is 40G. If the capacity limit of the first directory is 40G, it means that the capacity limit type is fixed capacity, and the full capacity of the first directory is also 40G.

[0052] Furthermore, based on the full capacity and the used capacity of the first directory, the disk utilization rate of the first directory can be calculated. That is, by calculating the ratio of the used capacity to the full capacity of the first directory, the disk utilization rate of the first directory can be obtained. For example, if the used disk capacity of the first directory is 20G and the full capacity of the first directory is 40G, then the disk utilization rate is 20 / 40=50%.

[0053] The periodic collection of disk storage information from the target node may include:

[0054] Whenever a specified collection time point is reached, the current disk capacity of the target node is collected, and the used capacity of the installation directory, data directory, and various log directories is collected separately.

[0055] The used capacity of various log directories is summarized, and the used capacity of the log directory is determined based on the summary results.

[0056] Optionally, due to the complex and dispersed nature of log directory storage, in order to avoid data deviation caused by repeated statistics from multiple mount points, the used capacity of four types of subdirectories—redo logs, undo logs, relay logs, and binary logs—can be collected separately by a collection plugin. These are then aggregated into a single metric as the used capacity of the log directory, thereby improving data collection accuracy and alarm accuracy.

[0057] S130. Compare the disk usage rate of the first directory with the alarm threshold of the first directory, and when it is determined that the disk usage rate is higher than the alarm threshold of the first directory or reaches the full usage rate, perform access management on the target node.

[0058] Optionally, the disk usage of the first directory can be compared with the alarm threshold of the first directory, and differentiated access management can be performed. If the disk usage is higher than the alarm threshold but not full, an alarm will be triggered and pushed to the operation and maintenance platform to notify relevant personnel to handle it in a timely manner. If the disk usage reaches full, access management will be performed according to the full-capacity policy preset in the template.

[0059] Optionally, full utilization can refer to a utilization rate of 100%.

[0060] The technical solution of this invention, when allocating a new node to a target shard, configures directory storage quotas for the disks mounted on the new node according to the disk quota template of the target shard. It periodically collects disk storage information from the target node and calculates the disk utilization rate of the first directory based on the collected current disk capacity, the used capacity of the first directory, and the capacity quota value of the first directory. The disk utilization rate of the first directory is compared with the alarm threshold of the first directory. When it is determined that the disk utilization rate is higher than the alarm threshold of the first directory or reaches the maximum utilization limit, access management is implemented on the target node. It significantly improves management efficiency, enabling tenants to define disk quota templates once and reuse them in batches at the shard level, greatly reducing repetitive configuration workload. Existing shards can also be adjusted to meet personalized needs. The combination of percentage and fixed capacity quotas can dynamically adapt to changes in storage resources and accommodate online expansion of underlying storage, avoiding resource waste or insufficiency caused by fixed thresholds. Quota changes take effect immediately without restarting instances, ensuring system stability in multi-tenant shared scenarios. Through precise quota control at the shard level, it can achieve balanced distribution of cluster storage resources among multiple tenants, reducing performance loss caused by resource contention.

[0061] Example 2

[0062] Figure 3 This is a flowchart illustrating a disk capacity management method for a database cluster according to Embodiment 2 of the present invention. Based on the above embodiments, this embodiment specifically describes the disk capacity management method for a database cluster. Figure 3 As shown, the method includes:

[0063] S210. When allocating a new node for the target shard, configure the directory storage quota for the disk mounted in the new node according to the disk quota template of the target shard.

[0064] S220. Whenever the specified collection time point is reached, collect the current disk capacity of the target node, and collect the used capacity of the installation directory, data directory and various log directories respectively.

[0065] S230. Summarize the used capacity of various log directories and determine the used capacity of the log directory based on the summarization results.

[0066] S240. Calculate the disk utilization rate of the first directory based on the collected current disk capacity, the used capacity of the first directory, and the capacity limit of the first directory.

[0067] The calculation of the disk utilization rate of the first directory, based on the collected current disk capacity, the used capacity of the first directory, and the capacity limit of the first directory, may include any of the following:

[0068] If the capacity limit type of the first directory is percentage, then the full capacity of the first directory is calculated based on the current disk capacity and the capacity limit value of the first directory, and the disk utilization rate of the first directory is calculated based on the used capacity and the full capacity of the first directory.

[0069] If the capacity limit type of the first directory is fixed capacity, then the disk utilization rate of the first directory is calculated based on the used capacity and capacity limit value of the first directory.

[0070] Optionally, if the capacity limit type of the first directory is percentage, the data analysis module of the database cluster can first calculate the full capacity of the first directory based on the current disk capacity and the capacity limit value of the first directory, using the dynamic conversion formula: Full capacity = Current disk capacity × Capacity limit value, to ensure that the limit value automatically adapts with the expansion of the underlying disk; then, using the formula: Disk utilization rate = (Used capacity of the first directory / Full capacity) × 100%, calculate the disk utilization rate of the first directory to accurately reflect the relative occupancy of directory storage.

[0071] Optionally, if the capacity limit type of the first directory is fixed capacity, then the capacity limit value of the first directory is the full capacity of the directory. The data analysis module of the database cluster can directly calculate the disk utilization rate of the first directory using the formula disk utilization rate = (used capacity of the first directory / capacity limit value) × 100%, without additional conversion, ensuring that the calculation logic is simple and efficient and adaptable to scenarios with fixed storage requirements.

[0072] Optionally, setting the capacity limit type to percentage has the following advantages: it can adapt to online storage expansion scenarios, ensure that disk limits take effect automatically with storage expansion, and avoid the defect of traditional static thresholds becoming invalid due to underlying expansion.

[0073] S250. Compare the disk usage rate of the first directory with the alarm threshold of the first directory, and when it is determined that the disk usage rate is higher than the alarm threshold of the first directory or reaches the full usage rate, perform access management on the target node.

[0074] Specifically, comparing the disk usage rate of the first directory with the alarm threshold of the first directory, and when it is determined that the disk usage rate is higher than the alarm threshold of the first directory or reaches the maximum usage limit, access management is performed on the target node, which may include any of the following:

[0075] If the disk usage of the first directory is higher than the alarm threshold of the first directory, but has not reached the full usage limit, then a disk quota alarm will be issued for the target node.

[0076] If the disk usage of the first directory reaches its maximum, then access management of the target node will be executed according to the maximum usage policy of the first directory.

[0077] Optionally, if the disk usage of the first directory is higher than the preset alarm threshold of the first directory, but not at full usage, the alarm module of the database cluster will immediately generate alarm information. The alarm information may include key information such as tenant identifier, shard identifier, node address, directory type, current usage, alarm threshold, and remaining storage space. It will be pushed to the operation and maintenance personnel via SMS, email or platform notification, and the alarm record will be stored in the audit log to provide a basis for subsequent traceability, ensuring that the operation and maintenance personnel intervene in a timely manner and avoid the disk from being continuously occupied to full usage.

[0078] Optionally, if the disk usage of the first directory reaches its maximum, the access control module of the database cluster will perform access management on the target node according to the full usage policy of the first directory.

[0079] Optionally, if the full-capacity policy is read-only, when the full-capacity policy is triggered, a read-only control command can be sent to the sidecar component of the target node through the cluster manager. The sidecar component calls the database tool to trigger the global variable, setting the corresponding directory of the target node to read-only mode, allowing only query operations and blocking all write operations to avoid the disk from being completely full.

[0080] Optionally, if the full-capacity policy is alarm-only, then only the highest-level alarm will be triggered, and read-only control will not be executed, thus adapting to the needs of special business scenarios.

[0081] S260. If the target node meets the expansion conditions based on the current business volume of the segment where the target node is located, then the capacity limit of the first directory shall be increased based on the current business volume.

[0082] Optionally, the database cluster can monitor the current workload of the shard where the target node is located in real time and determine whether the target node meets the expansion conditions based on the current workload. If the expansion conditions are met, the operation and maintenance personnel can manually initiate an expansion request, or the system can automatically calculate the appropriate expansion range based on the current workload and increase the capacity limit value of the first directory. If the capacity limit type is a percentage, the increased capacity limit value is determined based on the total disk capacity. If the capacity limit type is a fixed capacity, the limit value is increased directly.

[0083] S270. In the next collection cycle after the capacity limit value of the first directory is increased, if it is determined that the disk utilization rate of the first directory is lower than the alarm threshold of the first directory or decreases from full utilization to less than full utilization, then the access management of the target node is reset.

[0084] Optionally, after increasing the capacity limit value of the first directory, the database agent can call the online hot backup tool and control group hot reloading technology to make the new limit value take effect immediately. In the next collection cycle, the collection plugin re-collects the used capacity and current disk capacity of the first directory and calculates the updated disk utilization rate. If it is determined that the utilization rate is lower than the alarm threshold of the first directory in the alarm scenario, or if the utilization rate drops from full to less than full in the full scenario, the access control module of the database cluster automatically resets the access management of the target node: the alarm status is automatically lifted, or the read-only mode is restored to write mode by issuing a command to restore the target node to normal read and write permissions, realizing fault self-healing in a short time and significantly shortening the business interruption time.

[0085] Furthermore, the disk capacity management method for database clusters may also include:

[0086] If an update to the directory storage limit of any disk is detected, multi-dimensional update information is obtained, and an audit log is generated based on the multi-dimensional update information.

[0087] Optionally, the database cluster's audit module can monitor all disk directory storage limit change operations in real time, including template binding during tenant registration, template configuration when creating a new shard, template updates for existing shards, and limit increases due to expansion, among all scenarios involving changes in limit parameters. If an update to the directory storage limit of any disk is detected, the audit module immediately obtains multi-dimensional update information, which may include operation time, operation user, resource type, control level, operation object, original configuration value, new configuration value, operation result, and failure reason.

[0088] Furthermore, the audit module can generate standardized task-level audit records based on multi-dimensional updated information and store them in the audit database. It also supports querying and exporting based on multiple conditions such as tenant identifier, operation time, operation object, and resource type. This can meet the strict requirements of various industries for compliance traceability of change operations, ensuring that all limit adjustment operations are auditable and traceable, and providing complete support for system security operation and maintenance and compliance inspection.

[0089] The technical solution of this invention, when allocating a new node to a target shard, configures directory storage quotas for the disks mounted on the new node according to the disk quota template of the target shard. It periodically collects disk storage information from the target node and calculates the disk utilization rate of the first directory based on the collected current disk capacity, the used capacity of the first directory, and the capacity quota value of the first directory. The disk utilization rate of the first directory is compared with the alarm threshold of the first directory. When it is determined that the disk utilization rate is higher than the alarm threshold of the first directory or reaches the maximum utilization limit, access management is implemented on the target node. It significantly improves management efficiency, enabling tenants to define disk quota templates once and reuse them in batches at the shard level, greatly reducing repetitive configuration workload. Existing shards can also be adjusted to meet personalized needs. The combination of percentage and fixed capacity quotas can dynamically adapt to changes in storage resources and accommodate online expansion of underlying storage, avoiding resource waste or insufficiency caused by fixed thresholds. Quota changes take effect immediately without restarting instances, ensuring system stability in multi-tenant shared scenarios. Through precise quota control at the shard level, it can achieve balanced distribution of cluster storage resources among multiple tenants, reducing performance loss caused by resource contention.

[0090] Example 3

[0091] Figure 4 This is a schematic diagram of a disk capacity management device for a database cluster provided in Embodiment 3 of the present invention. Figure 4 As shown, the device includes: a disk capacity quota configuration module 310, a disk usage calculation module 320, and an access management module 330.

[0092] The disk capacity quota configuration module 310 is used to configure the directory storage quota of the disk mounted in the new node according to the disk quota template of the target shard when allocating a new node for the target shard; wherein, the disk quota template includes directory type, capacity quota type, capacity quota value, alarm threshold and full quota policy.

[0093] The disk utilization calculation module 320 is used to periodically collect disk storage information in the target node and calculate the disk utilization of the first directory based on the collected current disk capacity, the used capacity of the first directory, and the capacity limit of the first directory.

[0094] The access management module 330 is used to compare the disk usage rate of the first directory with the alarm threshold of the first directory, and to perform access management on the target node when it is determined that the disk usage rate is higher than the alarm threshold of the first directory or reaches the full usage rate.

[0095] The technical solution of this invention, when allocating a new node to a target shard, configures directory storage quotas for the disks mounted on the new node according to the disk quota template of the target shard. It periodically collects disk storage information from the target node and calculates the disk utilization rate of the first directory based on the collected current disk capacity, the used capacity of the first directory, and the capacity quota value of the first directory. The disk utilization rate of the first directory is compared with the alarm threshold of the first directory. When it is determined that the disk utilization rate is higher than the alarm threshold of the first directory or reaches the maximum utilization limit, access management is implemented on the target node. It significantly improves management efficiency, enabling tenants to define disk quota templates once and reuse them in batches at the shard level, greatly reducing repetitive configuration workload. Existing shards can also be adjusted to meet personalized needs. The combination of percentage and fixed capacity quotas can dynamically adapt to changes in storage resources and accommodate online expansion of underlying storage, avoiding resource waste or insufficiency caused by fixed thresholds. Quota changes take effect immediately without restarting instances, ensuring system stability in multi-tenant shared scenarios. Through precise quota control at the shard level, it can achieve balanced distribution of cluster storage resources among multiple tenants, reducing performance loss caused by resource contention.

[0096] Based on the above embodiments, a fragmentation management module may also be included, used for:

[0097] When a tenant registers in the database cluster, the disk quota template selected by the tenant for each directory type is bound to the tenant.

[0098] When a tenant creates a new shard, the new shard is configured according to the disk quota template bound to the tenant;

[0099] If a tenant initiates a template update request for an already created shard, the disk quota template for the already created shard will be updated according to the disk quota configuration information currently selected by the user. Based on the updated disk quota template, the directory storage quota will be updated for the disks mounted on each node corresponding to the already created shard.

[0100] Based on the above embodiments, the disk utilization calculation module 320 may include a disk storage information acquisition unit and a utilization calculation unit.

[0101] The disk storage information acquisition unit can be specifically used for:

[0102] Whenever a specified collection time point is reached, the current disk capacity of the target node is collected, and the used capacity of the installation directory, data directory, and various log directories is collected separately.

[0103] The used capacity of various log directories is summarized, and the used capacity of the log directory is determined based on the summary results.

[0104] Based on the above embodiments, the utilization rate calculation unit can be used to perform any of the following:

[0105] If the capacity limit type of the first directory is percentage, then the full capacity of the first directory is calculated based on the current disk capacity and the capacity limit value of the first directory, and the disk utilization rate of the first directory is calculated based on the used capacity and the full capacity of the first directory.

[0106] If the capacity limit type of the first directory is fixed capacity, then the disk utilization rate of the first directory is calculated based on the used capacity and capacity limit value of the first directory.

[0107] Based on the above embodiments, the access management module 330 can be used to perform any of the following:

[0108] If the disk usage of the first directory is higher than the alarm threshold of the first directory, but has not reached the full usage limit, then a disk quota alarm will be issued for the target node.

[0109] If the disk usage of the first directory reaches its maximum, then access management of the target node will be executed according to the maximum usage policy of the first directory.

[0110] Based on the above embodiments, a capacity expansion module may also be included, for:

[0111] If the target node meets the expansion conditions based on the current traffic volume of the shard where the target node is located, then the capacity limit of the first directory will be increased based on the current traffic volume.

[0112] In the next data collection cycle after the capacity limit of the first directory is increased, if it is determined that the disk utilization of the first directory is lower than the alarm threshold of the first directory or decreases from full utilization to less than full utilization, then the access management of the target node is reset.

[0113] Based on the above embodiments, an audit log generation module may also be included, for:

[0114] If an update to the directory storage limit of any disk is detected, multi-dimensional update information is obtained, and an audit log is generated based on the multi-dimensional update information.

[0115] The disk capacity management device for database clusters provided in this embodiment of the invention can execute the disk capacity management method for database clusters provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.

[0116] Example 4

[0117] Figure 5A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, 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 processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0118] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0119] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0120] Processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, central processing unit (CPU), graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the disk capacity management method for a database cluster described in the embodiments of the present invention. That is:

[0121] When allocating a new node to a target shard, the disks mounted in the new node are configured with directory storage quotas according to the disk quota template of the target shard; wherein, the disk quota template includes directory type, capacity quota type, capacity quota value, alarm threshold and full quota policy;

[0122] Periodically collect disk storage information from the target node, and calculate the disk utilization rate of the first directory based on the collected current disk capacity, the used capacity of the first directory, and the capacity limit of the first directory.

[0123] The disk usage rate of the first directory is compared with the alarm threshold of the first directory, and when it is determined that the disk usage rate is higher than the alarm threshold of the first directory or reaches the full usage rate, access management is performed on the target node.

[0124] In some embodiments, the disk capacity management method for a database cluster may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the disk capacity management method for a database cluster described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the disk capacity management method for a database cluster by any other suitable means (e.g., by means of firmware).

[0125] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0126] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0127] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0128] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device 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 provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0129] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0130] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0131] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0132] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method of disk capacity management of a database cluster, characterized by, include: When allocating a new node to a target shard, the disks mounted in the new node are configured with directory storage quotas according to the disk quota template of the target shard; wherein, the disk quota template includes directory type, capacity quota type, capacity quota value, alarm threshold and full quota policy; Periodically collect disk storage information from the target node, and calculate the disk utilization rate of the first directory based on the collected current disk capacity, the used capacity of the first directory, and the capacity limit of the first directory. The disk usage rate of the first directory is compared with the alarm threshold of the first directory, and when it is determined that the disk usage rate is higher than the alarm threshold of the first directory or reaches the full usage rate, access management is performed on the target node.

2. The method of claim 1, wherein, Also includes: When a tenant registers in the database cluster, the disk quota template selected by the tenant for each directory type is bound to the tenant. When a tenant creates a new shard, the new shard is configured according to the disk quota template bound to the tenant; If a tenant initiates a template update request for an already created shard, the disk quota template for the already created shard will be updated according to the disk quota configuration information currently selected by the user. Based on the updated disk quota template, the directory storage quota will be updated for the disks mounted on each node corresponding to the already created shard.

3. The method according to claim 1, characterized in that, Periodically collect disk storage information from the target node, including: Whenever a specified collection time point is reached, the current disk capacity of the target node is collected, and the used capacity of the installation directory, data directory, and various log directories is collected separately. The used capacity of various log directories is summarized, and the used capacity of the log directory is determined based on the summary results.

4. The method according to claim 1, characterized in that, Based on the collected current disk capacity, the used capacity of the first directory, and the capacity limit of the first directory, calculate the disk utilization rate of the first directory, including any one of the following: If the capacity limit type of the first directory is percentage, then the full capacity of the first directory is calculated based on the current disk capacity and the capacity limit value of the first directory, and the disk utilization rate of the first directory is calculated based on the used capacity and the full capacity of the first directory. If the capacity limit type of the first directory is fixed capacity, then the disk utilization rate of the first directory is calculated based on the used capacity and capacity limit value of the first directory.

5. The method according to claim 1, characterized in that, The disk usage rate of the first directory is compared with the alarm threshold of the first directory. When it is determined that the disk usage rate is higher than the alarm threshold of the first directory or reaches the maximum usage, access management is performed on the target node, including any of the following: If the disk usage of the first directory is higher than the alarm threshold of the first directory, but has not reached the full usage limit, then a disk quota alarm will be issued for the target node. If the disk usage of the first directory reaches its maximum, then access management of the target node will be executed according to the maximum usage policy of the first directory.

6. The method according to claim 1, characterized in that, After determining that the disk usage rate is higher than the alarm threshold of the first directory or has reached full usage, and after performing access management on the target node, the process also includes: If the target node meets the expansion conditions based on the current traffic volume of the shard where the target node is located, then the capacity limit of the first directory will be increased based on the current traffic volume. In the next data collection cycle after the capacity limit of the first directory is increased, if it is determined that the disk utilization of the first directory is lower than the alarm threshold of the first directory or decreases from full utilization to less than full utilization, then the access management of the target node is reset.

7. The method according to any one of claims 1-6, characterized in that, Also includes: If an update to the directory storage limit of any disk is detected, multi-dimensional update information is obtained, and an audit log is generated based on the multi-dimensional update information.

8. A disk capacity management device for a database cluster, characterized in that, include: The disk capacity quota configuration module is used to configure directory storage quotas for the disks mounted in the new nodes when allocating new nodes to the target shard, based on the disk quota template of the target shard; wherein, the disk quota template includes directory type, capacity quota type, capacity quota value, alarm threshold and full quota policy; The disk utilization calculation module is used to periodically collect disk storage information in the target node and calculate the disk utilization of the first directory based on the collected current disk capacity, the used capacity of the first directory, and the capacity limit of the first directory. The access management module is used to compare the disk usage rate of the first directory with the alarm threshold of the first directory, and to perform access management on the target node when it is determined that the disk usage rate is higher than the alarm threshold of the first directory or reaches the full usage rate.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the disk capacity management method for the database cluster according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the disk capacity management method for the database cluster according to any one of claims 1-7.