CN111274022A - Server resource allocation method and system - Google Patents

Server resource allocation method and system Download PDF

Info

Publication number
CN111274022A
CN111274022A CN201811479375.5A CN201811479375A CN111274022A CN 111274022 A CN111274022 A CN 111274022A CN 201811479375 A CN201811479375 A CN 201811479375A CN 111274022 A CN111274022 A CN 111274022A
Authority
CN
China
Prior art keywords
server
resource
node
client
resources
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811479375.5A
Other languages
Chinese (zh)
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.)
Beijing New Cloud Oriental System Technology Co ltd
Beijing Teamsun Technology Co ltd
Original Assignee
Beijing New Cloud Oriental System Technology Co ltd
Beijing Teamsun 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 Beijing New Cloud Oriental System Technology Co ltd, Beijing Teamsun Technology Co ltd filed Critical Beijing New Cloud Oriental System Technology Co ltd
Priority to CN201811479375.5A priority Critical patent/CN111274022A/en
Publication of CN111274022A publication Critical patent/CN111274022A/en
Pending legal-status Critical Current

Links

Images

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

Abstract

The invention discloses a server resource allocation method and a system. The method comprises the following steps: the method comprises the steps that when a management node receives a resource allocation request sent by a client, first resource information of a client request resource is obtained; the management node acquires server resources conforming to the first resource information from free resources in a resource pool, and determines server nodes to which sub-server resources forming the server resources belong, wherein the server resources are formed by at least one sub-server resource; and the management node returns the second resource information of the sub server resources and the node information of the server node to the client, and sends the second resource information and the client information of the client to the corresponding server node so as to allocate the server resources to the client for use. By adopting the technical scheme, the embodiment of the invention can improve the performance of the server, reduce the cost and realize the old utilization of the server.

Description

Server resource allocation method and system
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a server resource allocation method and system.
Background
In recent years, as the functions provided by each client increase, the demand of the client for server resources is increasing. When the demand of the client for the server resources exceeds the server resources that can be provided by the server, the client may fail to obtain the corresponding service or the service obtaining speed is slow, which seriously affects the user experience.
At present, when the existing server resources cannot meet the requirements of users, a service provider generally chooses to purchase a server with higher configuration to replace the existing server to provide services for clients so as to meet the requirements of the clients on the server resources. However, purchasing a server with a higher configuration is often costly and requires a lot of money, and eliminating an existing server also results in waste of resources.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and a system for allocating server resources to improve performance of a server, reduce cost, and achieve server utilization.
In a first aspect, an embodiment of the present invention provides a server resource allocation method, including:
the method comprises the steps that when a management node receives a resource allocation request sent by a client, first resource information of a client request resource is obtained;
the management node acquires server resources conforming to the first resource information from free resources in a resource pool, and determines server nodes to which sub-server resources forming the server resources belong, wherein the server resources are formed by at least one sub-server resource;
and the management node returns the second resource information of the sub server resources and the node information of the server node to the client, and sends the second resource information and the client information of the client to the corresponding server node so as to allocate the server resources to the client for use.
In a second aspect, an embodiment of the present invention further provides a server resource allocation system, including a management node,
the management node is used for acquiring first resource information of a resource requested by a client when receiving a resource allocation request sent by the client;
the management node is used for acquiring the server resource which is consistent with the first resource information from the free resource of the resource pool, and determining the server node to which the sub-server resource forming the server resource belongs, wherein the server resource is formed by at least one sub-server resource;
the management node is further configured to return second resource information of the sub-server resource and node information of the server node to the client, and send the second resource information and the client information of the client to a corresponding server node, so as to allocate the server resource to the client for use.
According to the server resource allocation method and system provided by the embodiment of the invention, when a management node receives a resource allocation request sent by a client, first resource information of a resource requested by the client is obtained, a server resource conforming to the first resource information is obtained from an idle resource in a resource pool, a server node to which a sub-server resource constituting the server resource belongs is determined, second resource information of the sub-server resource and node information of the server node are returned to the client, and the second resource information and the client information of the client are sent to the server node corresponding to the second resource information, so that the selected server resource is allocated to the client for use. By adopting the technical scheme, the embodiment of the invention can improve the performance of the server, reduce the cost and realize the old utilization of the server.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
fig. 1 is a flowchart illustrating a method for allocating server resources according to an embodiment of the present invention;
fig. 2A is a schematic diagram of a resource pool creation interface according to an embodiment of the present invention;
fig. 2B is a schematic diagram of a resource pool name input interface according to an embodiment of the present invention;
fig. 2C is a schematic diagram of an HMC adding window according to an embodiment of the present invention;
fig. 2D is a schematic diagram of a display interface after completion of creation of a resource pool according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a server resource allocation method according to a second embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for allocating server resources according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of a server resource allocation system according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings.
Example one
The embodiment of the invention provides a server resource allocation method. The method is suitable for the condition of allocating the server resources for the client and can be executed by a server resource allocation system. Fig. 1 is a schematic flowchart of a server resource allocation method according to an embodiment of the present invention, and as shown in fig. 1, the method includes:
s110, when receiving a resource allocation request sent by a client, a management node acquires first resource information of a resource requested by the client.
In this step, the resource may be a processing resource and/or a storage resource. The Processing resource may be understood as a server resource required by the client to process data through the server, that is, a resource required by the server to process data for the client, and generally includes a Central Processing Unit (CPU) and an operating memory; the storage resource may be understood as a server resource required by the client to store data, that is, a resource occupied by the server to store data for the client. At this time, the first resource information of the resource requested by the client may include the type and size of the resource, that is, the number of CPUs required by the client, the size of the required operating memory, and/or the size of the required storage resource, such as 2 CPUs, 4G operating memory, and/or 20G storage space. In this embodiment, the management node may allocate processing resources to the client, and may also allocate storage resources to the client, and a process in which the management node allocates processing resources to the client is described as an example below.
In this embodiment, the first resource information of the resource requested by the client may be obtained locally from the server, or may be obtained from the resource allocation request. Specifically, if the resource allocation request includes first resource information of a resource requested by the client, the management node may directly analyze the received resource allocation request to obtain the first resource information, and correspondingly, when the resource allocation request is generated, the client may carry the first resource information of the requested resource and the client identifier in the resource allocation request and send the resource allocation request to the manager node; if the resource allocation request does not include the first resource information of the resource requested by the client, the management node may query the locally stored resource allocation table according to the client information carried in the resource allocation request, such as the client type information, the client identifier, and/or the service information of the service that the client needs to process, and determine the client or the first resource information needed for processing the service.
S120, the management node acquires the server resource corresponding to the first resource information from the free resource of the resource pool, and determines the server node to which the sub-server resource forming the server resource belongs, wherein the server resource is formed by at least one sub-server resource.
In this embodiment, the server resource corresponding to the first resource information is a server resource corresponding to both the type and the size of the resource in the first resource information, for example, if the first resource information is 2 CPUs and 4G operating memories, then 2 CPUs and 4G operating memories are respectively obtained from the idle resources in the resource pool as the server resource of the client that sends the resource allocation request.
Specifically, the management node may obtain, according to a set obtaining rule, a server resource that matches the first resource information from the free resource in the resource pool. The acquisition rule may be set as needed, for example, may be randomly acquired; according to the sequence that the server nodes share the resource pool and unoccupied optional resources are from large to small, selecting a set number (such as one or more) of server nodes as nodes to be selected, and selecting sub-server resources allocated to the client from the nodes to be selected according to a certain rule, such as the proportion of the optional resources of the nodes to be selected, so as to form server resources; or, the server nodes are sequenced according to the sequence of selectable resources from large to small, if the selectable resource of the first server node can meet the requirement of the client, namely the selectable resource is smaller than the request resource of the client, the server resource corresponding to the first resource information is selected from the selectable resource of the first server, if the selectable resource of the first server node can not meet the requirement of the client, all the selectable resources of the first server are selected as the first sub-server resource forming the server resource, the first difference value between the request resource of the client and the sub-server resource is calculated, whether the selectable resource of the second server node is larger than or equal to the first difference value is judged, if so, the resource corresponding to the first difference value is obtained from the selectable resource of the second server node as the second sub-server resource forming the server resource, otherwise, all selectable resources of the second server are selected as second sub-server resources forming the server resources, the first difference value and the second difference value of the sub-server resources are calculated, and the like, until all sub-server resources forming the server resources are obtained, and therefore the server resources corresponding to the first resource information can be obtained.
In this step, after obtaining the server resource corresponding to the first resource information, the server node to which each sub-server resource constituting the server resource belongs may be further determined, so as to allocate each sub-server to the client for use. The server node to which each child server resource belongs may be obtained from a shared information list stored locally by the management node. Correspondingly, after each server node shares a resource to a resource pool, the management node may record shared resource information shared by each server node to the resource pool, for example, set a resource identifier for representing an identity of a shared resource shared by each server node to the resource pool, and correspondingly record a corresponding relationship between the resource identifier of each shared resource and a node identifier of a server node to which the resource identifier belongs, so as to form a shared information list. The shared resource information shared by each server node to the resource pool can be actively acquired by the management node, and can also be reported to the management node by each server node.
For example, after the management node establishes network connection with the server nodes, each server node is controlled or actively controlled to share part of its own resources into the resource pool according to a set rule based on a worker operation, or after each server node establishes connection with the management node, each server node shares part of its own resources into the resource pool based on a worker operation or according to a set rule, so as to provide server resources for each client. The network connection between each server node and the management node may be established based on ethernet, and the network is preferably an internal network to which the management node is connected, that is, the connection between each server node and the management node is preferably established through the internal network. At this time, after the server node joins the internal network, the server node may receive the IP address issued by the management node as the IP address of the server node itself in the internal network, or may actively request the management node to allocate an IP address used by the internal network to the server node; correspondingly, the management node may periodically detect whether a newly added server node exists in the internal network, and when detecting that the newly added server node exists, allocate an IP address to the newly added server node according to a set rule, or may, when receiving an IP address allocation request sent by a certain server node, allocate an IP address to the server node sending the IP address allocation request according to a set rule. The setting rule may be, for example, to randomly select an unallocated IP address in the address field of the internal network, and select an IP address adjacent to and unallocated from the IP address allocated last time in the order from large to small or from small to large from the IP addresses in the address field of the internal network, and the like, which is not limited in this embodiment.
Aiming at the situation that the management node actively controls each server node to share the resources, illustratively, the management node can obtain version information of an operating system installed on the server node and total resource information of the server node, determine non-sharable resources which need to be reserved by the management node and are used for maintaining normal startup and operation of the management node according to the version information, calculate a difference value between the total resources of the server node and the non-sharable resources to obtain shared resources which can be shared by the server to a resource pool, send a mobile processor code used for sharing a CPU in the shared resources to the resource pool to the server node and receive first response information returned by the server node, send a mobile memory code used for sharing an operating memory in the shared resources to the resource pool to the server node and receive second response information returned by the server node, to share the shared resources of the server nodes into the resource pool. The mobile processor code and the mobile memory code may be obtained by performing different operations based on an identity of the server node (e.g., a serial number of a server node host), for example, a first encryption operation may be performed on the serial number of the server node host to obtain the mobile processor code, and a second encryption operation may be performed on the serial number of the server node host to obtain the mobile memory code. The serial number of the server node host may be obtained from a configuration file of the server node, and the configuration file of the server node may be obtained from a corresponding site storing the host configuration file, such as a Capacity on Demand (CoD) Web site.
For the situation that the management node controls each server node to share the resource based on the user operation, for example, the management node may obtain version information of an operating system installed in the server node and total resource information of the server node, display the version information to a worker through a display screen, obtain shared resource information in the resource pool shared by the management node input by the worker, send a mobile processor code for sharing a CPU in the shared resource to the resource pool to the server node and receive first response information returned by the server node according to the shared resource information, send a mobile memory code for sharing an operating memory in the shared resource to the resource pool to the server node and receive second response information returned by the server node, so as to share the shared resource of the server node to the resource pool.
For the situation that the server node shares the resource to the resource pool, the server node may determine the non-sharable resource according to the version information of the operating system installed in the server node, further determine the sharable resource, and share the sharable resource to the resource pool.
It should be noted that, regardless of the sharing method, at least an unshared resource for maintaining normal startup and operation of the server node should be reserved in the server node, and the unshared resource cannot be shared in the resource pool to provide services for the client. Generally, the number of CPUs that can not be shared by the server node can be determined according to the version information of the operating system according to which the server node is based, for example, if the operating system is power870 or power880, at least 8 CPUs can not be shared in the resource pool, if the operating system is power770 or power780, at least 4 CPUs can not be shared in the resource pool, and if the operating system is power795, at least 24 CPUs can not be shared in the resource pool; the amount of operating memory that the server node cannot share should be no less than 25% of its total operating memory. In addition, if a plurality of virtual partitions exist in the server node, each partition can be used as a virtual server node, and each virtual server node preferably meets the requirement for the non-sharable resources of each server node, so that each virtual server node can be started and operated normally. Further, if a service that needs to be executed at the local end exists in a certain server node or virtual server node, the non-sharable resource of the server node or virtual server node may be further increased according to the requirement of the service on processing resources (CPU and operating memory).
In this step, the resource pool may be understood as a container for holding shared resources of each server resource, which may be created by a worker. For example, the process of the management node creating the resource pool based on the operation of the staff member may be: the management node displays a resource pool creation interface (as shown in fig. 2A) to the staff, and detects whether the staff triggers a "create pool" button in the interface according to a set period; if the 'create pool' button is detected to be triggered, displaying a resource pool name input interface (shown in FIG. 2B) to the staff for the staff to input the name of the resource pool in an input box of the resource pool name input interface; after detecting that the resource pool name is input completely, showing an addition interface of a resource pool Hardware Management Console (HMC) to a worker, and after the worker clicks an 'add HMC' button in the HMC addition interface, popping up an HMC addition window (as shown in FIG. 2C) so that the worker can input the Host name or IP address of equipment (namely a management node) for operating the console and a user identifier (such as the Host name of the management node) in the window; after the addition of the HMC is completed, each server node can send a membership code to the HMC, the HMC receives the membership code sent by each server node, the validity of the membership code is determined, the node information of the server node with the legal membership code is recorded, and response information is returned to the node information so as to register the server node with the legal membership code in the server resource distribution system; after the registration is completed, the management node may add the shared resources of each server node to form a resource pool or form a resource pool based on the operation of the user, and a display interface after the resource pool is created is shown in fig. 2D. The membership code may be obtained by performing an operation based on an identity of the server node (e.g., a serial number of the server node host), for example, a third encryption operation may be performed on the serial number of the server node host to obtain the membership code.
In order to ensure compatibility between each server node and the management node, preferably, before controlling each server node to share the resource, or before each server node shares the resource into the resource pool, the management node may further obtain version information of the operating system installed in each server node, and determine whether the version of the operating system is compatible with the management node or other server nodes, that is, determine whether the operating system installed in each server node belongs to a set compatible operating system, and if so, execute subsequent operations; if not, controlling the incompatible server node to install the compatible operating system, or informing a worker to replace the operating system of the incompatible server node.
S130, the management node returns the second resource information of the sub server resources and the node information of the server node to the client, and sends the second resource information and the client information of the client to the corresponding server node so as to allocate the server resources to the client for use.
The corresponding server node is a server node to which the sub-service resource corresponding to the second resource information belongs, and the second resource information of the sub-server resource may include type information and size information of the sub-server resource, such as 2 CPUs and/or 2G operating memories, and the like.
For example, the server may send the second resource information of each sub-server resource and node information of the server node, such as a node identifier and/or an IP address of the server node to which the sub-server resource belongs, to the client, so that the client may query the IP address of the server node according to the node identifier or receive the IP address of the server node, and communicate with the server node according to the IP address of the server node, thereby processing data using the sub-server resource of the server node; the server may further send the second resource information of each sub-server resource and the client information (such as the client identifier) of the client to the server node to which the sub-server resource belongs, so as to notify each server node that its sub-server resource is allocated to the client for use, so that each server node may use the corresponding sub-server resource to process data for the client. The IP address of the server node is preferably an IP address of the server node in an internal network formed by the server nodes and the management node.
Preferably, after obtaining the server resource corresponding to the first resource information, the management node may mark the obtained server resource as an occupied state, so as to avoid a situation that the server resource is simultaneously allocated to a plurality of clients for use. The manner of marking the server resource as the occupied state may be set as required, for example, an occupied identifier may be added to the server resource, resource information of the server resource is added to an occupied resource list, resource information of the server resource is moved out of an idle resource list, an identifier of the server resource in a resource allocation table is changed, and the like, which is not limited herein.
In the server resource allocation method provided by the embodiment of the present invention, when receiving a resource allocation request sent by a client, a management node acquires first resource information of a resource requested by the client, acquires a server resource corresponding to the first resource information from an idle resource in a resource pool, determines a server node to which a sub-server resource constituting the server resource belongs, returns second resource information of the sub-server resource and node information of the server node to the client, and sends the second resource information and the client information of the client to the server node corresponding to the second resource information, thereby allocating the selected server resource to the client for use. By adopting the technical scheme, the embodiment of the invention can improve the performance of the server, reduce the cost and realize the old utilization of the server.
Example two
Fig. 3 is a flowchart illustrating a method for allocating server resources according to a second embodiment of the present invention. The embodiment is optimized on the basis of the above embodiment, and further, the method further includes; and the server node processes data by adopting the sub-server resources distributed to the client by the server node according to the data processing request sent by the client.
Further, before the management node acquires the server resource corresponding to the resource information from the free resource in the resource pool, the method further includes: the management node determines that the free resources in the resource pool are greater than or equal to the requested resources.
Further, the method further comprises: and if the idle resources in the resource pool are smaller than the request resources, acquiring occupied resources corresponding to the difference from a set number of server nodes with the lowest resource utilization rate according to the difference between the request resources and the idle resources and the resource utilization rate sequence of the occupied resources of each server node in the system, and allocating the occupied resources and the idle resources to the client for use.
Correspondingly, as shown in fig. 3, the server resource allocation method provided in this embodiment includes:
s210, when receiving a resource allocation request sent by a client, a management node acquires first resource information of a resource requested by the client.
S220, the management node judges whether the free resources in the resource pool are larger than or equal to the request resources, if so, the S230 is executed; if not, go to S250.
In this embodiment, the management node may first determine the resource size of each type of resource in the idle resource, and then determine whether the idle resource is greater than or equal to the requested resource according to the resource size and the first resource information. It should be noted that, here, it is determined whether the idle resource is greater than or equal to the request resource, and it is determined whether the idle resource of the type is greater than or equal to the request resource of the type for each type of resource, and when the idle resource of the type is greater than or equal to the request resource of the type, S230 is performed on the type of resource, and when the idle resource of the type is less than the request resource of the type, S260 is performed on the type of resource. That is, when the requested resource only includes a type of resource, determining whether the type of idle resource is greater than or equal to the requested resource, for example, when the requested resource is a CPU, determining whether the number of idle CPUs is greater than or equal to the number of CPUs requested by the client, and when the requested resource is an operating memory, determining whether the size of the idle operating memory is greater than or equal to the size of the operating memory requested by the client; when the request resource includes multiple types of resources, each type of resource is compared, and S230 or S250 is performed for each type of resource according to the comparison result of each type.
S230, the management node acquires the server resource corresponding to the first resource information from the free resource of the resource pool, and determines the server node to which the sub-server resource forming the server resource belongs, wherein the server resource is formed by at least one sub-server resource.
S240, the management node returns the second resource information of the sub server resource and the node information of the server node to the client, and sends the second resource information and the client information of the client to the corresponding server node, so as to allocate the server resource to the client for use, and S260 is executed.
And S250, the management node acquires occupied resources corresponding to the difference from a set number of server nodes with the lowest resource utilization rate according to the difference between the request resources and the idle resources and the resource utilization rate sequence of occupied resources of each server node in the system, and allocates the occupied resources and the idle resources to the client for use.
In this step, the set number may be one or more, and when the set number is one, the occupied resource corresponding to the difference value may be acquired from the server node with the lowest resource utilization rate; when the number is set to be multiple, taking 3 as an example, three server nodes with the lowest resource utilization rate can be obtained, and occupied resources with corresponding sizes are selected from the three server nodes to form occupied resources which are consistent with the difference value randomly, equally or according to the reciprocal of the resource utilization rate ratio of the three server nodes. The resource utilization rate of the occupied resources of each server node can be obtained by monitoring through corresponding monitoring software; the selected occupied resource can be obtained by acquiring a part of resources from one or more sub-server resources which are allocated to the client for use.
In order to further improve the convenience when allocating resources to the client, and avoid the occurrence of a situation that the server resources allocated to other clients for use need to be allocated to the client for use only when the free resources in the resource pool are smaller than the request resources of the client, the present embodiment may permanently convert the shared resources shared by each server node in the resource pool into shared resources, for example, permanently convert the processor shared by each server node in the resource pool into a mobile processor, and permanently convert the operating memory shared by each server node in the resource pool into a mobile operating memory, so that the management node may directly change the client to which the occupied resources are allocated in the data processing process.
At this time, the management node may send the persistent mobile processor translation code and the persistent mobile memory translation code to each server node, and receive response information returned by each server node, so as to permanently convert the processor shared by each server node to the resource pool into the mobile processor, and permanently convert the operating memory shared by each server node to the resource pool into the mobile operating memory. The persistent mobile processor translation code and the persistent mobile memory translation code may be obtained by performing different operations based on an identity (e.g., a serial number of a server node host) of each server, for example, a fourth encryption operation may be performed on the serial number of the server node host to obtain the persistent mobile processor translation code, and a fifth encryption operation may be performed on the serial number of the server node host to obtain the persistent mobile memory translation code.
And S260, the server node processes data by adopting the sub-server resources distributed to the client by the server node according to the data processing request sent by the client.
For example, the client may send a data processing request to the server node according to the IP address of the server node; correspondingly, the server node may determine, according to a client identifier carried in a data processing request sent by the client, a sub-server resource allocated by the local terminal to the client for use, and process data based on the data processing request by using the sub-server resource.
In the server resource allocation method provided in the second embodiment of the present invention, when receiving a resource allocation request sent by a client, a management node obtains first resource information of a resource requested by the client, and determines whether an idle resource in a resource pool is greater than or equal to the requested resource of the client, if so, obtains a server resource corresponding to the first resource information from the idle resource and allocates the server resource to the client; if not, acquiring occupied resources allocated to other clients for use, and forming server resources which are consistent with the first resource information with free resources in the resource pool, and allocating the server resources to the clients for use. By adopting the technical scheme, the occupied resources can be reallocated without re-interrupting the data processing process, the steps and the consumed time for allocating the resources can be reduced, and the waiting time of the client side is reduced.
EXAMPLE III
Fig. 4 is a flowchart illustrating a server resource allocation method according to a third embodiment of the present invention. The present embodiment is optimized on the basis of the above embodiment, and further, the method further includes: monitoring the data processing state of the server node by a standby node corresponding to the server node in the process of processing data by the server node; when monitoring that the data processing state is an abnormal state, the standby node is started, third resource information of the server node is obtained from a starting and stopping script file of the standby node, corresponding standby resources in the standby node are shared to a resource pool according to the third resource information, and the shared resources of the service node are replaced by the standby resources, wherein the third resource information is resource information of shared resources added to the resource pool by the server node.
Further, the method further comprises: and the standby node acquires the data processing process information of the server node and continues to process data according to the data processing process information.
Correspondingly, as shown in fig. 4, the server resource allocation method provided in this embodiment includes:
s310, when receiving a resource allocation request sent by a client, a management node acquires first resource information of a resource requested by the client.
S320, the management node acquires the server resource corresponding to the first resource information from the free resource of the resource pool, and determines the server node to which the sub server resource forming the server resource belongs, wherein the server resource is formed by at least one sub server resource.
S330, the management node returns the second resource information of the sub server resources and the node information of the server node to the client, and sends the second resource information and the client information of the client to the corresponding server node so as to allocate the server resources to the client for use.
S340, the server node processes data by adopting sub server resources distributed to the client by the server node according to the data processing request sent by the client.
S350, monitoring the data processing state of the server node by the standby node corresponding to the server node in the data processing process of the server node.
In this embodiment, the method for monitoring the data processing state of the server node may be selected as needed, and if it is monitored that the server node is online through the heartbeat packet, if so, it is determined that the data processing state of the server node is a normal state, and if not, it is determined that the data state is an abnormal state; it may also monitor whether the server node has a condition that the data delay is high (for example, the data delay is greater than or equal to the set time threshold), if so, determine that the data processing state of the server node is an abnormal state, otherwise, determine that the data processing state of the server node is a normal state, and so on, which is not limited in this embodiment.
S360, when monitoring that the data processing state is an abnormal state, the standby node is started, third resource information of the server node is obtained from a starting and stopping script file of the standby node, corresponding standby resources in the standby node are shared to a resource pool according to the third resource information, so that the shared resources of the service node are replaced by the standby resources, and the third resource information is resource information of shared resources added to the resource pool by the server node.
Specifically, in the process of monitoring the data processing state of the server node, the standby node may be in a standby state; and when the data processing state of the server node is monitored to be an abnormal state, the standby node calls the start and stop script file to convert the standby state into the start state, reads the third resource information in the start and stop script file, and shares the standby resource corresponding to the third resource information into the resource pool. The third resource information at least includes resource types and resource sizes of shared resources shared by the server node to the resource pool, such as 20 CPUs and/or 20G operating memories. The third resource information may be added to the starting position of the standby node and the setting position of the script file in advance by a worker, the management node, or the standby node itself.
In view of the time taken to add the third resource information, it is preferable that the third resource information of the standby node corresponding to the server node be added to the startup and script file of the standby node by the management node or the standby node. When the third resource information is added by the standby node, preferably, the server resource allocation method provided in this embodiment further includes: and the standby node acquires the third resource information of the server node corresponding to the standby node according to the corresponding relation between the standby node and each server node, and adds the third resource information to the start and stop script file of the standby node.
The corresponding relation between the standby node and each server is the corresponding/non-corresponding relation between the server node and each server node, and here, if the standby node corresponds to a certain server node, the standby node can be used as the standby node of the server node, and when the data processing state of the server node is an abnormal state, the server node is replaced to provide service for the client; if the standby node does not correspond to a certain server node, the other node is not the standby node of the server node. The correspondence between the standby node and each server node may be stored locally at the standby node in advance (e.g., when the server resource allocation system is built). The number of the server nodes corresponding to the standby nodes may be one or more, that is, a certain standby node may be a standby node of one or more server nodes, and at this time, the start and stop script file of the standby node stores the third resource information of each corresponding server node.
S370, the standby node acquires the data processing process information of the server node and continues to process data according to the data processing process information.
In this embodiment, the standby node may obtain data processing process information that is sent by the server node for the last time, and determine whether data processing is completed according to the data processing process information, and if so, do not perform subsequent operations; if not, continuing to process the data on the basis of the data processing process corresponding to the data processing process information.
Wherein, the data processing process information of the server node can be acquired from the management node or locally. Correspondingly, the management node/standby node can acquire the data processing process information of the server node according to a set period in the process of processing data by the server node, or receive the data processing process information synchronized to the local terminal by the server node; the server node may return the data processing process information of the local end to the management node/the standby node when the management node/the standby node acquires the data processing process information, or periodically synchronize the data processing information of the local end to the management node/the standby node in the data processing process.
Considering the timeliness of converting an abnormal server node into a standby node when the server node is abnormal, preferably, the server node may synchronize the data processing progress information to the standby node corresponding to the server node in the process of processing data, so as to reduce the amount of calculation required when replacing the server node with the standby node.
In the server resource allocation method provided by the third embodiment of the present invention, the third resource information of the shared resources of the server nodes is written into the start and stop script files of the standby nodes, when the server nodes are abnormal, the standby nodes corresponding to the abnormal server nodes read the start and stop script files, and actively share the standby resources corresponding to the shared resources of the server nodes into the resource pool, so as to process data for the client instead of the server nodes, thereby improving the replacement rate of the shared resources, reducing the interruption time in the data processing process, and improving the response rate of the client.
On the basis of the foregoing embodiment, the server resource allocation method may further include: and the management node sends a resource replacement message to the client to indicate the client to replace the sub-server resource processing data of the server node with the standby resource of the standby node. The resource replacement message may carry client information of the client, an IP address of the standby node, sub-standby resource information allocated by the standby node to the client, and a node identifier of the server node replaced by the standby node. Correspondingly, after receiving the resource replacement message sent by the management node, the client can record the IP address and the sub-standby resource information of the standby node carried in the resource replacement message, delete the node information of the server node replaced by the standby node recorded at the local end or mark the node information of the server node as abnormal, and send a data processing request to the standby node when the server node is required to process data subsequently.
It should be noted that, although this embodiment is described by taking an example of sending a resource replacement message to a client by a management node, the embodiment of the present invention may also send a resource replacement message to a client by a standby node, or neither the management node nor the standby node sends a resource replacement message to the client, and the client monitors whether a data processing state of a server node is an abnormal state, and when it is monitored that the data processing state of the server node is the abnormal state, actively establishes a communication connection with the standby node of the server node, and sends a data processing request to the standby node, and so on, which is not limited in this embodiment of the present invention.
Example four
The fourth embodiment of the invention provides a server resource allocation system. The system can allocate server resources to clients by performing a server resource allocation method. Fig. 5 is a schematic structural diagram of a server resource allocation system according to a fourth embodiment of the present invention, as shown in fig. 5, the system includes a management node 10 and at least two server nodes 20, wherein,
the management node 10 is configured to, when receiving a resource allocation request sent by a client, obtain first resource information of a resource requested by the client 20;
the management node 10 is configured to obtain a server resource corresponding to the first resource information from an idle resource of a resource pool, and determine a server node 20 to which a sub-server resource constituting the server resource belongs, where the server resource is composed of at least one sub-server resource;
the management node 10 is further configured to return second resource information of the sub-server resource and node information of the server node 20 to the client, and send the second resource information and the client information of the client to the corresponding server node 20, so as to allocate the server resource to the client for use.
In the server resource allocation system provided in the fourth embodiment of the present invention, when receiving a resource allocation request sent by a client, a management node acquires first resource information of a resource requested by the client, acquires a server resource corresponding to the first resource information from an idle resource in a resource pool, determines a server node to which a sub-server resource constituting the server resource belongs, returns second resource information of the sub-server resource and node information of the server node to the client, and sends the second resource information and the client information of the client to the server node corresponding to the second resource information, thereby allocating the selected server resource to the client for use. By adopting the technical scheme, the embodiment of the invention can improve the performance of the server, reduce the cost and realize the old utilization of the server.
Optionally, the management node 10 is further configured to mark the server resource as an occupied state.
Optionally, the server node 20 is configured to process data by using sub-server resources allocated to the client by the server node according to a data processing request sent by the client.
Optionally, the server resource allocation system may further include: the standby node 30 corresponding to the server node 20 is configured to monitor a data processing state of the server node 20 in a process of processing data by the server node 20; the standby node 30 may be further configured to start the standby node when it is monitored that the data processing state is the abnormal state, obtain third resource information of the server node 20 from the start and stop script file of the standby node, and share a corresponding standby resource in the standby node to a resource pool according to the third resource information, so as to replace the shared resource of the service node with the standby resource, where the third resource information is resource information of a shared resource added to the resource pool by the server node 20.
Optionally, the standby node 30 is further configured to obtain data processing process information of the server node 20, and continue to process data according to the data processing process information.
Optionally, the management node 10 is further configured to send a resource replacement message to the client, so as to instruct the client to replace the sub-server resource of the server node 20 with the standby resource of the standby node 30 to process data.
Optionally, the standby node 30 is further configured to obtain third resource information of the server node 20 corresponding to the standby node according to the corresponding relationship between the standby node and each server node 20, and add the third resource information to the start and stop script file of the standby node.
Optionally, the management node 10 is further configured to determine that the free resources in the resource pool are greater than or equal to the requested resources before obtaining the server resources corresponding to the resource information from the free resources in the resource pool.
Optionally, the management node 10 is further configured to, when an idle resource in the resource pool is smaller than the request resource, obtain, according to a difference between the request resource and the idle resource and a resource utilization ranking of occupied resources of each server node 20 in the system, an occupied resource corresponding to the difference from a set number of server nodes 20 with the lowest resource utilization, and allocate the occupied resource and the idle resource to the client for use.
The server resource allocation system provided by the fourth embodiment of the present invention is capable of executing the server resource allocation method provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution of the server resource allocation method. For details of the server resource allocation method provided in any embodiment of the present invention, reference may be made to the technical details not described in detail in this embodiment.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for allocating server resources, comprising:
the method comprises the steps that when a management node receives a resource allocation request sent by a client, first resource information of a client request resource is obtained;
the management node acquires server resources conforming to the first resource information from free resources in a resource pool, and determines server nodes to which sub-server resources forming the server resources belong, wherein the server resources are formed by at least one sub-server resource;
and the management node returns the second resource information of the sub server resources and the node information of the server node to the client, and sends the second resource information and the client information of the client to the corresponding server node so as to allocate the server resources to the client for use.
2. The method of claim 1, further comprising:
and the management node marks the server resource as an occupied state.
3. The method of claim 1, further comprising:
and the server node processes data by adopting the sub-server resources distributed to the client by the server node according to the data processing request sent by the client.
4. The method of claim 3, further comprising:
monitoring the data processing state of the server node by a standby node corresponding to the server node in the process of processing data by the server node;
when monitoring that the data processing state is an abnormal state, the standby node is started, third resource information of the server node is obtained from a starting and stopping script file of the standby node, corresponding standby resources in the standby node are shared to a resource pool according to the third resource information, and the shared resources of the service node are replaced by the standby resources, wherein the third resource information is resource information of shared resources added to the resource pool by the server node.
5. The method of claim 4, further comprising:
and the standby node acquires the data processing process information of the server node and continues to process data according to the data processing process information.
6. The method of claim 4, further comprising:
and the management node sends a resource replacement message to the client to indicate the client to replace the sub-server resource processing data of the server node with the standby resource of the standby node.
7. The method of claim 4, further comprising:
and the standby node acquires the third resource information of the server node corresponding to the standby node according to the corresponding relation between the standby node and each server node, and adds the third resource information to the start and stop script file of the standby node.
8. The method according to claim 1, before the management node acquires the server resource corresponding to the resource information from the free resource in the resource pool, further comprising:
the management node determines that the free resources in the resource pool are greater than or equal to the requested resources.
9. The method of claim 8, further comprising:
when the idle resources in the resource pool are smaller than the request resources, the management node obtains the occupied resources corresponding to the difference from the set number of server nodes with the lowest resource utilization rate according to the difference between the request resources and the idle resources and the resource utilization rate sequence of the occupied resources of each server node in the system, and allocates the occupied resources and the idle resources to the client for use.
10. A server resource allocation system, comprising a management node and at least two server nodes, wherein,
the management node is used for acquiring first resource information of a resource requested by a client when receiving a resource allocation request sent by the client;
the management node is used for acquiring the server resource which is consistent with the first resource information from the free resource of the resource pool, and determining the server node to which the sub-server resource forming the server resource belongs, wherein the server resource is formed by at least one sub-server resource;
the management node is further configured to return second resource information of the sub-server resource and node information of the server node to the client, and send the second resource information and the client information of the client to a corresponding server node, so as to allocate the server resource to the client for use.
CN201811479375.5A 2018-12-05 2018-12-05 Server resource allocation method and system Pending CN111274022A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811479375.5A CN111274022A (en) 2018-12-05 2018-12-05 Server resource allocation method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811479375.5A CN111274022A (en) 2018-12-05 2018-12-05 Server resource allocation method and system

Publications (1)

Publication Number Publication Date
CN111274022A true CN111274022A (en) 2020-06-12

Family

ID=71001505

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811479375.5A Pending CN111274022A (en) 2018-12-05 2018-12-05 Server resource allocation method and system

Country Status (1)

Country Link
CN (1) CN111274022A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112948089A (en) * 2021-03-22 2021-06-11 福建随行软件有限公司 Resource distribution method and data center for bidding request

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8423821B1 (en) * 2006-12-21 2013-04-16 Maxsp Corporation Virtual recovery server
CN103593242A (en) * 2013-10-15 2014-02-19 北京航空航天大学 Resource sharing control system based on Yarn frame
US20150149637A1 (en) * 2013-11-26 2015-05-28 International Business Machines Corporation Minimizing service restart by optimally resizing service pools
CN104780146A (en) * 2014-01-13 2015-07-15 华为技术有限公司 Resource manage method and device
CN105406980A (en) * 2015-10-19 2016-03-16 浪潮(北京)电子信息产业有限公司 Multi-node backup method and multi-node backup device
WO2017113074A1 (en) * 2015-12-28 2017-07-06 华为技术有限公司 Resource allocation method, device, and system
CN108885554A (en) * 2016-04-07 2018-11-23 国际商业机器公司 Specific dispersion computer system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8423821B1 (en) * 2006-12-21 2013-04-16 Maxsp Corporation Virtual recovery server
CN103593242A (en) * 2013-10-15 2014-02-19 北京航空航天大学 Resource sharing control system based on Yarn frame
US20150149637A1 (en) * 2013-11-26 2015-05-28 International Business Machines Corporation Minimizing service restart by optimally resizing service pools
CN104780146A (en) * 2014-01-13 2015-07-15 华为技术有限公司 Resource manage method and device
CN105406980A (en) * 2015-10-19 2016-03-16 浪潮(北京)电子信息产业有限公司 Multi-node backup method and multi-node backup device
WO2017113074A1 (en) * 2015-12-28 2017-07-06 华为技术有限公司 Resource allocation method, device, and system
CN108885554A (en) * 2016-04-07 2018-11-23 国际商业机器公司 Specific dispersion computer system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112948089A (en) * 2021-03-22 2021-06-11 福建随行软件有限公司 Resource distribution method and data center for bidding request
CN112948089B (en) * 2021-03-22 2024-04-05 福建随行软件有限公司 Resource distribution method and data center for bidding request

Similar Documents

Publication Publication Date Title
CN109040259B (en) CDN node distribution method and system based on MEC
CN106789362B (en) Equipment management method and network management system
CN108810100B (en) Method, device and equipment for electing master node
US8032780B2 (en) Virtualization based high availability cluster system and method for managing failure in virtualization based high availability cluster system
US20170195282A1 (en) Address Processing Method, Related Device, and System
CN110096336B (en) Data monitoring method, device, equipment and medium
CN109379448B (en) File distributed deployment method and device, electronic equipment and storage medium
CN111614748B (en) Apparatus and method for scalable peer-to-peer matching
CN108881512B (en) CTDB virtual IP balance distribution method, device, equipment and medium
CN102497409B (en) A kind of method of cloud computing system resource management
CN109558446B (en) Job request method, job request device, electronic equipment and storage medium
CN110661647A (en) Life cycle management method and device
CN112015544A (en) Load balancing method, device and equipment of k8s cluster and storage medium
CN114070822B (en) Kubernetes Overlay IP address management method
CN111585887B (en) Communication method and device based on multiple networks, electronic equipment and storage medium
EP3806395B1 (en) Virtual network function (vnf) deployment method and apparatus
CN110971480B (en) Computer network condition monitoring method and device, computer equipment and storage medium
CN113361913A (en) Communication service arranging method, device, computer equipment and storage medium
CN102122268B (en) Virtual machine memory allocation access method, device and system
CN113612866B (en) Address detection method and device, computer equipment and storage medium
US20240118935A1 (en) Pod deployment method and apparatus
CN115705198A (en) Node for operating a group of containers, system and method for managing a group of containers
CN109005071B (en) Decision deployment method and scheduling equipment
CN111274022A (en) Server resource allocation method and system
CN115023929A (en) Data synchronization method, device, system, electronic equipment and storage medium

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