CN116991534A - Container resource allocation method, device, equipment and storage medium - Google Patents

Container resource allocation method, device, equipment and storage medium Download PDF

Info

Publication number
CN116991534A
CN116991534A CN202310890627.8A CN202310890627A CN116991534A CN 116991534 A CN116991534 A CN 116991534A CN 202310890627 A CN202310890627 A CN 202310890627A CN 116991534 A CN116991534 A CN 116991534A
Authority
CN
China
Prior art keywords
clickhouse
containerized
platform
creating
cluster
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
CN202310890627.8A
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.)
China United Network Communications Group Co Ltd
Unicom Digital Technology Co Ltd
Unicom Cloud Data Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Unicom Digital Technology Co Ltd
Unicom Cloud Data 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 China United Network Communications Group Co Ltd, Unicom Digital Technology Co Ltd, Unicom Cloud Data Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202310890627.8A priority Critical patent/CN116991534A/en
Publication of CN116991534A publication Critical patent/CN116991534A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • 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/5083Techniques for rebalancing the load in a distributed system
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application provides a container resource allocation method, device, equipment and storage medium. The method includes, in response to a user operation, obtaining an allocation indication of container resources, and creating a containerized clickHouse platform of different resource amount levels in a containerized clickHouse base according to the allocation indication, the platform comprising: primary containerization platform, intermediate containerization platform, and advanced containerization platform. Creating ClickHouse clusters in the primary containerization platform, the intermediate containerization platform and the advanced containerization platform respectively, wherein the ClickHouse clusters are used for distributing container resources for target business to be transacted. The method reduces the resource waste caused by creating the ClickHouse cluster by the appointed resource quantity, and effectively improves the balance of the ClickHouse cluster for distributing the container resources.

Description

Container resource allocation method, device, equipment and storage medium
Technical Field
The present application relates to the field of cloud computing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for allocating container resources.
Background
With the rapid development of internet technology, the requirements on data storage and processing are also higher and higher, so that the ClickHouse is widely applied as a high-performance distributed relational database.
In the prior art, when creating a containerized ClickHouse cluster, a ClickHouse cluster with a specified resource amount is generally created according to service requirements and user side loads, wherein the ClickHouse cluster is used for distributing container resources for services to be handled.
However, container resources distributed by the ClickHouse cluster created by the prior art are not balanced enough, and waste of resources is easily caused.
Disclosure of Invention
The application provides a container resource allocation method, device, equipment and storage medium, which are used for solving the problems that container resources allocated by a ClickHouse cluster created in the prior art are not balanced enough and waste of resources is easily caused.
In a first aspect, the present application provides a method for allocating container resources, including:
responding to user operation, and acquiring an allocation instruction of container resources;
creating a containerized clickHouse platform of different resource amount levels in a containerized clickHouse base according to the allocation indication, the containerized clickHouse platform comprising: primary containerized clickHouse platform, intermediate containerized clickHouse platform, and advanced containerized clickHouse platform;
creating ClickHouse clusters in the primary containerized ClickHouse platform, the intermediate containerized ClickHouse platform and the advanced containerized ClickHouse platform respectively, wherein the ClickHouse clusters are used for distributing container resources for target business to be transacted.
Optionally, the creating, according to the allocation indication, a containerized clickHouse platform of different resource amount levels in a containerized clickHouse base includes:
creating a primary containerized ClickHouse platform in the containerized ClickHouse base that meets the first storage space according to the first storage space in the allocation indication;
creating a middle-level containerized ClickHouse platform in the containerized ClickHouse base that meets the second storage space according to the second storage space in the allocation indication;
and according to a third storage space in the allocation indication, an advanced containerized ClickHouse platform meeting the third storage space is created in the containerized ClickHouse base.
Optionally, in the medium-level containerized clickHouse platform, creating a clickHouse cluster includes:
polling whether the resource amount of the existing node in the medium-level containerized ClickHouse platform meets the resource amount required for creating the ClickHouse cluster;
if the resource quantity required by creating the ClickHouse cluster is not met, expanding at least one node based on a preset capacity expansion technology;
creating the ClickHouse cluster on the expanded at least one node, wherein the ClickHouse cluster is used for distributing container resources for one user terminal.
Optionally, creating, in the primary containerized clickHouse platform, a clickHouse cluster includes:
creating a ClickHouse cluster in the medium-level containerized ClickHouse platform, wherein the ClickHouse cluster is owned by the primary containerized ClickHouse platform and is used for distributing container resources for a plurality of user terminals.
Optionally, in the advanced containerized clickHouse platform, creating a clickHouse cluster includes:
determining labels of nodes for creating a ClickHouse cluster based on a preset affinity or anti-affinity algorithm;
determining a target node corresponding to the label according to the label;
creating the ClickHouse cluster on the target node.
Optionally, after creating the ClickHouse cluster in the primary containerized ClickHouse platform, the intermediate containerized ClickHouse platform and the advanced containerized ClickHouse platform, the method further includes:
acquiring the resource quantity requirement of the target business to be handled and/or the system load of a user terminal;
determining a target containerized ClickHouse platform from the containerized ClickHouse platforms with different resource quantity levels according to the resource quantity requirements and/or the system load of the user terminal;
and distributing container resources for the target business to be handled according to the ClickHouse cluster in the target containerized ClickHouse platform.
Optionally, the resources include one or more of: CPU resources, memory resources, computing resources, network resources.
In a second aspect, the present application provides a container resource allocation apparatus, comprising:
the acquisition module is used for responding to the user operation and acquiring an allocation instruction of the container resources;
a creation module for creating a containerized clickHouse platform of different resource amount levels in a containerized clickHouse base according to the allocation indication, the containerized clickHouse platform comprising: primary containerized clickHouse platform, intermediate containerized clickHouse platform, and advanced containerized clickHouse platform;
the creating module is further configured to create a clickHouse cluster in the primary containerized clickHouse platform, the intermediate containerized clickHouse platform and the advanced containerized clickHouse platform, where the clickHouse cluster is used to allocate container resources for a target service to be transacted.
In a third aspect, the present application provides an electronic device comprising: at least one processor, memory;
the memory stores computer-executable instructions;
the at least one processor executing computer-executable instructions stored in the memory to perform the method of allocating container resources of any of the first aspects.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored therein computer-executable instructions that, when executed by a processor, are configured to implement the method for allocating container resources of any one of the first aspects.
The application provides a method, a device, equipment and a storage medium for allocating container resources, which are characterized in that an allocation instruction of the container resources is obtained by responding to user operation, and a containerized ClickHouse platform with different resource quantity levels is created in a containerized ClickHouse base according to the allocation instruction, wherein the containerized ClickHouse platform comprises: primary containerized clickHouse platform, intermediate containerized clickHouse platform, and advanced containerized clickHouse platform. And creating ClickHouse clusters in the primary containerized ClickHouse platform, the intermediate containerized ClickHouse platform and the advanced containerized ClickHouse platform respectively, wherein the ClickHouse clusters are used for distributing container resources for target business to be transacted. According to the method, the resource waste caused by creating the ClickHouse clusters through the appointed resource amount is reduced by creating the containerized ClickHouse platforms with different resource amount levels, and further the method for creating the ClickHouse clusters on the containerized ClickHouse platforms with different resource amount levels is provided, so that the balance of the ClickHouse clusters for distributing container resources is effectively improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic view of an application scenario provided by the present application;
FIG. 2 is a flow chart of a method for allocating container resources according to an embodiment of the present application;
FIG. 3 is a flow chart of a method for creating a ClickHouse cluster in a medium-level containerized ClickHouse platform provided by an embodiment of the present application;
FIG. 4 is a flow diagram of a method for creating a ClickHouse cluster in an advanced containerized ClickHouse platform provided by an embodiment of the present application;
FIG. 5 is a flowchart illustrating a method for allocating container resources for a to-be-handled service according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a method for allocating container resources according to an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a device for distributing container resources according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Specific embodiments of the present application have been shown by way of the above drawings and will be described in more detail below. The drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but rather to illustrate the inventive concepts to those skilled in the art by reference to the specific embodiments.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying claims.
In the description of the embodiments of the present application, the terms "inner", "outer", etc. refer to directions or positional relationships based on the directions or positional relationships shown in the drawings, which are merely for convenience of description, and do not indicate or imply that the apparatus or components must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present application.
Furthermore, it should be noted that, in the description of the embodiments of the present application, unless explicitly specified and limited otherwise, the terms "connected," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be the communication between the two components. The specific meaning of the above terms in the embodiments of the present application can be understood by those skilled in the art according to the specific circumstances.
With the rapid development of internet technology, the amount of data to be processed by a terminal also increases sharply, and therefore, higher demands are also put on the storage of data. ClickHouse is widely focused and applied as a high-performance database suitable for processing large-scale data storage and retrieval.
In the prior art, when creating a containerized ClickHouse cluster, the ClickHouse cluster with a specified resource amount is generally created according to service requirements and user side loads.
However, container resources distributed by the ClickHouse cluster created by the prior art are not balanced enough, and waste of resources is easily caused.
For example, when the resource requirement of a service is less, if the amount of resources specified by the clickHouse cluster created by the prior art is larger, the resource waste is easily caused, and the user experience is affected.
As another example, when the resource demand of a service is medium, the amount of resources provided by different clickHouse clusters varies because the amount of resources of the clickHouse clusters created by the prior art are specified. When the service needs to provide the resource amount by the ClickHouse cluster A, if the resource of the ClickHouse cluster A is less and the resource of the ClickHouse cluster B is not used, the resource of the ClickHouse cluster A is not used, and the resource of the ClickHouse cluster is not utilized uniformly.
For another example, when the resource requirement of a service is larger, if the amount of resources specified by the clickHouse cluster created by the prior art is smaller, the current clickHouse cluster is easy to cause that the resource requirement of the service cannot be met, and in order to meet the resource requirement, capacity expansion processing is required, so that the operation is complicated, and the user experience is affected.
Therefore, in view of the above technical problems in the prior art, the present application provides a method, an apparatus, a device and a storage medium for allocating container resources. The method comprises the steps of creating containerized ClickHouse platforms with different resource quantity levels, creating ClickHouse clusters on the containerized ClickHouse platforms with different resource quantity levels, and further determining a target containerized ClickHouse platform from the containerized ClickHouse platforms with different resource quantity levels based on resource requests required by a user to transact business, so that the ClickHouse clusters for distributing container resources for the target business to be transacted are determined, the container resources distributed by the ClickHouse clusters are more balanced, and the waste of resources is reduced.
In order to facilitate understanding of the present application, an application scenario of the present application is described below by way of example.
Fig. 1 is a schematic view of an application scenario provided by the present application, as shown in fig. 1: comprising a user terminal 101 and a management platform 102.
Wherein the user terminal 101 is configured to send an allocation indication to the management platform 102.
Management platform 102 for creating primary, intermediate, and advanced containerized ClickHouse platforms from the allocation indication, and creating ClickHouse clusters in each containerized ClickHouse platform.
ClickHouse clusters are used to allocate container resources for to-be-handled traffic, including but not limited to: CPU resources, memory resources, computing resources, network resources, etc.
It can be understood that the number, the form, the interaction mode, and the like of the user terminals 101 and the management platform 102 in the application scenario are not limited in the present application, and the scenario is only used for illustration, and in the specific application of the scheme, the configuration can be set according to the actual requirement.
The following describes the technical scheme of the present application and how the technical scheme of the present application solves the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 2 is a flow chart of a method for allocating container resources according to an embodiment of the present application, where an execution subject of the method may be a terminal with a container resource allocation function, for example, a personal computer, a notebook computer, a smart phone, a tablet computer, a portable wearable device, a server, or a server cluster. The method in this embodiment may be implemented by software, hardware, or a combination of software and hardware. As shown in fig. 2, the method specifically includes the following steps:
s201, responding to user operation, and acquiring an allocation instruction of the container resources.
In this embodiment, the execution body takes a server as an example, and a management platform is configured in the server.
The user sends an allocation indication to the management platform at the user terminal, the allocation indication being used for allocating resources to the containerized ClickHouse base.
The base may be understood as a resource platform, which may be composed of a physical machine, a resource storage device, and the like.
In this embodiment, the resources include, but are not limited to, the following: CPU resources, memory resources, computing resources, network resources, etc.
S202, creating containerized ClickHouse platforms with different resource quantity levels in a containerized ClickHouse base according to allocation instructions, wherein the containerized ClickHouse platforms comprise: primary containerized clickHouse platform, intermediate containerized clickHouse platform, and advanced containerized clickHouse platform.
ClickHouse is a column type database management system for online analysis, and has the advantages of high response speed, multiple functions and the like.
The management platform can create different levels of containerized ClickHouse platforms according to the allocation instructions, and the resources allocated by the containerized ClickHouse platforms of each level are different.
One possible implementation is:
a primary containerized ClickHouse platform is created in the containerized ClickHouse base that meets the first storage space according to the first storage space in the allocation indication.
A medium-level containerized ClickHouse platform is created in the containerized ClickHouse base that satisfies the second storage space in accordance with the second storage space in the allocation indication.
In accordance with the third storage space in the allocation indication, an advanced containerized ClickHouse platform is created in the containerized ClickHouse base that meets the third storage space.
It should be noted that the higher the level of the containerized clickHouse platform, the greater its corresponding storage.
By way of example only, and not by way of limitation,
the primary containerized ClickHouse platform is suitable for small tenants with less than or equal to 10T storage.
The medium-level containerized ClickHouse platform is suitable for medium-sized tenants with storage of more than 10T and less than or equal to 100T.
The advanced containerized ClickHouse platform is suitable for large tenants with more than 100T storage.
It will be appreciated that the partitioned containerized ClickHouse platform described above may also include other more detailed partitions, for example, ultra-low level containerized ClickHouse platforms, ultra-high level containerized ClickHouse platforms, etc., without limitation to levels in the present application.
S203, creating a ClickHouse cluster in the primary containerized ClickHouse platform, the intermediate containerized ClickHouse platform and the advanced containerized ClickHouse platform respectively, wherein the ClickHouse cluster is used for distributing container resources for target business to be transacted.
After creating the containerized ClickHouse platforms with different resource amount levels in step S202, the management platform may create a ClickHouse cluster in the containerized ClickHouse platforms with different levels, for a specific creation process, see the embodiments described below.
In the above-described embodiment of the present application, by acquiring an allocation instruction of container resources in response to a user operation, and creating a containerized clickHouse platform of different resource amount levels in a containerized clickHouse base according to the allocation instruction, the containerized clickHouse platform includes: primary containerized clickHouse platform, intermediate containerized clickHouse platform, and advanced containerized clickHouse platform. And creating ClickHouse clusters in the primary containerized ClickHouse platform, the intermediate containerized ClickHouse platform and the advanced containerized ClickHouse platform respectively, wherein the ClickHouse clusters are used for distributing container resources for target business to be transacted. According to the embodiment, the container ClickHouse platforms with different resource quantity levels are created, so that the ClickHouse clusters are created on the container ClickHouse platforms with different resource quantity levels, the balance of container resources allocated by the ClickHouse clusters is effectively improved, and the waste of resources is reduced.
Further, on the basis of the above-described embodiment, the process of creating a clickHouse cluster in the primary containerized ClickHouse platform, the intermediate containerized ClickHouse platform, and the advanced containerized ClickHouse platform, respectively, referred to in the above-described step S203, will be described in detail by the following embodiment.
FIG. 3 is a flow chart of a method for creating a ClickHouse cluster in a medium-level containerized ClickHouse platform according to an embodiment of the present application, as shown in FIG. 3, the method includes the steps of:
s301, polling the resource amount of the existing nodes in the middle-level containerized ClickHouse platform.
A plurality of nodes are arranged in the medium-level containerized ClickHouse platform, and the management platform firstly polls the resources of the existing nodes in the medium-level containerized ClickHouse platform to acquire the resource quantity of the existing nodes.
S302, judging whether the resource quantity of the existing node meets the resource quantity required by creating the ClickHouse cluster.
And the management platform judges whether the resource quantity of the existing node can meet the resource quantity required by creating the ClickHouse cluster according to the resource quantity of the existing node.
S303, if the amount of resources required for creating the ClickHouse cluster is met, creating the ClickHouse cluster on the existing node.
If so, the resource amount indicating the existing node can create the ClickHouse cluster, and thus, the ClickHouse cluster is created on the existing node.
By deploying the clickHouse cluster on an existing node without capacity expansion, occupation of redundant resources can be reduced.
S304, if the resource amount required for creating the ClickHouse cluster is not met, expanding at least one node based on a preset capacity expansion technology.
If the resource amount of the existing node cannot be established, the new node needs to be expanded to meet the resource amount required for establishing the ClickHouse cluster.
The preset capacity expansion technology may be a virtual machine capacity expansion technology, or may be a cloud computing model or an algorithm, etc., and the capacity expansion technology is not limited in this embodiment.
S305, creating a ClickHouse cluster on the expanded at least one node, wherein the ClickHouse cluster is used for distributing container resources for one user terminal.
By deploying the ClickHouse cluster on the expanded node, the quick expansion of the ClickHouse cluster can be realized, so that the service resource requirement is better met, and the waste of resources is reduced.
In a primary containerized ClickHouse platform, one possible implementation of creating a ClickHouse cluster is:
a ClickHouse cluster is created in a medium-level containerized ClickHouse platform, the ClickHouse cluster being owned by a primary containerized ClickHouse platform. Wherein the ClickHouse cluster is used for distributing container resources for a plurality of user terminals.
A ClickHouse cluster created in a medium-level containerized ClickHouse platform, resources of which, such as CPU resources, storage resources, computing resources, network resources, etc., can meet the needs of multiple small tenants, which can be shared.
Each small tenant can only access the corresponding database according to the authority control, so that influence among tenants is reduced, the utilization rate of resources is improved by sharing the resources of the ClickHouse clusters, and the waste of the resources caused by creating one ClickHouse cluster for each tenant is reduced.
The process of creating the ClickHouse cluster in the intermediate-level containerized ClickHouse platform is described in the above embodiments, and the description is not repeated for the sake of avoiding redundancy.
FIG. 4 is a flow chart of a method for creating a ClickHouse cluster in an advanced containerized ClickHouse platform according to an embodiment of the present application, as shown in FIG. 4, the method comprising the steps of:
s401, determining labels of nodes used for creating ClickHouse clusters based on a preset affinity or anti-affinity algorithm.
In the advanced containerized ClickHouse platform, a plurality of nodes are arranged, each node is corresponding to a respective label, and according to the affinity relation among the nodes, the label of the node with strong affinity or weak affinity can be determined, and the node is used for creating a ClickHouse cluster.
S402, determining a target node corresponding to the label according to the label.
S403, creating a ClickHouse cluster on the target node.
And the management platform determines the target node according to the label.
When the advanced containerized ClickHouse platform creates the ClickHouse cluster on the target node, all resources of the target node are directly occupied without being specified, namely, how many resources can be provided by the target node, and how many resources can be used by the ClickHouse cluster, so that the problem of frequent expansion caused by too fast growth of service resource demands is solved.
In the application, the management platform can also manage and control the functions of user account number, user authority, quota billing, log inquiry, monitoring alarm, identity recognition and access management (Identity and Access Management, IAM) authentication, operation audit and the like, thereby improving the availability, expandability and security of different grades of containerized ClickHouse platforms.
In the embodiment of the application, the ClickHouse cluster is created in different containerized ClickHouse platforms, namely a primary containerized ClickHouse platform, a middle-level containerized ClickHouse platform and a high-level containerized ClickHouse platform, so that the balance of container resources allocated by the ClickHouse cluster is effectively improved, and the waste of the resources is reduced.
Further, the process of allocating container resources for a business to be handled according to the different levels of containerized ClickHouse platforms created is illustrated by the following examples.
Fig. 5 is a flowchart of a method for allocating container resources for a to-be-handled service according to an embodiment of the present application, as shown in fig. 5, where the method includes the following steps:
s501, acquiring the resource quantity requirement of the target business to be handled and/or the system load of the user terminal.
The user sends a request for handling the target service to the management platform through the user terminal, and the request at least comprises the resource quantity required by the target service and/or the system load information of the user terminal.
Therefore, the management platform can acquire the resource quantity requirement of the target business to be handled and/or the system load of the user terminal.
S502, determining a target containerized ClickHouse platform from containerized ClickHouse platforms with different resource quantity levels according to resource quantity requirements and/or system loads of user terminals.
The management platform may determine a target containerized ClickHouse platform according to the resource amount requirement and/or a system load of the user terminal, wherein the target containerized ClickHouse platform may be one or more of a primary containerized ClickHouse platform, a medium-level containerized ClickHouse platform, or a high-level containerized ClickHouse platform.
Alternatively, the management platform may determine the target containerized clickHouse platform based on the user's instructions. I.e., if the user indicates a primary containerized ClickHouse platform, the primary containerized ClickHouse platform is the target containerized ClickHouse platform, i.e., if the user indicates a middle level containerized ClickHouse platform, the middle level containerized ClickHouse platform is the target containerized ClickHouse platform, i.e., if the user indicates a high level containerized ClickHouse platform, the high level containerized ClickHouse platform is the target containerized ClickHouse platform.
S503, distributing container resources for the target business to be handled according to the ClickHouse cluster in the target containerized ClickHouse platform.
If the target containerized ClickHouse platform is a primary containerized ClickHouse platform, allocating container resources for the target business to be handled by a ClickHouse cluster in the primary containerized ClickHouse platform.
If the target containerized ClickHouse platform is a medium-level containerized ClickHouse platform, allocating container resources for the target business to be handled by a ClickHouse cluster in the medium-level containerized ClickHouse platform.
If the target containerized ClickHouse platform is an advanced containerized ClickHouse platform, container resources are allocated for the target business to be handled by a ClickHouse cluster in the advanced containerized ClickHouse platform.
In the above embodiment of the present application, the resource amount requirement of the target service to be handled and/or the system load of the user terminal are obtained, and the target containerized ClickHouse platform is determined from containerized ClickHouse platforms with different resource amount levels according to the resource amount requirement and/or the system load of the user terminal, so that the container resource is allocated to the target service to be handled according to the ClickHouse cluster in the target containerized ClickHouse platform. The method of the embodiment ensures that the container resources distributed by the ClickHouse cluster are more balanced, and reduces the waste of the resources.
In order to facilitate understanding of the present application, the method of the present application is briefly described by referring to fig. 6, and fig. 6 is a schematic diagram of a method for allocating container resources according to an embodiment of the present application, as shown in fig. 6:
in response to a user operation, the management platform obtains an allocation indication and creates a containerized ClickHouse platform of different resource amount levels in the containerized ClickHouse base according to the allocation indication.
Wherein the containerized ClickHouse platform comprises: primary containerized clickHouse platform, intermediate containerized clickHouse platform, and advanced containerized clickHouse platform.
Resources include, but are not limited to: CPU resources, memory resources, computing resources, network resources, etc.
After the management platform obtains service requirements submitted by users, namely to-be-handled services, determining a target containerized ClickHouse platform from containerized ClickHouse platforms with different resource quantity levels according to the to-be-handled services, and distributing container resources for the to-be-handled services through a ClickHouse cluster created in the target containerized ClickHouse platform.
In the application, the management platform can also manage and control user account numbers, user rights, quota billing, log inquiry, monitoring and alarming, identity recognition and access management (Identity and Access Management, IAM) authentication, operation audit and the like.
Fig. 7 is a schematic structural diagram of a device for distributing container resources according to an embodiment of the present application, as shown in fig. 7, where the device includes: an acquisition module 701 and a creation module 702.
An obtaining module 701, configured to obtain an allocation indication of the container resource in response to a user operation.
A creation module 702 for creating a containerized clickHouse platform of different resource amount levels in the containerized clickHouse base according to the allocation indication, the containerized clickHouse platform comprising: primary containerized clickHouse platform, intermediate containerized clickHouse platform, and advanced containerized clickHouse platform.
The creation module 702 is further configured to create a clickHouse cluster in the primary containerized clickHouse platform, the intermediate containerized clickHouse platform, and the advanced containerized clickHouse platform, where the clickHouse cluster is used to allocate container resources for the target service to be transacted.
One possible implementation is that the creation module 702 is specifically configured to:
a primary containerized ClickHouse platform is created in the containerized ClickHouse base that meets the first storage space according to the first storage space in the allocation indication.
A medium-level containerized ClickHouse platform is created in the containerized ClickHouse base that satisfies the second storage space in accordance with the second storage space in the allocation indication.
In accordance with the third storage space in the allocation indication, an advanced containerized ClickHouse platform is created in the containerized ClickHouse base that meets the third storage space.
One possible implementation is that the creation module 702 is specifically further configured to:
whether the amount of resources of an existing node in the mid-level containerized ClickHouse platform meets the amount of resources required to create a ClickHouse cluster is polled.
If the amount of resources required for creating the ClickHouse cluster is not satisfied, at least one node is expanded based on a preset expansion technology.
Creating a ClickHouse cluster on the expanded at least one node, wherein the ClickHouse cluster is used for allocating container resources for one user terminal.
One possible implementation is that the creation module 702 is specifically further configured to:
a ClickHouse cluster is created in the intermediate-level containerized ClickHouse platform, the ClickHouse cluster being owned by the primary containerized ClickHouse platform, the ClickHouse cluster being used to allocate container resources for a plurality of user terminals.
One possible implementation is that the creation module 702 is specifically further configured to:
the labels of the nodes used to create the clickHouse cluster are determined based on a preset affinity or anti-affinity algorithm.
And determining the target node corresponding to the label according to the label.
A ClickHouse cluster is created on the target node.
A possible implementation manner is that the device includes a processing module, configured to:
and acquiring the resource quantity requirement of the target business to be handled and/or the system load of the user terminal.
And determining a target containerized ClickHouse platform from containerized ClickHouse platforms with different resource quantity levels according to the resource quantity requirements and/or the system load of the user terminal.
And distributing container resources for the target business to be handled according to the ClickHouse cluster in the target containerized ClickHouse platform.
One possible implementation is that the resources include one or more of the following: CPU resources, memory resources, computing resources, network resources.
The device for allocating container resources provided in this embodiment is configured to execute the foregoing method embodiment, and its implementation principle is similar to that of the technical effect, and will not be described herein.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application, as shown in fig. 8, where the device may include: at least one processor 801 and a memory 802.
A memory 802 for storing programs. In particular, the program may include program code including computer operating instructions, or executable instructions of the processor 801, or the like.
Memory 802 may comprise high-speed RAM memory or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The processor 801 is configured to execute computer-executable instructions stored in the memory 802 to implement the methods described in any of the embodiments of the methods described above. The processor 801 may be a central processing unit (Central Processing Unit, abbreviated as CPU), or an application specific integrated circuit (Application Specific Integrated Circuit, abbreviated as ASIC), or one or more integrated circuits configured to implement embodiments of the present application.
Optionally, the electronic device may also include a communication interface 803. In a specific implementation, if the communication interface 803, the memory 802, and the processor 801 are implemented independently, the communication interface 803, the memory 802, and the processor 801 may be connected to each other and perform communication with each other through buses. The bus may be an industry standard architecture (Industry Standard Architecture, abbreviated ISA) bus, an external device interconnect (Peripheral Component, abbreviated PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated EISA) bus, among others. Buses may be divided into address buses, data buses, control buses, etc., but do not represent only one bus or one type of bus.
Alternatively, in a specific implementation, if the communication interface 803, the memory 802, and the processor 801 are implemented on a single chip, the communication interface 803, the memory 802, and the processor 801 may complete communication through internal interfaces.
The electronic device provided in this embodiment is configured to execute the method for allocating container resources executed in the foregoing embodiment, and the implementation principle and technical effects of the method are similar to those of the method for allocating container resources, which are not described in detail.
The present application also provides a computer-readable storage medium, which may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, specifically, a computer-readable storage medium storing computer-executable instructions for the allocation method of container resources in the above embodiment.
The present application also provides a computer program product comprising executing instructions or a computer program, the executing instructions or computer program being stored in a readable storage medium. The at least one processor of the electronic device may read the execution instructions from the readable storage medium, the execution instructions being executed by the at least one processor to cause the electronic device to implement the container resource allocation method provided by the various embodiments described above.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. A method of allocating container resources, comprising:
responding to user operation, and acquiring an allocation instruction of container resources;
creating a containerized clickHouse platform of different resource amount levels in a containerized clickHouse base according to the allocation indication, the containerized clickHouse platform comprising: primary containerized clickHouse platform, intermediate containerized clickHouse platform, and advanced containerized clickHouse platform;
creating ClickHouse clusters in the primary containerized ClickHouse platform, the intermediate containerized ClickHouse platform and the advanced containerized ClickHouse platform respectively, wherein the ClickHouse clusters are used for distributing container resources for target business to be transacted.
2. The method of claim 1, wherein the creating a containerized clickHouse platform of different resource amount levels in a containerized clickHouse base according to the allocation indication comprises:
creating a primary containerized ClickHouse platform in the containerized ClickHouse base that meets the first storage space according to the first storage space in the allocation indication;
creating a middle-level containerized ClickHouse platform in the containerized ClickHouse base that meets the second storage space according to the second storage space in the allocation indication;
and according to a third storage space in the allocation indication, an advanced containerized ClickHouse platform meeting the third storage space is created in the containerized ClickHouse base.
3. The method of claim 2, wherein creating a clickHouse cluster in the intermediate-level containerized clickHouse platform comprises:
polling whether the resource amount of the existing node in the medium-level containerized ClickHouse platform meets the resource amount required for creating the ClickHouse cluster;
if the resource quantity required by creating the ClickHouse cluster is not met, expanding at least one node based on a preset capacity expansion technology;
creating the ClickHouse cluster on the expanded at least one node, wherein the ClickHouse cluster is used for distributing container resources for one user terminal.
4. The method of claim 3, wherein creating a clickHouse cluster in the primary containerized clickHouse platform comprises:
creating a ClickHouse cluster in the medium-level containerized ClickHouse platform, wherein the ClickHouse cluster is owned by the primary containerized ClickHouse platform and is used for distributing container resources for a plurality of user terminals.
5. The method of claim 2, wherein creating a clickHouse cluster in the advanced containerized clickHouse platform comprises:
determining labels of nodes for creating a ClickHouse cluster based on a preset affinity or anti-affinity algorithm;
determining a target node corresponding to the label according to the label;
creating the ClickHouse cluster on the target node.
6. The method of any of claims 1-5, wherein after creating the cluster of clickHouse in the primary containerized clickHouse platform, the intermediate containerized clickHouse platform, and the advanced containerized clickHouse platform, respectively, further comprising:
acquiring the resource quantity requirement of the target business to be handled and/or the system load of a user terminal;
determining a target containerized ClickHouse platform from the containerized ClickHouse platforms with different resource quantity levels according to the resource quantity requirements and/or the system load of the user terminal;
and distributing container resources for the target business to be handled according to the ClickHouse cluster in the target containerized ClickHouse platform.
7. The method of claim 6, wherein the resources comprise one or more of: CPU resources, memory resources, computing resources, network resources.
8. A container resource dispensing apparatus, comprising:
the acquisition module is used for responding to the user operation and acquiring an allocation instruction of the container resources;
a creation module for creating a containerized clickHouse platform of different resource amount levels in a containerized clickHouse base according to the allocation indication, the containerized clickHouse platform comprising: primary containerized clickHouse platform, intermediate containerized clickHouse platform, and advanced containerized clickHouse platform;
the creating module is further configured to create a clickHouse cluster in the primary containerized clickHouse platform, the intermediate containerized clickHouse platform and the advanced containerized clickHouse platform, where the clickHouse cluster is used to allocate container resources for a target service to be transacted.
9. An electronic device, comprising: at least one processor, memory;
the memory stores computer-executable instructions;
the at least one processor executing computer-executable instructions stored in the memory to cause the electronic device to perform the method of allocating container resources of any one of claims 1 to 7.
10. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the method of allocating container resources according to any one of claims 1 to 7.
CN202310890627.8A 2023-07-19 2023-07-19 Container resource allocation method, device, equipment and storage medium Pending CN116991534A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310890627.8A CN116991534A (en) 2023-07-19 2023-07-19 Container resource allocation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310890627.8A CN116991534A (en) 2023-07-19 2023-07-19 Container resource allocation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116991534A true CN116991534A (en) 2023-11-03

Family

ID=88527684

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310890627.8A Pending CN116991534A (en) 2023-07-19 2023-07-19 Container resource allocation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116991534A (en)

Similar Documents

Publication Publication Date Title
US11068964B2 (en) Method and device for processing service request
CN105183565A (en) Computer and service quality control method and device
CN114416352A (en) Computing resource allocation method and device, electronic equipment and storage medium
CN103049328A (en) Distribution method of internal memory resources in computer system
US20220229701A1 (en) Dynamic allocation of computing resources
CN114095567A (en) Data access request processing method and device, computer equipment and medium
CN111163186B (en) ID generation method, device, equipment and storage medium
CN113361913A (en) Communication service arranging method, device, computer equipment and storage medium
CN114625533A (en) Distributed task scheduling method and device, electronic equipment and storage medium
CN113672375A (en) Resource allocation prediction method, device, equipment and storage medium
CN114070847B (en) Method, device, equipment and storage medium for limiting current of server
CN116881003A (en) Resource allocation method, device, service equipment and storage medium
CN116991534A (en) Container resource allocation method, device, equipment and storage medium
CN110879748A (en) Shared resource allocation method, device and equipment
CN115629951A (en) Task full-link tracking method, first node, link system and medium
CN115098272A (en) GPU resource scheduling method, scheduler, electronic device and storage medium
CN111796934B (en) Task issuing method and device, storage medium and electronic equipment
CN114004527A (en) Processing method, device and equipment for product distribution and storage medium
CN109614242B (en) Computing capacity sharing method, device, equipment and medium
CN115080220A (en) Cloud resource allocation method and equipment
GB2504737A (en) Load balancing in SAP (RTM) system
CN113312184A (en) Service data processing method and related equipment
CN117785486B (en) Environment resource allocation method, device, equipment and medium
CN112182788A (en) Resource allocation method based on virtual simulation test platform
CN112738213A (en) Block chain-based task demand response method, device, system 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