A database agent service adding method, device, equipment and storage medium
By automating the deployment of database and proxy service containers in a Kubernetes cluster, the problem of cumbersome and inefficient proxy service addition steps in existing technologies is solved, achieving the effects of simplifying steps, reducing error rates, and improving efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUHAN DAMENG DATABASE
- Filing Date
- 2023-05-10
- Publication Date
- 2026-04-28
AI Technical Summary
The existing methods for adding database proxy services are cumbersome, error-prone, and inefficient, making them inconvenient for subsequent maintenance.
In a Kubernetes cluster, by detecting the proxy service addition event, the target proxy service image is determined, and a preset database image and the target proxy service image are run in the same container set. The database and proxy service containers are then started to achieve automated deployment of the proxy service.
It simplifies the process of adding a database proxy service, reduces the error rate, improves deployment efficiency, and facilitates subsequent maintenance.
Smart Images

Figure CN116527761B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of database technology, and in particular to a method, apparatus, device, and storage medium for adding database proxy services. Background Technology
[0002] In recent years, the volume of network data has exploded. To meet the demands of processing and storing massive amounts of data, database clusters have emerged and quickly gained popularity among enterprises, effectively improving database reliability and performance. However, when the number of nodes in a database cluster becomes too large, a database proxy service needs to be added to monitor them.
[0003] Existing methods for adding database proxy services typically involve adding the database proxy to the container containing the database via plugins or scripts. However, this method is cumbersome, error-prone, inefficient, and inconvenient for subsequent maintenance. Summary of the Invention
[0004] This invention provides a method, apparatus, device, and storage medium for adding database proxy services, to solve the problems of existing methods for adding database proxy services being cumbersome, error-prone, inefficient, and inconvenient for subsequent maintenance.
[0005] According to one aspect of the present invention, a method for adding a database proxy service is provided, comprising:
[0006] The event of adding a proxy service to the preset database was detected. The target proxy service image was determined. The preset database is deployed in a Kubernetes cluster. The proxy service is used to interact with the monitoring system corresponding to the preset database.
[0007] Within the same set of containers, the database container of the target database node is started by running a preset database image, and the proxy service container corresponding to the target database node is started by running the target proxy service image.
[0008] According to another aspect of the present invention, a database proxy service adding apparatus is provided, comprising:
[0009] The image determination module is used to detect when the proxy service addition event of the preset database is triggered and determine the target proxy service image. The preset database is deployed in a Kubernetes cluster, and the proxy service is used to interact with the monitoring system corresponding to the preset database.
[0010] The container startup module is used to start the database container of the target database node by running a preset database image, and to start the corresponding proxy service container of the target database node by running the target proxy service image, within the same container set.
[0011] According to another aspect of the present invention, a database proxy service adding device is provided, the database proxy service adding device comprising:
[0012] At least one processor; and
[0013] A memory that is communicatively connected to at least one processor; wherein,
[0014] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform the database proxy service addition method according to any embodiment of the present invention.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the database proxy service adding device method of any embodiment of the present invention.
[0016] The technical solution of this invention determines the target proxy service image by detecting the triggering of a proxy service addition event for a preset database. The preset database is deployed in a Kubernetes cluster, and the proxy service interacts with the monitoring system corresponding to the preset database. Within the same container set, the database container of the target database node is started by running the preset database image, and the proxy service container corresponding to the target database node is started by running the target proxy service image. By adopting the above technical solution, the proxy service is deployed in a separate container, and the proxy service container is started by running an image. The proxy service container and the corresponding database node are in the same container set (also known as a pod). Within the same pod, containers can enjoy the same lifecycle. Therefore, while starting the database container of the target database node through the preset database image, the proxy service container corresponding to the target database node can also be started through the target proxy service image. This solves the problems of cumbersome steps, high error rates, and low deployment efficiency in existing database proxy service addition methods, achieving the beneficial effects of simplifying the steps for adding database proxy services, reducing the error rate, effectively improving the efficiency of proxy service deployment, and facilitating subsequent maintenance.
[0017] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of a method for adding a database proxy service according to Embodiment 1 of the present invention;
[0020] Figure 2 This is a flowchart of a method for adding a database proxy service according to Embodiment 2 of the present invention;
[0021] Figure 3 This is a flowchart of a method for adding a database proxy service according to Embodiment 3 of the present invention;
[0022] Figure 4 This is a schematic diagram of a database proxy service adding device provided in Embodiment 4 of the present invention;
[0023] Figure 5 This is a schematic diagram of the structure of a database proxy service adding device provided in Embodiment 5 of the present invention. Detailed Implementation
[0024] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] Example 1
[0027] Figure 1 This is a flowchart illustrating a method for adding a database proxy service according to Embodiment 1 of the present invention. This embodiment is applicable to situations where a database management system monitors the database status and running nodes. The method can be executed by a database proxy service adding device, which can be implemented in hardware and / or software. This device can be configured within a database proxy service adding equipment, such as a remote host, which can be configured as a database node. Figure 1 As shown, the method includes:
[0028] S101. The default database proxy service addition event is detected and the target proxy service image is determined.
[0029] The default database is deployed in a Kubernetes cluster, and the proxy service is used to interact with the monitoring system corresponding to the default database.
[0030] In this embodiment, the preset database can be understood as a warehouse that organizes, stores, and manages data according to a data structure, such as DM Database. A Kubernetes cluster is a group of node computers used to run containerized applications, automating the deployment, scaling, and management of containers. The monitoring system may include a centralized management platform that monitors, manages, and maintains the database through a web interface, such as DM Enterprise Management System. The proxy service may include an agent deployed on a remote machine corresponding to the monitoring system. The monitoring system accesses the remote host through the proxy service and monitors the remote host.
[0031] In this embodiment, the target proxy service image can be understood as a lightweight, executable proxy service software package. The image contains the contents required to run the proxy service, such as libraries, environment variables, and configuration files.
[0032] For example, the "add proxy service for the preset database" event can be understood as an event that requires adding a proxy service to the preset database. The triggering conditions for this event can be set according to actual needs. After this event is triggered, it is confirmed that a proxy service needs to be added to the preset database, and the target proxy service image used to add the proxy service is determined.
[0033] Optionally, before determining the proxy service image, a text file for building the image can be used to create the proxy service image. For example, the proxy service image can be created by writing a Dockerfile (image description file). The creation process is as follows: (1) Determine the relevant information of the proxy service image, including the base image and the image creator information; (2) Prepare the proxy service related files, including the target proxy service package (which can be understood as the proxy service installation file, for example, the dmagent package for DM database), the JDK package of the JAVA environment and related script files. The script files include the main script file dmagent.sh, in which all configuration work for the proxy service is done; (3) After initializing the container, run the main script file to complete the configuration and startup of the JAVA environment and the proxy service; (4) Create the proxy service image using the dockerbuild command.
[0034] S102. Within the same container set, start the database container of the target database node by running the preset database image, and start the proxy service container corresponding to the target database node by running the target proxy service image.
[0035] In this embodiment, the same set of containers can be understood as a pod in a Kubernetes cluster, used to deploy applications. A pod can contain one or more containers and share the same network namespace and storage volume. A preset database image can be understood as a lightweight, executable database package containing everything needed to run the database, such as libraries, environment variables, and configuration files. A database container can be understood as a running instance created from the database image, i.e., the main container in the pod. A proxy service container can be understood as a running instance created from the proxy service image, i.e., a slave container in the pod.
[0036] Specifically, within a pod, master and slave containers have the same lifecycle. When the database container on the corresponding node of the Kubernetes cluster starts running the preset database image, the relevant information of the agent service container is automatically loaded and started. Synchronously, the agent service container on that node can be started in sidecar mode by running the target agent service image.
[0037] The technical solution of this invention determines the target proxy service image by detecting the triggering of a proxy service addition event for a preset database. The preset database is deployed in a Kubernetes cluster, and the proxy service interacts with the monitoring system corresponding to the preset database. Within the same container set, the database container of the target database node is started by running the preset database image, and the proxy service container corresponding to the target database node is started by running the target proxy service image. By adopting the above technical solution, the proxy service is deployed in a separate container, and the proxy service container is started by running an image. Since the proxy service container and the corresponding database node are in the same container set and the same pod, the containers can enjoy the same lifecycle. Therefore, while starting the database container of the target database node through the preset database image, the proxy service container corresponding to the target database node can also be started through the target proxy service image. This solves the problems of cumbersome steps, high error rates, and low deployment efficiency in existing database proxy service addition methods, achieving the beneficial effects of simplifying the steps for adding database proxy services, reducing the error rate, effectively improving the efficiency of proxy service deployment, and facilitating subsequent maintenance.
[0038] In some embodiments, the preset database includes at least one of a single-machine database, a master-slave database cluster, and a distributed database cluster. This gives the method strong generalization ability, effectively improving its practicality and scope of application.
[0039] In this embodiment, a single-machine database can be understood as a database deployed on a single server, with the single-machine database and its corresponding proxy service deployed in the same pod. A master-slave database cluster can be understood as utilizing at least two database servers to form a virtual single database logical image, providing transparent data services to clients like a single database system. The master database node and its corresponding proxy service are deployed in the same pod, and each slave database node and its corresponding proxy service are deployed in the same pod; that is, the number of pods, the number of database nodes, and the number of proxy service containers are the same. A distributed database cluster can be understood as each node in a distributed database forming a database cluster. A fractional database can be understood as a group of logically interconnected databases distributed across a computer network, with the number of pods, the number of database nodes, and the number of proxy service containers being the same.
[0040] Specifically, the preset database can be deployed on different architectures such as a single server, a multi-server cluster, or a distributed cluster, and the corresponding proxy service for the database can also be started on these architectures. This embodiment does not limit the architecture type.
[0041] Example 2
[0042] Figure 2 This is a flowchart of a method for adding a database proxy service according to Embodiment 2 of the present invention. This embodiment optimizes and extends the above-mentioned optional embodiments. This embodiment further optimizes step S102, describing in detail how to start the proxy service container corresponding to the target database node by running the target proxy service image, such as... Figure 2 As shown, the method includes:
[0043] S201. The default database proxy service addition event is detected to be triggered, and the target proxy service image is determined.
[0044] S202. Start the database container of the target database node by running the preset database image.
[0045] S203. Run the target proxy service image in the initialized proxy service container corresponding to the target database node, pass the address information of the monitoring system into the proxy service container, configure the runtime environment of the proxy service, decompress the proxy service installation file, write the address information of the monitoring system into the proxy service configuration, and start the proxy service.
[0046] In this embodiment, the purpose of initializing the container is to perform some preprocessing work before the proxy service container runs. The address information of the monitoring system may include the service IP exposed by the pod where the monitoring system resides, i.e., dem_ip. Configuring the runtime environment of the proxy service may include configuring the Java environment, for example, setting parameters such as JAVA_HOME and PATH. Unzipping the proxy service installation files includes the dmagent package, etc.
[0047] For example, in a Kubernetes environment, when it is determined that a proxy service will be added at the same time as starting the database container on the target database node, the container in the pod corresponding to that node will be initialized first. Then, by running the target proxy service image, the address information dem_ip corresponding to the monitoring system will be automatically passed into the initialized proxy service container, and the relevant Java environment parameters will be automatically modified. At the same time, the dmagent package will be decompressed, and the corresponding parameters in agent.ini will be modified to the address information of the monitoring system, thereby automatically starting the proxy service container.
[0048] The database proxy service addition scheme provided in this embodiment of the invention, after determining the target proxy service image, initializes the proxy service container and automatically completes the process of passing the monitoring system's address information, configuring the proxy service's runtime environment, and decompressing the proxy service installation files into the proxy service container. Simultaneously, it automatically writes the monitoring system's address information into the proxy service configuration and then starts the proxy service. By adopting the above technical solution, automatic deployment of the proxy service container can be achieved, effectively reducing the error rate of adding proxy services.
[0049] In some embodiments, passing the address information of the monitoring system into the proxy service container includes: obtaining the address information of the monitoring system by reading a preset configuration file and passing the address information of the monitoring system into the proxy service container. This enables the monitoring system to accurately locate the proxy service container corresponding to the preset database, realizing the interaction between the monitoring system and the proxy service container.
[0050] In this embodiment, the preset configuration file can be understood as a YAML file in the chart repository, used to deploy the agent service image. This file may contain information such as the agent service image version parameter (dmagent_image), the agent service enable / disable switch (dmagent_is_need), and the service IP exposed by the monitoring system pod (dem_ip). Taking the chart repository of a primary / standby cluster as an example, when deploying a primary / standby cluster using the Helm command on Kubernetes, the deployment command is 'helm install dmwatcher –n dameng. / dmwatcher'. The files under the dmwatcher path are the contents of the chart repository, and their structure is as follows:
[0051] Chart.yaml
[0052] NOTES.txt
[0053] README.md
[0054] templates (folder)
[0055] _helpers.tpl
[0056] monitor-node-deployment.yaml
[0057] monitor-node-service.yaml
[0058] primary-node-deployment.yaml
[0059] primary-node-service.yaml
[0060] standby-node-deployment.yaml
[0061] standby-node-service.yaml
[0062] values.yaml
[0063] The aforementioned YAML files include `values.yaml`, which contains global settings for deploying the master-slave cluster, and `templates.deployment`, which defines basic information about the master database container. In `values.yaml`, you can add parameters such as the proxy service image version (`dmagent_image`), the proxy service enable / disable switch (`dmagent_is_need`), and the service IP exposed by the monitoring system pod (`dem_ip`). In the `deployment` resource YAML template file within the `templates` path, at the same level as the master container, you can add proxy service container settings, including checks for proxy service startup, the proxy service image used, and the monitoring system's service IP.
[0064] Specifically, in the YAML file set before the proxy service is deployed, find the service IP (dem_ip) information exposed by the pod where the monitoring system is located, and load this information into the initialized proxy service container.
[0065] In some embodiments, determining the target proxy service image includes: determining the target proxy service image by reading the proxy service image version information in a preset configuration file.
[0066] For example, after creating the target proxy service image, its version information can be added to the yaml file. Then, by reading the proxy service image version information in the yaml file, the target proxy service image corresponding to the database can be determined.
[0067] Example 3
[0068] Figure 3 This is a flowchart of a method for adding a database proxy service according to Embodiment 3 of the present invention. This embodiment optimizes and extends the above-mentioned optional embodiments. This embodiment further optimizes step S101, where the triggering of the proxy service addition event for the preset database can include at least one of the following two situations: the first is when deploying the preset database (receiving a preset deployment command for the preset database), and the second is when the pod restarts. When both situations are present, the target proxy service image is further determined when either situation occurs, and the proxy service container is automatically started. Figure 3 As shown, the method includes:
[0069] S301. After receiving the preset deployment command for the preset database, read the preset configuration file. When it is determined that the preset configuration file contains agent service start information, it is determined that the agent service add event of the preset database has been triggered.
[0070] In this embodiment, the pre-deployment command includes commands for deploying applications on the Kubernetes cluster. For example, the pre-deployment command may include the helm command or the kubectl command.
[0071] For example, on a Kubernetes cluster, when the database agent service device receives a command to deploy a preset database using Helm, it reads the agent service enable / disable information (dmagent_is_need) from the YAML file. If its value is true, it means that the agent service needs to be deployed simultaneously with the database deployment. Optionally, if its value is false, only the database container of the target database node can be started.
[0072] S302. Determine the target proxy service image.
[0073] S303. Within the same container set, start the database container of the target database node by running a preset database image, and start the proxy service container corresponding to the target database node by running the target proxy service image.
[0074] S304. When the target container set containing the proxy service container is detected to be restarted, it is determined that the proxy service addition event of the preset database has been triggered.
[0075] In this embodiment, the target container set can be understood as the set of containers that have currently restarted. For example, if a pod containing a slave database node in a master-slave database cluster restarts, then that pod becomes the target container set. The number of target container sets can be one or more.
[0076] For example, in a pod, when the database container, as the main container, unexpectedly exits and causes the pod to restart, the proxy service container, as the slave container, can restart along with the main container.
[0077] S305. Determine the target proxy service image.
[0078] S306. Within the same set of target containers, start the database container of the target database node by running a preset database image, and start the proxy service container corresponding to the target database node by running the target proxy service image.
[0079] In this context, the target database node is the database node in the target container set that has been restarted.
[0080] The database proxy service provided in this embodiment of the invention can determine the target proxy service image in both the initial deployment of the database node and the restart of the pod where the database node resides, and starts the proxy service container simultaneously with the database container. By adopting the above technical solution, and considering various possible scenarios that may trigger the preset database proxy service addition event, the applicability of the method can be effectively improved, while also enhancing the convenience of maintenance.
[0081] Example 4
[0082] Figure 4 This is a schematic diagram of a database proxy service adding device provided in Embodiment 4 of the present invention. Figure 4 As shown, the device includes: an image determination module 41 and a container startup module 42.
[0083] in:
[0084] Image determination module 41 is used to detect when the proxy service addition event of the preset database is triggered and determine the target proxy service image. The preset database is deployed in a Kubernetes cluster, and the proxy service is used to interact with the monitoring system corresponding to the preset database. Container startup module 42 is used to start the database container of the target database node by running the preset database image and the proxy service container corresponding to the target database node by running the target proxy service image within the same container set.
[0085] The technical solution provided by the embodiments of the present invention solves the problems of cumbersome steps, easy errors and low deployment efficiency of existing database proxy service addition methods. It simplifies the steps of adding database proxy services, reduces the error rate, effectively improves the deployment efficiency of proxy services, and facilitates subsequent maintenance.
[0086] Optionally, the container startup module 42 includes:
[0087] The database container startup subunit is used to start the database container of the target database node by running a preset database image.
[0088] The proxy service container startup subunit is used to start the proxy service container corresponding to the target database node by running the target proxy service image.
[0089] Optionally, the proxy service container startup subunit is specifically used to run the target proxy service image in the initialized proxy service container corresponding to the target database node, pass in the address information of the monitoring system, configure the runtime environment of the proxy service, decompress the proxy service installation file, write the address information of the monitoring system into the proxy service configuration, and start the proxy service.
[0090] Optionally, the address information of the monitoring system can be passed into the proxy service container, including: obtaining the address information of the monitoring system by reading a preset configuration file and passing the address information of the monitoring system into the proxy service container.
[0091] Optionally, the mirror determination module 41 includes:
[0092] The event detection unit is used to detect whether the proxy service addition event in the preset database has been triggered.
[0093] The proxy service image determination unit is used to determine the target proxy service image when a proxy service addition event for a preset database is triggered.
[0094] Optionally, the event detection unit includes a first detection unit, which is specifically used to read a preset configuration file after receiving a preset deployment command from a preset database, and determine that a proxy service addition event of the preset database has been triggered when the preset configuration file contains proxy service start information.
[0095] Optionally, the event detection unit includes a second detection subunit, which is specifically used to determine that a proxy service addition event of a preset database is triggered when the target container set containing the proxy service container restarts; wherein, within the same container set, it is included within the same target container set.
[0096] Optionally, the target proxy service image is determined, including: determining the target proxy service image by reading the proxy service image version information in the preset configuration file.
[0097] Optionally, the default database includes at least one of the following: a single-machine database, a master-slave database cluster, and a distributed database cluster.
[0098] The database proxy service adding device provided in this embodiment of the invention can execute the database proxy service adding method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0099] Example 5
[0100] Figure 5This is a schematic diagram of a database proxy service adding device provided in Embodiment 5 of the present invention. The database proxy service adding device can be an electronic device, intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0101] like Figure 5 As shown, the electronic device 50 includes at least one processor 51 and a memory, such as a read-only memory (ROM) 52 and a random access memory (RAM) 53, communicatively connected to the at least one processor 51. The memory stores computer programs executable by the at least one processor. The processor 51 can perform various appropriate actions and processes based on the computer program stored in the ROM 52 or loaded into the RAM 53 from storage unit 58. The RAM 53 can also store various programs and data required for the operation of the electronic device 50. The processor 51, ROM 52, and RAM 53 are interconnected via a bus 54. An input / output (I / O) interface 55 is also connected to the bus 54.
[0102] Multiple components in electronic device 50 are connected to I / O interface 55, including: input unit 56, such as keyboard, mouse, etc.; output unit 57, such as various types of monitors, speakers, etc.; storage unit 58, such as disk, optical disk, etc.; and communication unit 59, such as network card, modem, wireless transceiver, etc. Communication unit 59 allows electronic device 50 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0103] Processor 51 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 51 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 51 performs the various methods and processes described above, such as the database agent service addition method.
[0104] In some embodiments, the database proxy service addition method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 58. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 50 via ROM 52 and / or communication unit 59. When the computer program is loaded into RAM 53 and executed by processor 51, one or more steps of the database proxy service addition method described above may be performed. Alternatively, in other embodiments, processor 51 may be configured to perform the database proxy service addition method by any other suitable means (e.g., by means of firmware).
[0105] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0106] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0107] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0108] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0109] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0110] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0111] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and no limitation is imposed herein.
[0112] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for adding a database proxy service, characterized in that, include: The system detects that a proxy service addition event for a preset database has been triggered, and determines the target proxy service image. The preset database is deployed in a Kubernetes cluster, and the proxy service is used to interact with the monitoring system corresponding to the preset database. Within the same set of containers, the database container of the target database node is started by running a preset database image, and the proxy service container corresponding to the target database node is started by running the target proxy service image. The step of starting the proxy service container corresponding to the target database node by running the target proxy service image includes: By running the target proxy service image in the initialized proxy service container corresponding to the target database node, the address information of the monitoring system is passed in, the runtime environment of the proxy service is configured, the proxy service installation file is decompressed, the address information of the monitoring system is written into the proxy service configuration, and the proxy service is started.
2. The method according to claim 1, characterized in that, The address information of the monitoring system is passed into the proxy service container, including: The address information of the monitoring system is obtained by reading the preset configuration file, and then the address information of the monitoring system is passed into the proxy service container.
3. The method according to claim 1, characterized in that, The detection of a proxy service addition event in the preset database being triggered includes: Upon receiving a preset deployment command for a preset database, the system reads a preset configuration file. If the preset configuration file contains proxy service activation information, the system determines that a proxy service addition event for the preset database has been triggered.
4. The method according to claim 1, characterized in that, The detection of a proxy service addition event in the preset database being triggered includes: When the target container set containing the proxy service container is detected to be restarted, it is determined that the proxy service addition event of the preset database has been triggered. Wherein, "within the same container set" includes "within the same target container set".
5. The method according to claim 1, characterized in that, The determination of the target proxy service image includes: The target proxy service image is determined by reading the proxy service image version information in the preset configuration file.
6. The method according to any one of claims 1-5, characterized in that, The preset database includes at least one of the following: a single-machine database, a primary-standby database cluster, and a distributed database cluster.
7. A database proxy service adding device, characterized in that, include: The image determination module is used to detect when the proxy service addition event of the preset database is triggered and determine the target proxy service image. The preset database is deployed in a Kubernetes cluster, and the proxy service is used to interact with the monitoring system corresponding to the preset database. The container startup module is used to start the database container of the target database node by running a preset database image within the same container set, and to start the proxy service container corresponding to the target database node by running a target proxy service image. The container startup module includes: The proxy service container startup subunit is used to run the target proxy service image in the initialized proxy service container corresponding to the target database node, pass in the address information of the monitoring system, configure the runtime environment of the proxy service, decompress the proxy service installation file, write the address information of the monitoring system into the proxy service configuration, and start the proxy service.
8. A database proxy service adding device, characterized in that, The database proxy service adds devices including: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the database proxy service addition method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the database proxy service addition method according to any one of claims 1-6.
Citation Information
Patent Citations
Containerization method and device based on Sharding-Proxy
CN114416300A
System operation and maintenance management method and device and electronic equipment
CN115297124A