Containerization method and device based on Sharding-Proxy
By configuring the image and managing the entire lifecycle of the Sharding-Proxy cluster through the management platform, Sharding-Proxy container deployment is achieved, solving the problems of cross-container cluster intercommunication and system stability, and reducing the complexity of operation and maintenance.
Patent Information
- Application Number
- CN202210065406.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-01-20
AI Technical Summary
The existing technology of Sharding-Proxy lacks a containerized deployment method, which makes it impossible to effectively achieve cross-container cluster intercommunication in environments with high network security restrictions. In addition, it may cause Consul cluster disorder and service call anomalies in the active-active solution in the same city.
A containerization method and device based on Sharding-Proxy are provided. Through a management platform, images are obtained and resources are configured, and Sharding-Proxy cluster instances are created and initialized. This allows for full lifecycle management of the Sharding-Proxy cluster, including monitoring, maintenance, and termination operations.
The containerized deployment of Sharding-Proxy is realized, which reduces the complexity of operation and maintenance, ensures the efficient management and resource release of Sharding-Proxy cluster on the management platform, solves the problem of intercommunication between container clusters, and improves the stability and reliability of the system.
Smart Images

Figure CN114416300B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of databases, and more specifically, to a containerization method and apparatus based on Sharding-Proxy. Background Art
[0002] Sharding-Proxy is a transparent database proxy that provides a server-side version that encapsulates the database binary protocol to support heterogeneous languages. Sharding-Proxy shields the underlying sharding and table sharding. Currently compatible with MySQL and PG, Sharding-Proxy can be accessed using any MySQL- or PG-compatible client (such as the MySQL command line, MySQL Workbench, Navicat, etc.), allowing for DDL / DML operations to modify data, making it more user-friendly for database administrators. Sharding-Proxy containerization can meet the goal of dual-center deployment in the same city in a relatively short period of time, enabling 24 / 7 uninterrupted service. Even failures in a single data center will not affect business continuity.
[0003] In the typical physical or virtual machine active-active solution in the same city, two data centers share a Consul cluster. When call delays or cross-data center network fluctuations occur, the Consul cluster may become disordered, causing a Consul node to frantically broadcast messages, resulting in a sharp increase in dedicated line bandwidth and abnormal calls between services.
[0004] Currently, there is no Sharding-Proxy containerization method in Sharding-Proxy technology. In some industries, network security restrictions are very strict, and only specific ports are allowed to be opened for communication across container clusters. It is not possible to relax the corresponding IP port policy on both clusters for each new application or service. Summary of the Invention
[0005] The embodiments of the present application provide a containerization method and apparatus based on Sharding-Proxy, aiming to perform containerized deployment of Sharding-Proxy.
[0006] In a first aspect, an embodiment of the present application provides a containerization method based on Sharding-Proxy, including:
[0007] The management platform obtains the image of the Sharding-Proxy cluster and configures the resources of the Sharding-Proxy cluster based on the image; the resources include the maximum resource quota of the cluster, the number of nodes in the cluster, the CPU allocation in each node, the memory allocation in each node, and the disk allocation in each node;
[0008] The management platform creates a Sharding-Proxy cluster instance; and initializes the Sharding-Proxy cluster instance based on the configured resources of the Sharding-Proxy cluster image to start the Sharding-Proxy cluster instance;
[0009] When the Sharding-Proxy cluster instance is running, the management platform monitors and maintains the Sharding-Proxy cluster instance;
[0010] In response to the termination request for the Sharding-Proxy cluster instance, the management platform stops the operation of the Sharding-Proxy cluster instance and deletes the Sharding-Proxy cluster instance to release resources configured for the Sharding-Proxy cluster.
[0011] Optionally, the management platform obtains an image of the Sharding-Proxy cluster and configures resources of the Sharding-Proxy cluster based on the image, including:
[0012] The management platform obtains the download interface of the Sharding-Proxy cluster, downloads the Sharding-Proxy cluster based on the download interface, and creates a mirror of the Sharding-Proxy cluster;
[0013] The management platform obtains the resource quota of the Sharding-Proxy cluster instance, where the resource quota includes the number of nodes of the Sharding-Proxy cluster instance, the CPU of each node, the memory size of each node, and the disk size of each node;
[0014] The management platform configures the resources of the Sharding-Proxy cluster based on the resource quota of the Sharding-Proxy cluster instance.
[0015] Optionally, the management platform creates a Sharding-Proxy cluster instance; and initializes the Sharding-Proxy cluster instance based on the configured resources of the Sharding-Proxy cluster image to start the Sharding-Proxy cluster instance, including:
[0016] The management platform obtains the first data source interface of each node in the Sharding-Proxy cluster instance;
[0017] The management platform creates a Sharding-Proxy cluster instance and connects the first data source interface to each node in the Sharding-Proxy cluster instance.
[0018] Optionally, when the Sharding-Proxy cluster instance is running, the management platform monitors and maintains the Sharding-Proxy cluster instance, including:
[0019] The management platform switches the data source configuration of the Sharding-Proxy cluster instance;
[0020] The management platform performs circuit breaking on the internal nodes of the Sharding-Proxy cluster instance;
[0021] The management platform updates the configuration information of the internal nodes of the Sharding-Proxy cluster instance, where the configuration information is used to indicate the data source to which the internal nodes are connected;
[0022] The management platform adds and deletes internal nodes of the Sharding-Proxy cluster instance;
[0023] The monitoring component monitors resource usage of the Sharding-Proxy cluster instance.
[0024] Optionally, the management platform switches the data source configuration of the Sharding-Proxy cluster instance, including:
[0025] The management platform obtains the second data source interface of each node in the Sharding-Proxy cluster instance;
[0026] The management platform connects the second data source interface to each node in the Sharding-Proxy cluster instance.
[0027] Optionally, the management platform performs a circuit breaker operation on the internal nodes of the Sharding-Proxy cluster instance, including:
[0028] The management platform obtains the blocked node in the Sharding-Proxy cluster instance;
[0029] The management platform disconnects the blocked node in the Sharding-Proxy cluster instance, and connects the data source interface connected to the blocked node in the Sharding-Proxy cluster instance to another node in the Sharding-Proxy cluster instance.
[0030] Optionally, the monitoring component monitors resource usage of the Sharding-Proxy cluster instance, including:
[0031] The monitoring component obtains a monitoring interface through the management platform;
[0032] The monitoring component monitors the resource usage status of the Sharding-Proxy cluster instance based on the monitoring interface.
[0033] Optionally, the method further comprises,
[0034] The management platform mirrors the configured Sharding-Proxy cluster into multiple Sharding-Proxy cluster instances and starts them;
[0035] When the multiple Sharding-Proxy cluster instances are running, the management platform monitors and maintains the multiple Sharding-Proxy cluster instances respectively.
[0036] In a second aspect, an embodiment of the present application provides a containerized device based on Sharding-Proxy, including a configuration module, an initialization module, a monitoring module, and an end module:
[0037] A configuration module is used to obtain the image of the Sharding-Proxy cluster from the management platform and configure the resources of the Sharding-Proxy cluster based on the image; the resources include the maximum resource quota of the cluster, the number of nodes in the cluster, the CPU allocation in each node, the memory allocation in each node, and the disk allocation in each node;
[0038] an initialization module, configured to create a Sharding-Proxy cluster instance on the management platform; and initialize the Sharding-Proxy cluster instance based on the configured resources of the Sharding-Proxy cluster image to start the Sharding-Proxy cluster instance;
[0039] A monitoring module, configured to enable the management platform to monitor and maintain the Sharding-Proxy cluster instance when the Sharding-Proxy cluster instance is running;
[0040] The termination module, in response to the termination request for the Sharding-Proxy cluster instance, stops the operation of the Sharding-Proxy cluster instance and deletes the Sharding-Proxy cluster instance to release the resources configured for the Sharding-Proxy cluster.
[0041] Beneficial effects: When deploying Sharding-Proxy in a containerized manner, first create a Sharding-Proxy cluster image on the management platform and configure resources for the Sharding-Proxy cluster through the image; then initialize and generate a Sharding-Proxy cluster instance on the management platform; while the Sharding-Proxy cluster instance is running, the management platform can monitor and maintain the Sharding-Proxy cluster instance; finally, the management platform terminates the Sharding-Proxy cluster instance and releases the resources configured for the Sharding-Proxy cluster; through the above process, the entire life cycle of a Sharding-Proxy cluster on the management platform can be completed. Based on the entire life cycle of the Sharding-Proxy cluster, the effect of containerized deployment of Sharding-Proxy on the management platform can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0043] Figure 1 This is a flowchart of the steps of the containerization method proposed in one embodiment of the present application;
[0044] Figure 2 This is a functional module diagram of a containerized device proposed in one embodiment of the present application. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0046] Example 1
[0047] Reference Figure 1 , shows a flowchart of the steps of the containerization method based on Sharding-Proxy in an embodiment of the present invention, such as Figure 1 As shown, this control method may specifically include the following steps:
[0048] S101, the management platform obtains the image of the Sharding-Proxy cluster and configures the resources of the Sharding-Proxy cluster based on the image; the resources include the maximum resource quota of the cluster, the number of nodes in the cluster, the CPU allocation in each node, the memory allocation in each node, and the disk allocation in each node;
[0049] An image is a lightweight, executable, independent software package used to package a software runtime environment and software developed based on the runtime environment. An image contains everything required to run a piece of software, including code, runtime, libraries, environment variables, and configuration files. When running a Sharding-Proxy cluster instance, the management platform first obtains the Sharding-Proxy image. Using the Sharding-Proxy image, an instance of the Sharding-Proxy cluster can be created on the management platform. After obtaining the Sharding-Proxy cluster image, the resources of the Sharding-Proxy cluster can be configured by modifying the files in the Sharding-Proxy cluster image.
[0050] S102, the management platform creates a Sharding-Proxy cluster instance; and initializes the Sharding-Proxy cluster instance based on the configured resources of the Sharding-Proxy cluster image to start the Sharding-Proxy cluster instance;
[0051] After configuring the Sharding-Proxy cluster image, the management platform can create a Sharding-Proxy cluster instance through the Sharding-Proxy cluster image. Sharding-Proxy is a database middleware. The Sharding-Proxy cluster created through the image has multiple databases, so it is called a Sharding-Proxy cluster. When initializing the Sharding-Proxy cluster instance through the management platform, the management platform needs to configure resources for the Sharding-Proxy cluster instance based on the resources configured in the Sharding-Proxy image before it can complete the initialization and start.
[0052] S103, when the Sharding-Proxy cluster instance is running, the management platform monitors and maintains the Sharding-Proxy cluster instance;
[0053] When the Sharding-Proxy cluster instance runs on the management platform, it is managed through the management platform, mainly for monitoring and maintenance of the Sharding-Proxy cluster instance. Database operation and maintenance personnel only need to operate on the management platform to complete the management of the entire life cycle of the Sharding-Proxy cluster instance, making maintenance and monitoring more convenient.
[0054] S104: In response to the termination request for the Sharding-Proxy cluster instance, the management platform stops the operation of the Sharding-Proxy cluster instance and deletes the Sharding-Proxy cluster instance to release resources configured for the Sharding-Proxy cluster.
[0055] The termination request of the Sharding-Proxy cluster instance comes from the operation and maintenance personnel of the Sharding-Proxy user or the database managed by Sharding-Proxy. The management platform can stop the operation of the Sharding-Proxy cluster instance in response to the termination request and automatically delete the Sharding-Proxy cluster instance. After the Sharding-Proxy cluster instance is deleted, the resources occupied by the Sharding-Proxy cluster instance can be released to avoid the Sharding-Proxy cluster instance that has completed its service from occupying resources for a long time and will not affect other running Sharding-Proxy cluster instances on the management platform.
[0056] In this embodiment, when deploying Sharding-Proxy in a containerized manner, first, a Sharding-Proxy cluster image is created on the management platform, and resources are configured for the Sharding-Proxy cluster through the image; then, a Sharding-Proxy cluster instance is initialized and generated on the management platform; while the Sharding-Proxy cluster instance is running, the management platform can monitor and maintain the Sharding-Proxy cluster instance; finally, the management platform terminates the Sharding-Proxy cluster instance and releases the resources configured for the Sharding-Proxy cluster; through the above process, the entire life cycle of a Sharding-Proxy cluster on the management platform can be completed. Based on the entire life cycle of the Sharding-Proxy cluster, the effect of containerized deployment of Sharding-Proxy on the management platform can be achieved.
[0057] Example 2
[0058] Reference Figure 1 As shown, a flowchart of the containerization method based on Sharding-Proxy in an embodiment of the present application is shown. Figure 1 As shown, the control method may specifically include the following steps:
[0059] S101, the management platform obtains the image of the Sharding-Proxy cluster and configures the resources of the Sharding-Proxy cluster based on the image; the resources include the maximum resource quota of the cluster, the number of nodes in the cluster, the CPU allocation in each node, the memory allocation in each node, and the disk allocation in each node;
[0060] Sharding-Proxy is a transparent database proxy that provides a server-side version that encapsulates the database binary protocol to support heterogeneous languages. Sharding-Proxy shields the underlying sharding and table sharding. Sharding-Proxy is currently compatible with MySQL and PG. You can use any client compatible with MySQL or PG protocols to access Sharding-Proxy (such as the MySQL command line, MySQL Workbench, Navicat, etc.), and then perform DDL / DML operations to modify data, making it more user-friendly for database operation and maintenance personnel.
[0061] By setting up a mirror, you can create a Sharding-Proxy instance on the management platform when you need to run it. The Sharding-Proxy mirror can be built using the Sharding-Proxy open source community version. During the build process, you can then modify the obtained open source version on the management platform to adapt it to the required functions. When modifying, you also need to configure Sharding-Proxy resources according to actual needs.
[0062] The management platform obtains the image of the Sharding-Proxy cluster and configures the resources of the Sharding-Proxy cluster based on the image, including:
[0063] The management platform obtains the download interface of the Sharding-Proxy cluster, downloads the Sharding-Proxy cluster based on the download interface, and creates a mirror of the Sharding-Proxy cluster;
[0064] In this embodiment, the Sharding-Proxy cluster uses the open source version, so the download interface of the Sharding-Proxy cluster is the download interface of the Sharding-Proxy open source community; the management platform can obtain the image of the Sharding-Proxy cluster through the download interface of the Sharding-Proxy open source community.
[0065] The management platform obtains the resource quota of the Sharding-Proxy cluster instance, where the resource quota includes the number of nodes of the Sharding-Proxy cluster instance, the CPU of each node, the memory size of each node, and the disk size of each node;
[0066] The management platform configures the resources of the Sharding-Proxy cluster based on the resource quota of the Sharding-Proxy cluster instance.
[0067] When configuring resource quotas for a Sharding-Proxy cluster instance, you first need to consider the number of nodes in the cluster. The number of nodes in a Sharding-Proxy cluster instance is the number of databases the Sharding-Proxy cluster can access. Then consider the CPU size, memory size, and disk size allocated to each node. When allocating resources, consider the existing resources of the Sharding-Proxy cluster, but you can also allocate resources based on the importance of each node.
[0068] In this embodiment, the management platform uses Kubernetes. Kubernetes is an open-source platform for managing containerized applications across multiple hosts in a cloud platform. Kubernetes aims to simplify and efficiently deploy containerized applications, providing a mechanism for application deployment, planning, updating, and maintenance. A core feature of Kubernetes is its ability to autonomously manage containers, ensuring they operate as expected. For example, if a user wants to keep MongShake running, they don't need to worry about how to do it; Kubernetes will automatically monitor and restart it, ensuring it remains operational. Administrators can load a microservice and have the planner find the appropriate location. Kubernetes also offers enhanced tools and user-friendly features, allowing users to easily deploy their own applications.
[0069] S102, the management platform creates a Sharding-Proxy cluster instance; and initializes the Sharding-Proxy cluster instance based on the configured resources of the Sharding-Proxy cluster image to start the Sharding-Proxy cluster instance; including,
[0070] The management platform obtains the first data source interface of each node in the Sharding-Proxy cluster instance;
[0071] In a Sharding-Proxy cluster instance, each node represents a database. The first data source interface of the node is the data interface of multiple databases connected to each node in the Sharding-Proxy cluster instance. Through the first data source interface, the Sharding-Proxy cluster instance can obtain data from multiple databases.
[0072] The management platform creates a Sharding-Proxy cluster instance and connects the first data source interface to each node in the Sharding-Proxy cluster instance.
[0073] After obtaining the first data source interface, the first data source interface is connected to each node in the Sharding-Proxy cluster instance to complete the initialization of the Sharding-Proxy cluster instance.
[0074] S103, when the Sharding-Proxy cluster instance is running, the management platform monitors and maintains the Sharding-Proxy cluster instance; including the following sub-steps:
[0075] S1031, the management platform switches the data source configuration of the Sharding-Proxy cluster instance; including the following steps:
[0076] The management platform obtains the second data source interface of each node in the Sharding-Proxy cluster instance;
[0077] The management platform connects the second data source interface to each node in the Sharding-Proxy cluster instance.
[0078] In this embodiment, the first data source interface and the second data source interface are both combinations of data interfaces of multiple databases. If a change occurs in one of the multiple databases that form the first data source interface or the second data source interface, or if a change occurs in the data interface of a database, the first data source interface or the second data source interface will also change accordingly. During initialization, the Sharding-Proxy cluster instance is connected to the first data source interface. If a change occurs in the data interface of one of the databases, the first data source interface also changes. In this case, the management platform needs to switch each node in the Sharding-Proxy cluster instance to connect to the second data source interface to complete the data source configuration switch, so as not to affect the management platform's deployment of the Sharding-Proxy cluster instance.
[0079] S1032: The management platform performs circuit breaking processing on the internal nodes of the Sharding-Proxy cluster instance; including:
[0080] The management platform obtains the blocked node in the Sharding-Proxy cluster instance;
[0081] When the data traffic in a Sharding-Proxy cluster instance is too large, the nodes in the Sharding-Proxy cluster instance may be blocked, thus affecting the operation of the Sharding-Proxy cluster instance.
[0082] The management platform disconnects the blocked node in the Sharding-Proxy cluster instance, and connects the data source interface connected to the blocked node in the Sharding-Proxy cluster instance to another node in the Sharding-Proxy cluster instance.
[0083] Sharding-Proxy has a node fuse function. When the data connection of a node is blocked, Sharding-Proxy's node fuse function can disconnect the connection between the node and the data source interface. After the disconnection, the data source interface can be reconnected to another node without affecting the operation of the Sharding-Proxy cluster instance and solving the data blocking problem.
[0084] S1033, the management platform updates the configuration information of the internal nodes of the Sharding-Proxy cluster instance, where the configuration information is used to indicate the data source to which the internal nodes are connected;
[0085] S1034, the management platform adds and deletes internal nodes of the Sharding-Proxy cluster instance;
[0086] The monitoring component monitors the resource usage of the Sharding-Proxy cluster instance, including:
[0087] The monitoring component obtains a monitoring interface through the management platform;
[0088] In this embodiment, the management platform uses Kubernetes, which has many reserved interfaces, including monitoring interfaces. The monitoring component uses Prometheus, an open source monitoring tool that combines monitoring, alarming, and time series databases. The basic principle of Prometheus is to periodically capture the status of monitored components through the HTTP protocol, which is very suitable for virtualized environments such as VMs or Docker.
[0089] The monitoring component monitors the resource usage status of the Sharding-Proxy cluster instance based on the monitoring interface.
[0090] By connecting to the monitoring interface reserved on Kubernetes, Prometheus can monitor the resource usage status of the Sharding-Proxy cluster instance.
[0091] S104: In response to the termination request for the Sharding-Proxy cluster instance, the management platform stops the operation of the Sharding-Proxy cluster instance and deletes the Sharding-Proxy cluster instance to release resources configured for the Sharding-Proxy cluster.
[0092] The containerization method further includes: the management platform mirroring the configured Sharding-Proxy cluster into multiple Sharding-Proxy cluster instances and starting them;
[0093] When the multiple Sharding-Proxy cluster instances are running, the management platform monitors and maintains the multiple Sharding-Proxy cluster instances respectively.
[0094] By deploying multiple Sharding-Proxy cluster instances on the management platform, they can be managed simultaneously through the management platform, achieving the goal of containerized middleware deployment. This allows for the reuse of common container functions. While different middleware, such as Redis, Kafka, and RokectMQ, may require slightly different API calls, most of the methods in this embodiment are universal. Furthermore, Prometheus is used to implement universal resource usage monitoring. Based on the open interfaces of different middleware and Prometheus interface expressions, specific middleware metrics can be monitored, such as the number of transactions processed per unit time and the number of requests per unit time.
[0095] In this embodiment, when deploying a Sharding-Proxy cluster in a containerized manner, first, a Sharding-Proxy cluster image is created on the management platform, and resources are configured for the Sharding-Proxy cluster through the image. Then, a Sharding-Proxy cluster instance is initialized and generated on the management platform. While the Sharding-Proxy cluster instance is running, the management platform can monitor and maintain the Sharding-Proxy cluster instance. Finally, the management platform terminates the Sharding-Proxy cluster instance and releases the resources configured for the Sharding-Proxy cluster. Through the above process, the entire life cycle of a Sharding-Proxy cluster on the management platform can be completed. Based on the entire life cycle of the Sharding-Proxy cluster, the effect of containerized deployment of the Sharding-Proxy cluster on the management platform can be achieved. In addition, the operation and maintenance complexity is reduced, and combined with the unified monitoring of Prometheus, the troubleshooting and resolution of operation and maintenance problems are facilitated.
[0096] Example 3
[0097] Based on the same inventive concept, Figure 2 A schematic diagram of a containerized device based on Sharding-Proxy is shown, referring to Figure 2As shown, the device may include: a configuration module, an initialization module, a monitoring module, an end module and a multi-task deployment module:
[0098] A configuration module is used to obtain the image of the Sharding-Proxy cluster from the management platform and configure the resources of the Sharding-Proxy cluster based on the image; the resources include the maximum resource quota of the cluster, the number of nodes in the cluster, the CPU allocation in each node, the memory allocation in each node, and the disk allocation in each node;
[0099] an initialization module, configured to create a Sharding-Proxy cluster instance on the management platform; and initialize the Sharding-Proxy cluster instance based on the configured resources of the Sharding-Proxy cluster image to start the Sharding-Proxy cluster instance;
[0100] A monitoring module, configured to enable the management platform to monitor and maintain the Sharding-Proxy cluster instance when the Sharding-Proxy cluster instance is running;
[0101] an end module, in response to a termination request for the Sharding-Proxy cluster instance, causing the management platform to stop the operation of the Sharding-Proxy cluster instance and delete the Sharding-Proxy cluster instance to release resources configured for the Sharding-Proxy cluster;
[0102] The multi-task deployment module is used to mirror the Sharding-Proxy cluster mirror completed by the configuration on the management platform into multiple Sharding-Proxy cluster instances and start them; when the multiple Sharding-Proxy cluster instances are running, the management platform monitors and maintains the multiple Sharding-Proxy cluster instances respectively.
[0103] The monitoring module includes a switching unit, a fuse unit, an updating unit, a modifying unit and a monitoring unit, wherein:
[0104] A switching unit, configured to switch the data source configuration of the Sharding-Proxy cluster instance on the management platform;
[0105] A circuit breaker unit, used by the management platform to perform circuit breaking on internal nodes of the Sharding-Proxy cluster instance;
[0106] An updating unit, configured for the management platform to update configuration information of an internal node of the Sharding-Proxy cluster instance, wherein the configuration information is used to indicate a data source to which the internal node is connected;
[0107] A modification unit, configured for the management platform to add and delete internal nodes of the Sharding-Proxy cluster instance;
[0108] A monitoring unit is used for the monitoring component to monitor resource usage of the Sharding-Proxy cluster instance.
[0109] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0110] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0111] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0112] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0113] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0114] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0115] Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic inventive concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0116] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.
[0117] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. The containerization method based on Sharding-Proxy is characterized by: The method comprises: The management platform obtains the image of the Sharding-Proxy cluster and configures the resources of the Sharding-Proxy cluster based on the image; the resources include the maximum resource quota of the cluster, the number of nodes in the cluster, the CPU allocation in each node, the memory allocation in each node, and the disk allocation in each node; The management platform creates a Sharding-Proxy cluster instance; and initializes the Sharding-Proxy cluster instance based on the configured resources of the Sharding-Proxy cluster image to start the Sharding-Proxy cluster instance; When the Sharding-Proxy cluster instance is running, the management platform monitors and maintains the Sharding-Proxy cluster instance; In response to the termination request for the Sharding-Proxy cluster instance, the management platform stops the operation of the Sharding-Proxy cluster instance and deletes the Sharding-Proxy cluster instance to release resources configured for the Sharding-Proxy cluster.
2. The method according to claim 1, characterized in that The management platform obtains the image of the Sharding-Proxy cluster and configures the resources of the Sharding-Proxy cluster based on the image, including: The management platform obtains the download interface of the Sharding-Proxy cluster, downloads the Sharding-Proxy cluster based on the download interface, and creates a mirror of the Sharding-Proxy cluster; The management platform obtains the resource quota of the Sharding-Proxy cluster instance, where the resource quota includes the number of nodes of the Sharding-Proxy cluster instance, the CPU of each node, the memory size of each node, and the disk size of each node; The management platform configures the resources of the Sharding-Proxy cluster based on the resource quota of the Sharding-Proxy cluster instance.
3. The method according to claim 2, characterized in that The management platform creates a Sharding-Proxy cluster instance; and initializes the Sharding-Proxy cluster instance based on the configured resources of the Sharding-Proxy cluster image to start the Sharding-Proxy cluster instance, including: The management platform obtains the first data source interface of each node in the Sharding-Proxy cluster instance; The management platform creates a Sharding-Proxy cluster instance and connects the first data source interface to each node in the Sharding-Proxy cluster instance.
4. The method according to claim 1, wherein When the Sharding-Proxy cluster instance is running, the management platform monitors and maintains the Sharding-Proxy cluster instance, including: The management platform switches the data source configuration of the Sharding-Proxy cluster instance; The management platform performs circuit breaking on the internal nodes of the Sharding-Proxy cluster instance; The management platform updates the configuration information of the internal nodes of the Sharding-Proxy cluster instance, where the configuration information is used to indicate the data source to which the internal nodes are connected; The management platform adds and deletes internal nodes of the Sharding-Proxy cluster instance; The monitoring component monitors resource usage of the Sharding-Proxy cluster instance.
5. The method according to claim 4, characterized in that The management platform switches the data source configuration of the Sharding-Proxy cluster instance, including: The management platform obtains the second data source interface of each node in the Sharding-Proxy cluster instance; The management platform connects the second data source interface to each node in the Sharding-Proxy cluster instance.
6. The method according to claim 4, characterized in that The management platform performs a circuit breaker operation on the internal nodes of the Sharding-Proxy cluster instance, including: The management platform obtains the blocked node in the Sharding-Proxy cluster instance; The management platform disconnects the blocked node in the Sharding-Proxy cluster instance, and connects the data source interface connected to the blocked node in the Sharding-Proxy cluster instance to another node in the Sharding-Proxy cluster instance.
7. The method according to claim 4, characterized in that The monitoring component monitors resource usage of the Sharding-Proxy cluster instance, including: The monitoring component obtains a monitoring interface through the management platform; The monitoring component monitors the resource usage status of the Sharding-Proxy cluster instance based on the monitoring interface.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: The management platform mirrors the configured Sharding-Proxy cluster into multiple Sharding-Proxy cluster instances and starts them; When the multiple Sharding-Proxy cluster instances are running, the management platform monitors and maintains the multiple Sharding-Proxy cluster instances respectively.
9. The containerized device based on Sharding-Proxy is characterized by: Including configuration module, initialization module, monitoring module and end module: A configuration module is used to obtain the image of the Sharding-Proxy cluster from the management platform and configure the resources of the Sharding-Proxy cluster based on the image; the resources include the maximum resource quota of the cluster, the number of nodes in the cluster, the CPU allocation in each node, the memory allocation in each node, and the disk allocation in each node; an initialization module, configured to create a Sharding-Proxy cluster instance on the management platform; and initialize the Sharding-Proxy cluster instance based on the configured resources of the Sharding-Proxy cluster image to start the Sharding-Proxy cluster instance; A monitoring module, configured to enable the management platform to monitor and maintain the Sharding-Proxy cluster instance when the Sharding-Proxy cluster instance is running; The termination module, in response to the termination request for the Sharding-Proxy cluster instance, stops the operation of the Sharding-Proxy cluster instance and deletes the Sharding-Proxy cluster instance to release the resources configured for the Sharding-Proxy cluster.
Citation Information
Patent Citations
Method and device for deploying distributed container cluster for application and executing application
CN108572867A
System for improving availability of database
CN113656383A