CN110750219B - Storage cluster service processing method, device, equipment and readable storage medium - Google Patents

Storage cluster service processing method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN110750219B
CN110750219B CN201910996178.9A CN201910996178A CN110750219B CN 110750219 B CN110750219 B CN 110750219B CN 201910996178 A CN201910996178 A CN 201910996178A CN 110750219 B CN110750219 B CN 110750219B
Authority
CN
China
Prior art keywords
node
target
service
storage cluster
node number
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910996178.9A
Other languages
Chinese (zh)
Other versions
CN110750219A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201910996178.9A priority Critical patent/CN110750219B/en
Publication of CN110750219A publication Critical patent/CN110750219A/en
Application granted granted Critical
Publication of CN110750219B publication Critical patent/CN110750219B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0617Improving the reliability of storage systems in relation to availability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1012Server selection for load balancing based on compliance of requirements or conditions with available server resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1029Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers using data related to the state of servers by a load balancer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a service processing method of a storage cluster, which comprises the following steps: receiving a service processing request, and analyzing the service processing request to obtain a node selection rule of a service to be processed corresponding to the service processing request; calculating the corresponding target main node number and the target backup node number according to the node selection rule; calling a node management array through an operating state machine to judge whether the number of the target main node and the number of the target backup node are both valid; if yes, selecting a target main node corresponding to the target main node number and a target backup node corresponding to the target backup node number from the storage cluster; and processing the service to be processed by using the target main node and the target backup node. The invention determines the validity of the number of the selected target main node and the number of the target backup node, avoids error judgment of faults and ensures normal operation of service processing. The invention also discloses a service processing device, equipment and a storage medium of the storage cluster, and the service processing device, the equipment and the storage medium have corresponding technical effects.

Description

Storage cluster service processing method, device, equipment and readable storage medium
Technical Field
The present invention relates to the field of storage technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for processing a service of a storage cluster.
Background
The current design of the unified storage device usually adopts a redundancy design of multiple controllers, that is, one storage device comprises two controllers; in order to reduce the loss of some serious disasters, a cluster may also contain a plurality of devices. In this design, each storage device may be referred to as an IoGroup, and one controller in each device may be referred to as a Node. That is, one cluster may include a plurality of storage devices, each storage device has a different storage device (IoGroup) number, and one storage device may include two nodes (nodes) having different Node numbers.
In the prior art, under the redundant design architecture, the service processing mode is that when each service module performs service processing, a storage device is selected, and a master node and a corresponding backup node are defined in the storage device. Under the multi-node design architecture, the processes of node exit and node join in various scenes exist, so that online nodes in the cluster may change at each moment, and therefore, under the special scenes, the phenomenon that nodes exist in the storage device currently selected by the service module exit and are misjudged as a fault, so that the service cannot be normally processed, is likely to occur.
In summary, how to effectively solve the problem that the service cannot be normally processed due to the fact that the node of the storage device currently selected by the service module exits and is misjudged as a fault is a problem that needs to be solved by a person skilled in the art at present.
Disclosure of Invention
The invention aims to provide a service processing method of a storage cluster, which determines the effectiveness of the number of a selected target main node and the number of a target backup node, avoids fault misjudgment and ensures the normal operation of service processing; another object of the present invention is to provide a service processing apparatus, device and computer readable storage medium for a storage cluster.
In order to solve the technical problems, the invention provides the following technical scheme:
a service processing method of a storage cluster comprises the following steps:
receiving a service processing request, and analyzing the service processing request to obtain a node selection rule of a service to be processed corresponding to the service processing request;
calculating the corresponding target main node number and the target backup node number according to the node selection rule;
calling a node management array through an operating state machine to judge whether the target main node number and the target backup node number are both valid; each array bit of the node management array stores a preset node number or an invalid value for marking the running state of each node in the storage cluster;
if so, selecting a target main node corresponding to the target main node number and a target backup node corresponding to the target backup node number from the storage cluster, and performing processing operation on the service to be processed by using the target main node and the target backup node;
if not, carrying out node selection rule adjustment prompting operation.
In one embodiment of the present invention, the method further comprises:
and when a node joining event or a node quitting event is detected, suspending the processing operation of the service to be processed.
In a specific embodiment of the present invention, after suspending the processing operation on the service to be processed, the method further includes:
and according to the node adding event or the node quitting event which occurs currently, carrying out validity updating operation on the preset node number of the corresponding array position in the node management array.
In a specific embodiment of the present invention, calculating a number of a target master node and a number of a target backup node according to the node selection rule includes:
determining a target array position of the target main node in the node management array according to the node selection rule; the storage cluster is composed of a plurality of storage devices including a main node and a backup node;
calculating the number of the target main node by combining the target digit group and the node number calculation formula:
array bit = storage device number 2+ node number;
the target main node number comprises a storage device number of a target storage device where the main node is located and a node number of a corresponding node;
and determining the number of another node except the number of the target main node in the number of the storage device corresponding to the number of the target main node as the number of the target backup node.
A traffic processing apparatus of a storage cluster, comprising:
the node selection rule obtaining module is used for receiving a service processing request and analyzing the service processing request to obtain a node selection rule of a service to be processed corresponding to the service processing request;
the node number calculation module is used for calculating the corresponding target main node number and the target backup node number according to the node selection rule;
the number validity judging module is used for calling the node management array through the running state machine to judge whether the target main node number and the target backup node number are both valid; each array bit of the node management array stores a preset node number or an invalid value for marking the running state of each node in the storage cluster;
the service processing module is used for selecting a target main node corresponding to the target main node number and a target backup node corresponding to the target backup node number from a storage cluster when the target main node number and the target backup node number are determined to be both valid, and processing the service to be processed by using the target main node and the target backup node;
and the rule adjustment prompting module is used for carrying out node selection rule adjustment prompting operation when determining that an invalid number exists in the target main node number and the target backup node number.
In one embodiment of the present invention, the method further comprises:
and the service processing suspension module is used for suspending the processing operation of the service to be processed when a node joining event or a node quitting event is detected.
In one embodiment of the present invention, the method further comprises:
and the number validity updating module is used for carrying out validity updating operation on the preset node numbers of the corresponding array bits in the node management array according to the currently occurring node adding event or the node quitting event after the processing operation on the service to be processed is suspended.
In a specific embodiment of the present invention, the node number calculation module includes:
the array is a determining submodule and is used for determining a target array position of the target main node in the node management array according to the node selection rule; the storage cluster is composed of a plurality of storage devices including a main node and a backup node;
the main node number calculation submodule is used for calculating the number of the target main node by combining the target digit group and the node number calculation formula:
array bit = storage device number 2+ node number;
the target main node number comprises a storage device number of a target storage device where the main node is located and a node number of a corresponding node;
and the backup node number determining submodule is used for determining the number of another node except the target main node number in the storage equipment number corresponding to the target main node number as the target backup node number.
A traffic processing device of a storage cluster, comprising:
a memory for storing a computer program;
a processor, configured to implement the steps of the foregoing storage cluster service processing method when executing the computer program.
A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the traffic processing method of a storage cluster as set forth above.
The method provided by the embodiment of the invention is applied to receive the service processing request and analyze the service processing request to obtain the node selection rule of the service to be processed corresponding to the service processing request; calculating the corresponding target main node number and the target backup node number according to the node selection rule; calling a node management array through an operating state machine to judge whether the number of the target main node and the number of the target backup node are both valid; each array bit of the node management array stores a preset node number or an invalid value for marking the running state of each node in the storage cluster; if yes, selecting a target main node corresponding to the target main node number and a target backup node corresponding to the target backup node number from the storage cluster; and processing the service to be processed by using the target main node and the target backup node. The node numbers are set for the nodes in the storage cluster, the node management array is set to store the node numbers, and the validity of the node numbers is identified by using the array bits in the node management array, so that the validity of the selected target main node number and the target backup node number is determined, fault misjudgment is avoided, and normal operation of service processing is ensured.
Correspondingly, embodiments of the present invention further provide a storage cluster service processing apparatus, a device and a computer-readable storage medium corresponding to the storage cluster service processing method, which have the above technical effects and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of an implementation of a service processing method of a storage cluster in an embodiment of the present invention;
fig. 2 is a flowchart of another implementation of a service processing method of a storage cluster in the embodiment of the present invention;
fig. 3 is a block diagram of a service processing apparatus of a storage cluster in an embodiment of the present invention;
fig. 4 is a block diagram of a service processing device of a storage cluster according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The first embodiment is as follows:
referring to fig. 1, fig. 1 is a flowchart of an implementation of a service processing method of a storage cluster in an embodiment of the present invention, where the method may include the following steps:
s101: and receiving a service processing request, and analyzing the service processing request to obtain a node selection rule of the service to be processed corresponding to the service processing request.
When the service processing is required, a service processing request can be sent to the service processing center, and the service processing center receives the service processing request. The service processing request may be configured with a node selection rule for selecting a node required for processing the service to be processed. After receiving the service processing request, the service processing center may parse the service processing request to obtain a node selection rule of the service to be processed corresponding to the service processing request.
S102: and calculating the corresponding target main node number and the target backup node number according to the node selection rule.
The nodes in the storage cluster can be numbered in advance, and the determination of the target master node number of the target master node and the target backup node number of the target backup node required for the service processing of the service to be processed is related to a node selection rule, for example, each node in the storage cluster is divided into a first node group, a second node group and a third node group according to the sequence of the preset node numbers, the node selection rule can be that the number of the node which is coded first in the first node group is selected as the target master node number, and the number of the next coding node of the node which is coded first is selected as the target backup node number. After the node selection rule is obtained through analysis, the corresponding target main node number and the target backup node number can be calculated according to the node selection rule.
S103: and calling the node management array through the running state machine to judge whether the target main node number and the target backup node number are both valid, if so, executing the step S104, and if not, executing the step S105.
And each array bit of the node management array stores a preset node number or an invalid value for marking the running state of each node in the storage cluster.
The node management array for managing the node numbers of the nodes in the storage cluster can be preset, and each array bit of the node management array stores a preset node number or an invalid value for marking the running state of each node in the storage cluster, namely for each array bit, when the node corresponding to the preset node number of the array bit in the pre-deployment state is in a normal running state, the array bit is marked as a corresponding preset node number, and when the node corresponding to the preset node number of the array bit in the pre-deployment state is in an exit state, the array bit is marked as a preset invalid value.
And after the target main node number and the target backup node number are obtained through calculation, the node management array can be called by operating the state machine to judge whether the target main node number and the target backup node number are both effective. When it is determined that both the target master node number and the target backup node number are valid, it may be indicated that both the target master node corresponding to the target master node number and the target backup node corresponding to the target backup node number are in a normal operating state, step S104 may be continuously performed, and when it is determined that an invalid node number exists in the target master node number and the target backup node number, it may be indicated that a node that has exited exists in the target backup node corresponding to the target master node number and the target backup node number corresponding to the target master node number, and in this case, step S105 may be continuously performed.
S104: and selecting a target main node corresponding to the target main node number and a target backup node corresponding to the target backup node number from the storage cluster, and performing processing operation on the service to be processed by using the target main node and the target backup node.
When it is determined that the target master node number and the target backup node number are both valid, the target master node corresponding to the target master node number and the target backup node corresponding to the target backup node number may be selected from the storage cluster, and the target master node and the target backup node are utilized to perform processing operation on the service to be processed.
S105: and carrying out node selection rule adjustment prompting operation.
When the invalid node number exists in the target main node number and the target backup node number, a node selection rule adjustment prompting operation can be performed, so that a service processing request sending end can conveniently adjust a node selection rule according to the node selection rule adjustment prompting information, the effective target main node number and the effective target backup node number are selected, the target main node corresponding to the target main node number and the target backup node corresponding to the target backup node number are finally selected from a storage cluster, and the target main node and the target backup node are used for processing the service to be processed.
The method provided by the embodiment of the invention is applied to receive the service processing request and analyze the service processing request to obtain the node selection rule of the service to be processed corresponding to the service processing request; calculating the corresponding target main node number and the target backup node number according to the node selection rule; calling a node management array through an operating state machine to judge whether the number of the target main node and the number of the target backup node are both valid; each array bit of the node management array stores a preset node number or an invalid value for marking the running state of each node in the storage cluster; if yes, selecting a target main node corresponding to the target main node number and a target backup node corresponding to the target backup node number from the storage cluster; and processing the service to be processed by using the target main node and the target backup node. The node numbers are set for the nodes in the storage cluster, the node management array is set to store the node numbers, and the validity of the node numbers is identified by using the array bits in the node management array, so that the validity of the selected target main node number and the target backup node number is determined, fault misjudgment is avoided, and normal operation of service processing is ensured.
It should be noted that, based on the first embodiment, the embodiment of the present invention further provides a corresponding improvement scheme. In the following embodiments, steps that are the same as or correspond to those in the first embodiment may be referred to each other, and corresponding advantageous effects may also be referred to each other, which are not described in detail in the following modified embodiments.
Example two:
referring to fig. 2, fig. 2 is a flowchart of another implementation of a service processing method for a storage cluster in an embodiment of the present invention, where the method may include the following steps:
s201: and receiving the service processing request, and analyzing the service processing request to obtain a node selection rule of the service to be processed corresponding to the service processing request.
S202: and determining a target array position of the target main node in the node management array according to the node selection rule.
The storage cluster is composed of a plurality of storage devices including a main node and a backup node.
A storage cluster may contain multiple storage devices, with each storage device being comprised of a primary node and a backup node. The determination of the target group digit of the target master node in the node management array is related to the selected node selection rule, if it is assumed that 5 storage devices are in total in the storage cluster, each storage device comprises two nodes, namely the number of the nodes in the storage cluster is 10, the node management array is set to store the node numbers of the nodes, the 10 group digits of the node management array are 0-9 respectively, the node selection rule can be set to be that the last digit in the node management array is used as the target group digit of the target master node, and therefore the target group digit is 9. After the node selection rule is obtained through analysis, the target array position of the target main node in the node management array can be determined according to the node selection rule.
It should be noted that, for the master node and the backup node in the same storage device, only a one-to-two relationship between the storage device and the node is indicated, specifically, the master-backup relationship between the two nodes is determined by a specific service, and for the same storage device, when it is used for processing different services, the master-backup relationship between the two nodes may be different.
S203: and calculating the number of the target main node by combining the target digit group position and the node number calculation formula:
array bits = storage device number 2+ node number.
The target main node number comprises a storage device number of a target storage device where the main node is located and a node number of a corresponding node.
The node number calculation formula may be preset, and may be set as follows according to a one-to-two relationship between the storage device and the node, and a storage relationship between each array bit in the node management array and each node number of each node included in each storage device, respectively: group bit = storage device number × 2+ node number, where the storage device number is an IoGroup number, and the node number may represent a Position (Position number) of the storage device in the storage device, so that the node number calculation formula may be written as: group bit = IoGroup number × 2+ Position number. In the above example, the storage device IoGroup numbers in the storage cluster may be set to be 0 to 4, and the Position numbers of the two nodes included in each storage device are 0 and 1, respectively. And writing the node number of the Position 0 of the Iogroup 0 into the 0 th array bit of the node management array, writing the node number of the Position 1 of the Iogroup 0 into the 1 st array bit of the node management array, and so on. After determining the target digit group position of the target master node in the node management digit group, the target master node number may be calculated by combining the target digit group position and the node number calculation formula, that is, the storage device number of the target storage device where the master node is located and the node number of the corresponding node may indicate the target master node number.
S204: and determining the number of the other node except the number of the target main node in the storage device number corresponding to the number of the target main node as the number of the target backup node.
Because a service to be processed is mostly processed and completed by two nodes corresponding to the same storage device, after the number of the target master node is calculated, the number of another node except the number of the target master node in the number of the storage device corresponding to the number of the target master node can be determined as the number of the target backup node.
S205: and calling the node management array through the running state machine to judge whether the target main node number and the target backup node number are both valid, if so, executing step S206, and if not, executing step S207.
And each array bit of the node management array stores a preset node number or an invalid value for marking the running state of each node in the storage cluster.
S206: and selecting a target main node corresponding to the target main node number and a target backup node corresponding to the target backup node number from the storage cluster, and performing processing operation on the service to be processed by using the target main node and the target backup node.
S207: and carrying out node selection rule adjustment prompting operation.
S208: and when detecting that a node joining event or a node quitting event occurs, suspending the processing operation of the service to be processed.
In the process of service processing, a node joining event or a node exiting event may occur, and when the node joining event or the node exiting event is detected, the processing operation of the service to be processed may be suspended, thereby avoiding adverse effects on the current service processing operation due to the change of the node running state in the storage cluster.
S209: and carrying out validity updating operation on the preset node number of the corresponding array position in the node management array according to the currently occurring node adding event or node exiting event.
When a node join event or a node exit event is detected, validity updating operation may be performed on the preset node number of the corresponding group bit in the node management array according to the node join event or the node exit event that occurs currently, to support the above example, for example, if a node of Position No. 1 of IoGroup No. 0 exits, the group bit No. 1 of the node management array is set to an invalid value. By quickly updating the preset node number of the corresponding array bit in the node management array, the service processing center is ensured to smoothly and efficiently complete the related service.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a service processing device of a storage cluster, and the service processing device of the storage cluster described below and the service processing method of the storage cluster described above may be referred to correspondingly.
Referring to fig. 3, fig. 3 is a block diagram of a structure of a service processing apparatus of a storage cluster in an embodiment of the present invention, where the apparatus may include:
a node selection rule obtaining module 31, configured to receive the service processing request, and analyze the service processing request to obtain a node selection rule of the to-be-processed service corresponding to the service processing request;
the node number calculation module 32 is used for calculating the corresponding target main node number and the target backup node number according to the node selection rule;
a number validity judging module 33, configured to call the node management array through the running state machine to judge whether the target master node number and the target backup node number are both valid; each array bit of the node management array stores a preset node number or an invalid value for marking the running state of each node in the storage cluster;
the service processing module 34 is configured to, when it is determined that the target master node number and the target backup node number are both valid, select a target master node corresponding to the target master node number and a target backup node corresponding to the target backup node number from the storage cluster, and perform a processing operation on a service to be processed by using the target master node and the target backup node;
and the rule adjustment prompting module 35 is configured to perform a node selection rule adjustment prompting operation when it is determined that an invalid number exists in the target master node number and the target backup node number.
The device provided by the embodiment of the invention is applied to receive the service processing request and analyze the service processing request to obtain the node selection rule of the service to be processed corresponding to the service processing request; calculating the corresponding target main node number and the target backup node number according to the node selection rule; calling a node management array through an operating state machine to judge whether the number of the target main node and the number of the target backup node are both valid; each array bit of the node management array stores a preset node number or an invalid value for marking the running state of each node in the storage cluster; if yes, selecting a target main node corresponding to the target main node number and a target backup node corresponding to the target backup node number from the storage cluster; and processing the service to be processed by using the target main node and the target backup node. The node numbers are set for the nodes in the storage cluster, the node management array is set to store the node numbers, and the validity of the node numbers is identified by using the array bits in the node management array, so that the validity of the selected target main node number and the target backup node number is determined, fault misjudgment is avoided, and normal operation of service processing is ensured.
In one embodiment of the present invention, the apparatus may further include:
and the service processing suspension module is used for suspending the processing operation of the service to be processed when the node joining event or the node quitting event is detected.
In one embodiment of the present invention, the apparatus may further include:
and the number validity updating module is used for carrying out validity updating operation on the preset node numbers of the corresponding array positions in the node management array according to the currently occurring node adding event or node quitting event after the processing operation of the service to be processed is suspended.
In a specific embodiment of the present invention, the node number calculation module includes:
the array is a determining submodule and is used for determining a target array position of the target main node in the node management array according to the node selection rule; the storage cluster is composed of a plurality of storage devices including a main node and a backup node;
the main node number calculation submodule is used for calculating the number of the target main node by combining the target digit group and the node number calculation formula:
the array bit = number of storage device 2+ number of node;
the target main node number comprises a storage device number of a target storage device where the main node is located and a node number of a corresponding node;
and the backup node number determining submodule is used for determining the number of another node except the number of the target main node in the storage equipment number corresponding to the number of the target main node as the number of the target backup node.
Corresponding to the above method embodiment, referring to fig. 4, fig. 4 is a schematic diagram of an apparatus provided by the present invention, which may include:
a memory 41 for storing a computer program;
the processor 42, when executing the computer program stored in the memory 41, may implement the following steps:
receiving a service processing request, and analyzing the service processing request to obtain a node selection rule of a service to be processed corresponding to the service processing request; calculating the corresponding target main node number and the target backup node number according to the node selection rule; calling a node management array through an operating state machine to judge whether the number of the target main node and the number of the target backup node are both valid; each array bit of the node management array stores a preset node number or an invalid value for marking the running state of each node in the storage cluster; if yes, selecting a target main node corresponding to the target main node number and a target backup node corresponding to the target backup node number from the storage cluster; and processing the service to be processed by using the target main node and the target backup node.
For the introduction of the device provided by the present invention, please refer to the above method embodiment, which is not described herein again.
Corresponding to the above method embodiment, the present invention further provides a computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the steps of:
receiving a service processing request, and analyzing the service processing request to obtain a node selection rule of a service to be processed corresponding to the service processing request; calculating the corresponding target main node number and the target backup node number according to the node selection rule; calling a node management array through an operating state machine to judge whether the number of the target main node and the number of the target backup node are both valid; each array bit of the node management array stores a preset node number or an invalid value for marking the running state of each node in the storage cluster; if yes, selecting a target main node corresponding to the target main node number and a target backup node corresponding to the target backup node number from the storage cluster; and processing the service to be processed by utilizing the target main node and the target backup node.
The computer-readable storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
For the introduction of the computer-readable storage medium provided by the present invention, please refer to the above method embodiments, which are not described herein again.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device, the apparatus and the computer-readable storage medium disclosed in the embodiments correspond to the method disclosed in the embodiments, so that the description is simple, and the relevant points can be referred to the description of the method.
The principle and the implementation of the present invention are explained in the present application by using specific examples, and the above description of the embodiments is only used to help understanding the technical solution and the core idea of the present invention. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (10)

1. A service processing method for a storage cluster is characterized by comprising the following steps:
receiving a service processing request, and analyzing the service processing request to obtain a node selection rule of a service to be processed corresponding to the service processing request;
calculating the corresponding target main node number and the target backup node number according to the node selection rule;
calling a node management array through an operating state machine to judge whether the target main node number and the target backup node number are both valid; each array bit of the node management array stores a preset node number or an invalid value for marking the running state of each node in the storage cluster;
if so, selecting a target main node corresponding to the target main node number and a target backup node corresponding to the target backup node number from the storage cluster, and performing processing operation on the service to be processed by using the target main node and the target backup node;
if not, carrying out node selection rule adjustment prompting operation.
2. The traffic processing method of the storage cluster according to claim 1, further comprising:
and when a node joining event or a node quitting event is detected, suspending the processing operation of the service to be processed.
3. The traffic processing method of the storage cluster according to claim 2, further comprising, after suspending the processing operation on the traffic to be processed:
and according to the node adding event or the node quitting event which occurs currently, carrying out validity updating operation on the preset node number of the corresponding array position in the node management array.
4. The service processing method of the storage cluster according to any one of claims 1 to 3, wherein calculating the corresponding target primary node number and target backup node number according to the node selection rule comprises:
determining a target array position of the target main node in the node management array according to the node selection rule; the storage cluster is composed of a plurality of storage devices including a main node and a backup node;
calculating the number of the target main node by combining the target digit group and the node number calculation formula:
the array bit is the storage device number 2+ node number;
the target main node number comprises a storage device number of a target storage device where the main node is located and a node number of a corresponding node;
and determining the number of another node except the number of the target main node in the number of the storage device corresponding to the number of the target main node as the number of the target backup node.
5. A traffic processing apparatus of a storage cluster, comprising:
the node selection rule obtaining module is used for receiving a service processing request and analyzing the service processing request to obtain a node selection rule of a service to be processed corresponding to the service processing request;
the node number calculation module is used for calculating the corresponding target main node number and the target backup node number according to the node selection rule;
the number validity judging module is used for calling the node management array through the running state machine to judge whether the target main node number and the target backup node number are both valid; each array bit of the node management array stores a preset node number or an invalid value for marking the running state of each node in the storage cluster;
the service processing module is used for selecting a target main node corresponding to the target main node number and a target backup node corresponding to the target backup node number from a storage cluster when the target main node number and the target backup node number are determined to be both valid, and processing the service to be processed by using the target main node and the target backup node;
and the rule adjustment prompting module is used for carrying out node selection rule adjustment prompting operation when determining that an invalid number exists in the target main node number and the target backup node number.
6. The traffic processing apparatus of a storage cluster according to claim 5, further comprising:
and the service processing suspension module is used for suspending the processing operation of the service to be processed when a node joining event or a node quitting event is detected.
7. The traffic processing apparatus of a storage cluster according to claim 6, further comprising:
and the number validity updating module is used for carrying out validity updating operation on the preset node numbers of the corresponding array bits in the node management array according to the currently occurring node adding event or the node quitting event after the processing operation on the service to be processed is suspended.
8. The traffic processing apparatus of a storage cluster according to any one of claims 5 to 7, wherein the node number calculation module comprises:
the array is a determining submodule and is used for determining a target array position of the target main node in the node management array according to the node selection rule; the storage cluster is composed of a plurality of storage devices including a main node and a backup node;
the main node number calculation submodule is used for calculating the target main node number by combining the target digit group position and the node number calculation formula:
the array bit is the storage device number 2+ node number;
the target main node number comprises a storage device number of a target storage device where the main node is located and a node number of a corresponding node;
and the backup node number determining submodule is used for determining the number of another node except the target main node number in the storage equipment number corresponding to the target main node number as the target backup node number.
9. A traffic processing device of a storage cluster, comprising:
a memory for storing a computer program;
processor for implementing the steps of the traffic processing method of a storage cluster according to any of claims 1 to 4 when executing said computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the traffic processing method of a storage cluster according to any one of claims 1 to 4.
CN201910996178.9A 2019-10-18 2019-10-18 Storage cluster service processing method, device, equipment and readable storage medium Active CN110750219B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910996178.9A CN110750219B (en) 2019-10-18 2019-10-18 Storage cluster service processing method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910996178.9A CN110750219B (en) 2019-10-18 2019-10-18 Storage cluster service processing method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN110750219A CN110750219A (en) 2020-02-04
CN110750219B true CN110750219B (en) 2022-08-12

Family

ID=69278926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910996178.9A Active CN110750219B (en) 2019-10-18 2019-10-18 Storage cluster service processing method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN110750219B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111526038B (en) * 2020-03-26 2023-01-20 口碑(上海)信息技术有限公司 Service request distribution method and device, computer equipment and readable storage medium
CN112839084B (en) * 2021-01-04 2022-06-07 浙江诺诺网络科技有限公司 Service processing method, device, equipment and computer readable storage medium
CN112860203B (en) * 2021-02-08 2024-06-14 维沃移动通信有限公司 Display method and device of shared picture and electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109491609B (en) * 2018-11-02 2022-04-22 郑州云海信息技术有限公司 Cache data processing method, device and equipment and readable storage medium
CN109831507B (en) * 2019-02-14 2022-05-13 上海联寓智能科技有限公司 Internet of things system, load balancing method and storage medium

Also Published As

Publication number Publication date
CN110750219A (en) 2020-02-04

Similar Documents

Publication Publication Date Title
CN110750219B (en) Storage cluster service processing method, device, equipment and readable storage medium
CN109002259B (en) Hard disk allocation method, system, device and storage medium of homing group
US10846186B2 (en) Central processing unit CPU hot-remove method and apparatus, and central processing unit CPU hot-add method and apparatus
CN109102273B (en) Method and system for realizing distributed intelligent payment routing
CN107508694B (en) Node management method and node equipment in cluster
CN107682211B (en) Network topology structure determination method and device and computer readable storage medium
EP2723017A1 (en) Method, apparatus and system for implementing distributed auto-incrementing counting
CN105187255B (en) Failure analysis methods, fail analysis device and server
CN108306760A (en) For making the self-healing method and apparatus of managerial ability in a distributed system
CN112130758B (en) Data reading request processing method and system, electronic equipment and storage medium
CN110912972A (en) Service processing method, system, electronic equipment and readable storage medium
CN111459399A (en) Data writing method, data reading method and device
CN110995805B (en) Method, device and equipment for determining cluster network card and readable storage medium
CN113126925B (en) Member list determining method, device and equipment and readable storage medium
CN110740064A (en) Distributed cluster node fault processing method, device, equipment and storage medium
CN101714064A (en) Data access method and server
CN107154960B (en) Method and apparatus for determining service availability information for distributed storage systems
CN107248952B (en) Method and system for determining service alternative route
CN111817892B (en) Network management method, system, electronic equipment and storage medium
CN115129515A (en) System data storage method, device, equipment and storage medium
CN104135380A (en) Method and device of risk analysis of hierarchical network
CN109151016B (en) Flow forwarding method and device, service system, computing device and storage medium
CN110413686B (en) Data writing method, device, equipment and storage medium
CN112527557A (en) Data recovery method, device and equipment and computer readable storage medium
CN103297926A (en) Cluster paging method in private network and base station

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