[go: up one dir, main page]

CN118939433A - A method, device and electronic device for adjusting cluster nodes - Google Patents

A method, device and electronic device for adjusting cluster nodes Download PDF

Info

Publication number
CN118939433A
CN118939433A CN202411379934.0A CN202411379934A CN118939433A CN 118939433 A CN118939433 A CN 118939433A CN 202411379934 A CN202411379934 A CN 202411379934A CN 118939433 A CN118939433 A CN 118939433A
Authority
CN
China
Prior art keywords
node
nodes
dormancy
service
pool
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202411379934.0A
Other languages
Chinese (zh)
Other versions
CN118939433B (en
Inventor
江文龙
李青青
何帆
章侃
王志豪
徐涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202411379934.0A priority Critical patent/CN118939433B/en
Publication of CN118939433A publication Critical patent/CN118939433A/en
Application granted granted Critical
Publication of CN118939433B publication Critical patent/CN118939433B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3093Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请涉及一种调整集群节点的方法、装置及电子设备,用于解决现有服务节点均衡承载业务量的设计会造成大量资源浪费和能量消耗的问题。该方法包括:响应于节点休眠机制开启,确定当前系统业务量;判断当前系统业务量是否大于0;若当前系统业务量等于0,则将集群中所有节点转移至节点休眠池中;若当前系统业务量大于0,则根据当前系统业务量以及当前所有激活节点,确定需要转移节点至节点休眠池或是从节点休眠池中唤醒节点。基于上述方法,可以有效降低整个集群的能源消耗,达到节能的效果。

The present application relates to a method, device and electronic device for adjusting cluster nodes, which is used to solve the problem that the design of existing service nodes to evenly carry business volume will cause a lot of resource waste and energy consumption. The method includes: in response to the node sleep mechanism being turned on, determining the current system business volume; judging whether the current system business volume is greater than 0; if the current system business volume is equal to 0, transferring all nodes in the cluster to the node sleep pool; if the current system business volume is greater than 0, determining whether the node needs to be transferred to the node sleep pool or woken up from the node sleep pool based on the current system business volume and all currently activated nodes. Based on the above method, the energy consumption of the entire cluster can be effectively reduced, achieving energy-saving effects.

Description

Method and device for adjusting cluster nodes and electronic equipment
Technical Field
The present application relates to the field of distributed storage technologies, and in particular, to a method and an apparatus for adjusting a cluster node, and an electronic device.
Background
The common service of the large-scale video cloud service cluster is video and picture access, and in an actual scene, the service flow can change in a day time range, such as early peak time and late peak time of a working day, the writing quantity of the video and the picture of each traffic gate can be increased rapidly, even tens of times of the flat peak time.
At present, on the basis of the design key point of load balancing in the common design of the distributed cloud storage field, generally, all nodes in a cluster stand by at any time to bear read-write services, even if the number of nodes far exceeds the required bearing traffic, the service data on the whole still falls into each node to be executed uniformly. The distributed cluster of the video cloud service scene is often larger in scale, more than ten devices and more than thousands of devices, so that when the service flow required to be borne is small, the design of balancing the bearing service volume of all nodes can cause waste of a large amount of resources and consumption of energy.
Disclosure of Invention
The application provides a method and a device for adjusting cluster nodes and electronic equipment, which are used for reducing the power consumption of a distributed cluster and achieving the effect of energy conservation.
In a first aspect, the present application provides a method for adjusting a cluster node, the method comprising:
Determining current system traffic in response to the node dormancy detection mechanism being turned on;
judging whether the current system traffic is greater than 0;
And when the current system traffic is equal to 0, transferring all nodes in the cluster to a node dormancy pool.
A node dormancy mechanism is designed, system traffic is monitored in real time, and when the traffic does not exist, all nodes of a cluster are transferred to a node dormancy pool to carry out dormancy, so that the power consumption of the whole cluster can be reduced, and the energy-saving effect is achieved.
In one possible design, the method further comprises: when the current system traffic is greater than 0, determining the number P of target nodes required for bearing the current system traffic, wherein P is an integer greater than 0; calculating the residual capacity of each target node according to the P, the current system traffic and a capacity coefficient, wherein the capacity coefficient represents the storage duration of the current system traffic; determining a first node set with the capacity larger than or equal to the residual capacity from all the current activated nodes; when the number of the nodes of the first node set is greater than or equal to P, P active nodes are selected from the first node set, and the P active nodes are used as the target nodes; and reserving the target node, and transferring other active nodes except the target node into the node dormancy pool.
Monitoring the system traffic in real time, when the traffic is smaller, reserving part of nodes to meet the current traffic, transferring redundant nodes to a node dormancy pool to carry out dormancy, ensuring the current traffic service, reducing the power consumption of the whole cluster and achieving the energy-saving effect; and when the service node is reserved, the service node is preferentially selected from the active nodes, so that the energy loss caused by frequently waking up the dormant node can be avoided.
In one possible design, after determining the first node set with a capacity greater than or equal to the remaining capacity from all the active nodes, the method further includes: when the number of nodes of the first node set is smaller than P, reserving all active nodes of the first node set; determining a second node set with the capacity larger than or equal to the residual capacity from the node dormancy pool, and waking up all dormancy nodes in the second node set, wherein the number of nodes in the second node set is the number of nodes of the P minus the number of nodes in the first node set; taking all active nodes of the first node set and all dormant nodes in the awakened second node set as the target nodes; and reserving the target node, and transferring other active nodes except the target node into the node dormancy pool.
When the current active node can not meet the service requirement of the service, the node is awakened from the dormant node pool to perform the operation, so that the normal processing of the service can be ensured, and the energy consumption is reduced.
In one possible design, the determining the current system traffic includes: acquiring current all video paths, the code stream of each video path, the size of a picture and the writing speed of the picture; and calculating the current system traffic according to the current video path number, the code stream of each video path number, the size of the picture and the writing speed of the picture.
All video path numbers are detected in real time, and the real-time writing flow of the system can be calculated according to the information such as the code stream, the writing picture size, the writing picture speed and the like of each video path number, so that the cluster nodes can be conveniently adjusted according to the writing flow.
In one possible design, after the transferring all the nodes in the cluster to the node dormancy pool, the method further includes: judging whether the service of all the nodes is ended; if a first node with the service not ended exists, waiting for the service of the first node to be ended; and if the second node with the service ended exists, stopping the service of the second node, stopping the maintenance of the hard disk link of the second node, and adjusting the hard disk of the second node to enter dormancy.
The method has the advantages that the partial service of the node entering the node dormancy pool is temporarily closed, and the hard disk link maintenance of the node in the dormancy pool is stopped, so that the hard disk of the node enters dormancy, the effect of reducing the energy consumption of the node is achieved, and the energy is saved for the whole cluster.
In one possible design, the waking up all dormant nodes in the second set of nodes includes: starting business service of each dormant node in the second node set; and starting the hard disk link detection function of each dormant node.
When the dormant node needs to work again, the dormant node is awakened by starting the service of the dormant node and the hard disk link detection function, so that the service can be ensured in time.
In one possible design, after the target node is reserved and other active nodes except the target node are transferred to the node dormancy pool, the method further includes: acquiring the current use capacity of the target node; when the current use capacity is 0, reserving a preset number of hard disks, and transferring the rest hard disks except the reserved hard disks into a hard disk dormancy pool, wherein the hard disks in the hard disk dormancy pool are in an offline state; and when the current use capacity exceeds a preset percentage of the total capacity of the reserved hard disks, waking up the preset number of hard disks from the hard disk dormancy pool.
And a hard disk dormancy mechanism is designed, when the using capacity of the node does not exceed the preset percentage of the total capacity of the current hard disk, the rest hard disk is transferred to a hard disk dormancy pool, and the hard disk in the hard disk dormancy pool is in a offline state, so that extra energy consumption is avoided, and the energy consumption of the node is reduced. Meanwhile, in order to ensure the normal work of the node, when the node use capacity exceeds the preset percentage of the total capacity of the current hard disk, the hard disk in the hard disk dormancy pool is awakened to maintain normal service.
In a second aspect, the present application provides an apparatus for adjusting a cluster node, the apparatus comprising:
The service determining module is used for determining the current system service amount in response to the starting of the node dormancy detection mechanism;
the service judging module judges whether the current system service volume is larger than 0;
And the node transfer module transfers all the nodes in the cluster to the node dormancy pool when the current system traffic is equal to 0.
In one possible design, the apparatus further comprises:
the quantity determining module is used for determining the quantity P of target nodes required by bearing the current system traffic when the current system traffic is greater than 0, wherein the P is an integer greater than 0;
the capacity calculation module calculates the residual capacity of each target node according to the P, the current system traffic and a capacity coefficient, wherein the capacity coefficient represents the storage duration of the current system traffic;
The set determining module is used for determining a first node set with the capacity larger than or equal to the residual capacity from all the current activated nodes;
The node selection module is used for selecting P active nodes from the first node set when the number of the nodes of the first node set is greater than or equal to P, and taking the P active nodes as the target nodes;
and the node reservation module reserves the target node and transfers other active nodes except the target node to the node dormancy pool.
In one possible design, the device is further configured to: when the number of nodes of the first node set is smaller than P, reserving all active nodes of the first node set; determining a second node set with the capacity larger than or equal to the residual capacity from the node dormancy pool, and waking up all dormancy nodes in the second node set, wherein the number of nodes in the second node set is the number of nodes of the P minus the number of nodes in the first node set; taking all active nodes of the first node set and all dormant nodes in the awakened second node set as the target nodes; and reserving the target node, and transferring other active nodes except the target node into the node dormancy pool.
In one possible design, the service determining module is specifically configured to: acquiring current all video paths, the code stream of each video path, the size of a picture and the writing speed of the picture; and calculating the current system traffic according to the current video path number, the code stream of each video path number, the size of the picture and the writing speed of the picture.
In one possible design, the device is further configured to: judging whether the service of all the nodes is ended; if a first node with the service not ended exists, waiting for the service of the first node to be ended; and if the second node with the service ended exists, stopping the service of the second node, stopping the maintenance of the hard disk link of the second node, and adjusting the hard disk of the second node to enter dormancy.
In one possible design, the device is further configured to: starting business service of each dormant node in the second node set; and starting the hard disk link detection function of each dormant node.
In one possible design, the device is further configured to: acquiring the current use capacity of the target node; when the current use capacity is 0, reserving a preset number of hard disks, and transferring the rest hard disks except the reserved hard disks into a hard disk dormancy pool, wherein the hard disks in the hard disk dormancy pool are in an offline state; and when the current use capacity exceeds a preset percentage of the total capacity of the reserved hard disks, waking up the preset number of hard disks from the hard disk dormancy pool.
In a third aspect, the present application provides an electronic device, including:
a memory for storing a computer program;
And the processor is used for realizing the method steps for adjusting the cluster nodes when executing the computer program stored in the memory.
In a fourth aspect, the present application provides a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements a method step of adjusting a cluster node as described above.
The technical effects of each of the second to fourth aspects and the technical effects that may be achieved by each aspect are referred to above for the technical effects that may be achieved by the first aspect or each possible aspect in the first aspect, and the detailed description is not repeated here.
Drawings
FIG. 1 is a flow chart of a method for adjusting cluster nodes according to the present application;
FIG. 2 is a flow chart of a method of determining a dormant or awake node according to the present application;
fig. 3 is a schematic diagram of an apparatus for adjusting cluster nodes according to the present application;
Fig. 4 is a schematic diagram of a structure of an electronic device according to the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings. The specific method of operation in the method embodiment may also be applied to the device embodiment or the system embodiment.
In the description of the present application, "plurality" is understood as "at least two". "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. A is connected with B, and can be represented as follows: both cases of direct connection of A and B and connection of A and B through C. In addition, in the description of the present application, the words "first," "second," and the like are used merely for distinguishing between the descriptions and not be construed as indicating or implying a relative importance or order.
Referring to fig. 1, a flow chart of a method for adjusting cluster nodes according to an embodiment of the present application is shown, and a specific implementation flow of the method is as follows:
Step 101: determining current system traffic in response to the node dormancy detection mechanism being turned on;
In the embodiment of the application, the node dormancy detection mechanism comprises three detection mechanisms, namely a periodic detection mechanism, a service wakeup detection mechanism and an emergency wakeup detection mechanism.
The periodic detection mechanism, that is, the system detects whether the node in the node dormancy pool needs to be adjusted according to the preset period and the real-time service flow, for example, every 1 hour, detects whether the node in the node dormancy pool needs to be adjusted according to the current service flow change, and the periodic detection mechanism can ensure the smooth processing of the current service. When the flow becomes smaller or the residual capacity of the current working node cannot meet the service requirement along with the time, the periodic detection mechanism can wake up the dormant nodes in real time or dormant some nodes, and the energy consumption of the whole cluster system is reduced through the dormant nodes under the condition of ensuring the service.
The service wake-up detection mechanism triggers the adjustment of the nodes in the node dormancy pool according to the service flow fluctuation condition, for example, when the service flow of the cluster is detected to float up and down by 20%, and is maintained for 5 minutes (the relevant fluctuation range and the maintenance time can be set according to the service volume), the system triggers the service wake-up detection, and detects whether the adjustment of the nodes in the node dormancy pool is required according to the real-time service flow. The service wake-up detection mechanism is mainly used for preventing the sudden increase or decrease of the system traffic, and when the periodic detection mechanism is not triggered, the sleep pool of the system node is adjusted in time so as to ensure the normal processing of the service.
The emergency wake-up detection mechanism is used for detecting the active nodes in real time, and when abnormal occurrence of offline and the like of the active nodes is detected, the nodes with response quantity are waken up from the node dormancy pool in time, so that the normal fault-tolerant capability of the system is ensured.
It should be noted that, the above three detection mechanisms are performed simultaneously, so as to jointly ensure the normal processing of the system service.
And determining the current system traffic in response to the node dormancy detection mechanism being turned on. Specifically, information such as the current number of video tracks, the code stream of each video track, the size of the picture, the writing speed of the picture and the like is obtained, and the current system traffic is calculated according to the information.
By detecting all video path numbers in real time, the real-time writing flow of the system can be calculated according to the information such as the code stream, the writing picture size, the writing picture speed and the like of each video path number, and the cluster nodes can be adjusted conveniently according to the writing flow.
Step 102: judging whether the current system traffic is greater than 0; after determining the current system traffic, first determining whether the current system traffic is greater than 0.
In one possible implementation, if the current system traffic is equal to 0, the following operation of step 103 is performed.
In one possible implementation, if the current system traffic is greater than 0, the following operation of step 104 is performed.
Step 103: if the current system traffic is equal to 0, transferring all nodes in the cluster to a node dormancy pool;
if the current system traffic is equal to 0, indicating that no traffic needs to be processed by the nodes currently, transferring all the nodes in the cluster to a node dormancy pool, wherein the nodes in the node dormancy pool are in a dormancy state.
In the embodiment of the present application, the nodes transferred to the node sleep pool execute the following actions, and it should be noted that, in order to prevent the nodes added to the node sleep pool from being frequently awakened and dormant, a start time identifier may be added to each node entering the node sleep pool first for recording the time when the node starts to sleep, when the node is detected to reach a preset duration from the start time, the system issues a sleep notification for the node, and the node obtaining the sleep notification executes the following actions:
1) Judging whether the service of the node is ended or not, if the service of the node is not ended, continuing to wait for the service to end;
2) After the service of the node is finished, stopping the service of the node, wherein the service can be unnecessary services and functions, such as user maintenance connection and service related detection service, and the main service enters a sleep mode;
3) Stopping the hard disk link maintenance of the node, and not detecting the state of the hard disk any more, so that the hard disk enters into dormancy;
4) The write port is not monitored any more, the write service is not actively supported any more, and only the data acquisition request is ensured;
5) And switching the CPU to a sleep mode, and reducing the rotating speed of the fan.
Because the dormancy and the closing of the service in the node dormancy process reduce the resource consumption of the whole cluster, such as a CPU, a memory, network resources and the like, the energy consumption of the whole cluster is reduced, and the energy saving effect is achieved.
Step 104: if the current system traffic is greater than 0, determining that the node needs to be transferred to or awakened from the node dormancy pool according to the current system traffic and all the current activated nodes.
Specifically, according to the current system traffic and all active nodes, the specific process of determining that the node needs to be transferred to the node sleep pool or awakened from the node sleep pool is shown in fig. 2, and includes the following steps:
step 201: if the current system traffic is greater than 0, determining the number P of target nodes required for bearing the current system traffic;
According to the current system service capacity and the performance index of each node, the required target node quantity P is calculated, and the specific calculation formula is as follows:
wherein P is an integer greater than 0, The service node capacity is determined according to the performance index of the node for the current system traffic.
Step 202: calculating the residual capacity of each target node according to the number P of the target nodes, the current system traffic and the capacity coefficient;
specifically, according to the obtained number P of target nodes, the remaining capacity of each target node is calculated by combining the current system traffic and capacity coefficient, and the specific calculation formula is as follows:
C is the residual capacity of each target node, namely the capacity required by each target node to process the current system service; k is a capacity coefficient used for representing the time length of the current system traffic needing to be stored, N+M/N is a redundancy rule of the system, and is related to N+M hard disks initially set by the nodes, namely the capacity of each node needing to be carved with a disk is N+M/N times of the actual required storage capacity.
The residual capacity of each target node is calculated to be used as a selection basis when the node is selected from the activated nodes, the current system service can be processed only by selecting the node with the capacity larger than the residual capacity C, and the unselected node is transferred to the node dormancy pool, so that the service is ensured to be normal accurately, and the cluster energy consumption is saved.
Step 203: determining a first node set with the capacity larger than or equal to the residual capacity from all the current activated nodes;
In the embodiment of the application, the node with the capacity meeting the residual capacity C is preferentially selected from the activated nodes, so that the phenomenon that the dormant node is frequently awakened to cause energy consumption waste can be avoided.
Specifically, from all the active nodes at present, the active nodes with the capacity larger than or equal to the residual capacity are selected, and the nodes form a first node set. The number of nodes of the first set of nodes is then compared to the size of the number of target nodes P.
Step 204: judging whether the node number of the first node set is smaller than the target node number P or not;
in one possible implementation, if the number of nodes in the first node set is not less than the target node number P, the following operation of step 205 is performed.
In one possible implementation, if the number of nodes of the first node set is less than the target number of nodes P, the following operation of step 207 is performed.
Step 205: when the number of the nodes of the first node set is greater than or equal to P, P active nodes are selected from the first node set, and the P active nodes are used as target nodes;
If the number of the nodes in the first node set is greater than or equal to P, the first node set is indicated to contain enough active nodes capable of processing the current system service, the dormant nodes are not required to be awakened from the node dormant pool to process the service, and P active nodes are directly selected from the first node set and are used as target nodes.
In the embodiment of the application, the mode of selecting the P active nodes can be selected at will, can be selected in sequence from large to small according to the capacity size, can be selected in sequence from small to large according to the capacity size, and is not particularly limited.
Step 206: and reserving the target node, and transferring other active nodes except the target node into a node dormancy pool.
And reserving the selected P target nodes, and transferring all the rest active nodes except the P target nodes to a node dormancy pool.
By monitoring the system traffic in real time, when the traffic is smaller, partial nodes are reserved to meet the current traffic, redundant nodes are transferred to a node dormancy pool to carry out dormancy, so that the current traffic service can be ensured, the power consumption of the whole cluster can be reduced, and the energy-saving effect is achieved; and when the service node is reserved, the service node is preferentially selected from the active nodes, so that the energy loss caused by frequently waking up the dormant node can be avoided.
Step 207: when the number of the nodes of the first node set is smaller than P, reserving all the active nodes of the first node set; the operation of step 208 is then performed.
Step 208: determining a second node set with the capacity larger than or equal to the residual capacity from the node dormancy pool, and waking up all dormancy nodes in the second node set;
In the embodiment of the present application, the number of nodes in the second node set is the target node number P minus the number of nodes in the first node set.
When the number of nodes in the first node set is smaller than P, the current active node cannot meet the current system traffic, and the partially dormant node needs to be awakened from the node dormant pool to support the current traffic. Specifically, the dormant nodes with the number P minus the number of the nodes of the first node set are selected from the node dormant pool, the capacity of the dormant nodes is larger than or equal to the residual capacity C, the dormant nodes form a second node set, and all the dormant nodes in the second node set are awakened. The operation of step 209 is then performed.
In the embodiment of the application, after receiving the wake-up instruction, the sleep node executes the following actions:
1) Starting the business service stopped before;
2) Adjusting system parameters, improving the rotating speed of a fan, and switching the CPU into a high-performance mode;
3) And starting a hard disk link detection function, and starting hard disk link maintenance to enable the node to be in an optimal performance state.
Step 209: and taking all active nodes of the first node set and all dormant nodes in the awakened second node set as target nodes. The operations of step 206 described above are then performed.
Through monitoring the system traffic in real time, when the traffic is large and the current active node cannot meet the service requirement of the service, the node is awakened from the dormant node pool to perform operation, so that the normal processing of the service can be ensured, and the energy consumption is reduced.
Furthermore, a hard disk dormancy mechanism is designed for the cluster nodes, and for the nodes which are providing service in an activated state, the current use capacity of the nodes is obtained.
If the current usage capacity of the node is 0, a preset number of hard disks is reserved, wherein the preset number can be n+m, for example, 4+1 hard disks, the rest hard disks are transferred into a hard disk dormancy pool, and the hard disks in the dormancy pool are disconnected.
And monitoring the use capacity in real time, and when the use capacity exceeds a preset percentage of the total capacity of the currently reserved hard disk, such as more than 50% of the total capacity of the reserved hard disk, waking up a preset number of hard disks from the hard disk dormancy pool, and adding the woken-up hard disks into the storage array.
In addition, the method also needs to detect the state of the hard disk, and if the hard disk is damaged, the hard disk needs to be awakened from the hard disk dormancy pool to maintain normal service.
The number of the hard disks in a standby state is reduced by the hard disk sleep mechanism of the offline part, so that the rotating speed of a server (node) fan is correspondingly reduced, the energy consumption of a single server is reduced, and the energy-saving effect is achieved.
Based on the same inventive concept, the application also provides a device for adjusting cluster nodes, which is used for reducing the energy consumption of the whole cluster and achieving the energy saving effect, and referring to fig. 3, the device comprises:
the service determining module 301 determines the current system traffic in response to the node dormancy detection mechanism being turned on;
a service judging module 302, configured to judge whether the current system traffic is greater than 0;
And the node transferring module 303 transfers all the nodes in the cluster to the node dormancy pool when the current system traffic is equal to 0.
In one possible design, the apparatus further comprises:
the quantity determining module is used for determining the quantity P of target nodes required by bearing the current system traffic when the current system traffic is greater than 0, wherein the P is an integer greater than 0;
the capacity calculation module calculates the residual capacity of each target node according to the P, the current system traffic and a capacity coefficient, wherein the capacity coefficient represents the storage duration of the current system traffic;
The set determining module is used for determining a first node set with the capacity larger than or equal to the residual capacity from all the current activated nodes;
The node selection module is used for selecting P active nodes from the first node set when the number of the nodes of the first node set is greater than or equal to P, and taking the P active nodes as the target nodes;
and the node reservation module reserves the target node and transfers other active nodes except the target node to the node dormancy pool.
In one possible design, the device is further configured to: when the number of nodes of the first node set is smaller than P, reserving all active nodes of the first node set; determining a second node set with the capacity larger than or equal to the residual capacity from the node dormancy pool, and waking up all dormancy nodes in the second node set, wherein the number of nodes in the second node set is the number of nodes of the P minus the number of nodes in the first node set; taking all active nodes of the first node set and all dormant nodes in the awakened second node set as the target nodes; and reserving the target node, and transferring other active nodes except the target node into the node dormancy pool.
In one possible design, the service determining module 301 is specifically configured to: acquiring current all video paths, the code stream of each video path, the size of a picture and the writing speed of the picture; and calculating the current system traffic according to the current video path number, the code stream of each video path number, the size of the picture and the writing speed of the picture.
In one possible design, the device is further configured to: judging whether the service of all the nodes is ended; if a first node with the service not ended exists, waiting for the service of the first node to be ended; and if the second node with the service ended exists, stopping the service of the second node, stopping the maintenance of the hard disk link of the second node, and adjusting the hard disk of the second node to enter dormancy.
In one possible design, the device is further configured to: starting business service of each dormant node in the second node set; and starting the hard disk link detection function of each dormant node.
In one possible design, the device is further configured to: acquiring the current use capacity of the target node; when the current use capacity is 0, reserving a preset number of hard disks, and transferring the rest hard disks except the reserved hard disks into a hard disk dormancy pool, wherein the hard disks in the hard disk dormancy pool are in an offline state; and when the current use capacity exceeds a preset percentage of the total capacity of the reserved hard disks, waking up the preset number of hard disks from the hard disk dormancy pool.
Based on the device, the system traffic is monitored in real time, when the traffic is smaller, partial nodes are reserved to meet the current traffic, redundant nodes are transferred to a node dormancy pool to carry out dormancy, so that the current traffic service can be ensured, the power consumption of the whole cluster can be reduced, and the energy-saving effect is achieved; when the traffic is large and the current active node cannot meet the service requirement of the service, the node is awakened from the dormant node pool to perform the operation, so that the normal processing of the service can be ensured, and the energy consumption is reduced.
Based on the same inventive concept, the embodiment of the present application further provides an electronic device, where the electronic device may implement the function of the foregoing apparatus for adjusting a cluster node, and referring to fig. 4, the electronic device includes:
At least one processor 401, and a memory 402 connected to the at least one processor 401, in which the specific connection medium between the processor 401 and the memory 402 is not limited in the embodiment of the present application, and in fig. 4, the connection between the processor 401 and the memory 402 through the bus 400 is taken as an example. The bus 400 is shown in bold lines in fig. 4, and the manner in which the other components are connected is illustrated schematically and not by way of limitation. The bus 400 may be divided into an address bus, a data bus, a control bus, etc., and is represented by only one thick line in fig. 4 for ease of illustration, but does not represent only one bus or one type of bus. Or processor 401 may also be referred to as a controller, without limitation of the name.
In an embodiment of the present application, the memory 402 stores instructions executable by the at least one processor 401, and the at least one processor 401 may perform the method for adjusting cluster nodes as described above by executing the instructions stored in the memory 402. Processor 401 may implement the functions of the various modules in the apparatus shown in fig. 3.
The processor 401 is a control center of the apparatus, and various interfaces and lines can be used to connect various parts of the entire control device, and by executing or executing instructions stored in the memory 402 and invoking data stored in the memory 402, various functions of the apparatus and processing data can be performed, so that the apparatus is monitored as a whole.
In one possible design, processor 401 may include one or more processing units, and processor 401 may integrate an application processor and a modem processor, wherein the application processor primarily processes operating systems, user interfaces, application programs, and the like, and the modem processor primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401. In some embodiments, processor 401 and memory 402 may be implemented on the same chip, and in some embodiments they may be implemented separately on separate chips.
The processor 401 may be a general purpose processor such as a Central Processing Unit (CPU), digital signal processor, application specific integrated circuit, field programmable gate array or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, which may implement or perform the methods, steps and logic blocks disclosed in the embodiments of the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method for adjusting cluster nodes disclosed in connection with the embodiments of the present application may be directly embodied as a hardware processor executing, or may be executed by a combination of hardware and software modules in the processor.
Memory 402 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 402 may include at least one type of storage medium, which may include, for example, flash Memory, hard disk, multimedia card, card Memory, random access Memory (Random Access Memory, RAM), static random access Memory (Static Random Access Memory, SRAM), programmable Read-Only Memory (Programmable Read Only Memory, PROM), read-Only Memory (ROM), charged erasable programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM), magnetic Memory, magnetic disk, optical disk, and the like. Memory 402 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 402 in embodiments of the present application may also be circuitry or any other device capable of performing memory functions for storing program instructions and/or data.
By programming the processor 401, the code corresponding to the method for adjusting the cluster node described in the foregoing embodiment may be solidified into a chip, so that the chip can execute the steps of the method for adjusting the cluster node in the embodiment shown in fig. 1 at runtime. How to design and program the processor 401 is a technology well known to those skilled in the art, and will not be described in detail here.
Based on the same inventive concept, the embodiments of the present application also provide a storage medium storing computer instructions that, when run on a computer, cause the computer to perform the method of adjusting cluster nodes as discussed above.
In some possible embodiments, aspects of the method for adjusting a cluster node provided by the present application may also be implemented in the form of a program product comprising program code for causing the control apparatus to carry out the steps in the method for adjusting a cluster node according to the various exemplary embodiments of the present application as described in the present specification when the program product is run on a device.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (10)

1. A method of adjusting a cluster node, the method comprising:
Determining current system traffic in response to the node dormancy detection mechanism being turned on;
judging whether the current system traffic is greater than 0;
And when the current system traffic is equal to 0, transferring all nodes in the cluster to a node dormancy pool.
2. The method of claim 1, wherein the method further comprises:
When the current system traffic is greater than 0, determining the number P of target nodes required for bearing the current system traffic, wherein P is an integer greater than 0;
calculating the residual capacity of each target node according to the P, the current system traffic and a capacity coefficient, wherein the capacity coefficient represents the storage duration of the current system traffic;
determining a first node set with the capacity larger than or equal to the residual capacity from all the current activated nodes;
When the number of the nodes of the first node set is greater than or equal to P, P active nodes are selected from the first node set, and the P active nodes are used as the target nodes;
And reserving the target node, and transferring other active nodes except the target node into the node dormancy pool.
3. The method of claim 2, further comprising, after said determining a first set of nodes having a capacity greater than or equal to said remaining capacity from among all currently active nodes:
when the number of nodes of the first node set is smaller than P, reserving all active nodes of the first node set;
Determining a second node set with the capacity larger than or equal to the residual capacity from the node dormancy pool, and waking up all dormancy nodes in the second node set, wherein the number of nodes in the second node set is the number of nodes of the P minus the number of nodes in the first node set;
taking all active nodes of the first node set and all dormant nodes in the awakened second node set as the target nodes;
And reserving the target node, and transferring other active nodes except the target node into the node dormancy pool.
4. The method of claim 1, wherein said determining current system traffic comprises:
acquiring current all video paths, the code stream of each video path, the size of a picture and the writing speed of the picture;
And calculating the current system traffic according to the current video path number, the code stream of each video path number, the size of the picture and the writing speed of the picture.
5. The method of claim 1, further comprising, after said transferring all nodes in the cluster to the node dormancy pool:
judging whether the service of all the nodes is ended;
If a first node with the service not ended exists, waiting for the service of the first node to be ended;
and if the second node with the service ended exists, stopping the service of the second node, stopping the maintenance of the hard disk link of the second node, and adjusting the hard disk of the second node to enter dormancy.
6. The method of claim 3, wherein the waking up all dormant nodes in the second set of nodes comprises:
Starting business service of each dormant node in the second node set;
and starting the hard disk link detection function of each dormant node.
7. The method of claim 2, further comprising, after the reserving the target node and transferring other active nodes than the target node into the node sleep pool:
acquiring the current use capacity of the target node;
When the current use capacity is 0, reserving a preset number of hard disks, and transferring the rest hard disks except the reserved hard disks into a hard disk dormancy pool, wherein the hard disks in the hard disk dormancy pool are in an offline state;
and when the current use capacity exceeds a preset percentage of the total capacity of the reserved hard disks, waking up the preset number of hard disks from the hard disk dormancy pool.
8. An apparatus for adjusting a cluster node, the apparatus comprising:
The service determining module is used for determining the current system service amount in response to the starting of the node dormancy detection mechanism;
the service judging module judges whether the current system service volume is larger than 0;
And the node transfer module transfers all the nodes in the cluster to the node dormancy pool when the current system traffic is equal to 0.
9. An electronic device, comprising:
a memory for storing a computer program;
A processor for carrying out the method steps of any one of claims 1-7 when executing a computer program stored on said memory.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-7.
CN202411379934.0A 2024-09-30 2024-09-30 Method and device for adjusting cluster nodes and electronic equipment Active CN118939433B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411379934.0A CN118939433B (en) 2024-09-30 2024-09-30 Method and device for adjusting cluster nodes and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411379934.0A CN118939433B (en) 2024-09-30 2024-09-30 Method and device for adjusting cluster nodes and electronic equipment

Publications (2)

Publication Number Publication Date
CN118939433A true CN118939433A (en) 2024-11-12
CN118939433B CN118939433B (en) 2025-05-13

Family

ID=93353365

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411379934.0A Active CN118939433B (en) 2024-09-30 2024-09-30 Method and device for adjusting cluster nodes and electronic equipment

Country Status (1)

Country Link
CN (1) CN118939433B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119356891A (en) * 2024-12-26 2025-01-24 鹏城实验室 Energy-saving control method, device, equipment and storage medium for servers in a cluster

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200019444A1 (en) * 2018-07-11 2020-01-16 International Business Machines Corporation Cluster load balancing based on assessment of future loading
CN113485841A (en) * 2021-07-28 2021-10-08 腾讯科技(深圳)有限公司 Data processing method and device based on edge calculation and readable storage medium
CN114710563A (en) * 2020-12-17 2022-07-05 华为技术有限公司 A kind of cluster energy saving method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200019444A1 (en) * 2018-07-11 2020-01-16 International Business Machines Corporation Cluster load balancing based on assessment of future loading
CN114710563A (en) * 2020-12-17 2022-07-05 华为技术有限公司 A kind of cluster energy saving method and device
CN113485841A (en) * 2021-07-28 2021-10-08 腾讯科技(深圳)有限公司 Data processing method and device based on edge calculation and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JIEXIONG XU 等: ""LightPool: A NVMe-oF-based High-performance and Lightweight Storage Pool Architecture for Cloud-Native Distributed Database"", 《IEEE XPLORE》, 2 April 2024 (2024-04-02), pages 1 - 4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119356891A (en) * 2024-12-26 2025-01-24 鹏城实验室 Energy-saving control method, device, equipment and storage medium for servers in a cluster
CN119356891B (en) * 2024-12-26 2025-04-01 鹏城实验室 Energy-saving control method, device, equipment and storage medium for servers in cluster

Also Published As

Publication number Publication date
CN118939433B (en) 2025-05-13

Similar Documents

Publication Publication Date Title
US9098274B2 (en) Methods and apparatuses to improve turbo performance for events handling
US20190272019A1 (en) Distributed power budgeting
US8112647B2 (en) Protocol for power state determination and demotion
JP5577404B2 (en) Adaptive power saving methods in storage clusters
US8156362B2 (en) Hardware monitoring and decision making for transitioning in and out of low-power state
CN101354606B (en) Method, system and device for controlling energy consumption of disk array
US20090235260A1 (en) Enhanced Control of CPU Parking and Thread Rescheduling for Maximizing the Benefits of Low-Power State
US10115442B2 (en) Demand-based provisioning of volatile memory for use as non-volatile memory
CN103765409A (en) Power efficient processor architecture
CN118939433B (en) Method and device for adjusting cluster nodes and electronic equipment
US10936038B2 (en) Power control for use of volatile memory as non-volatile memory
US10359826B2 (en) Use of volatile memory as non-volatile memory
CN103365392B (en) Internal storage management system
CN111104048A (en) A data processing method and distributed storage system
CN118860805B (en) Operation mode adjustment method, device, computer equipment and storage medium
CN101458555B (en) Method for adjusting clock period and calculating system
US9411663B2 (en) Conditional notification mechanism
US10884477B2 (en) Coordinating accesses of shared resources by clients in a computing device
CN101776946B (en) Method for controlling power consumption on basis of object-based storage system
CN111459261A (en) Disk wake-up method and device, electronic equipment and storage medium
CN107479830A (en) A kind of energy saving of hard disks control method and device
CN112506686B (en) A DCS controller log system implementation method and device
CN116449935B (en) Cluster energy-saving management method, electronic equipment and computer storage medium
US20250208681A1 (en) Event-triggered dynamic power management
US20250037750A1 (en) Memory self-refresh power gating

Legal Events

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