CN116527761A - Database proxy service adding method, device, equipment and storage medium - Google Patents

Database proxy service adding method, device, equipment and storage medium Download PDF

Info

Publication number
CN116527761A
CN116527761A CN202310525136.3A CN202310525136A CN116527761A CN 116527761 A CN116527761 A CN 116527761A CN 202310525136 A CN202310525136 A CN 202310525136A CN 116527761 A CN116527761 A CN 116527761A
Authority
CN
China
Prior art keywords
proxy service
database
target
container
preset
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
CN202310525136.3A
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.)
Wuhan Dream Database Co ltd
Original Assignee
Wuhan Dream Database 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 Wuhan Dream Database Co ltd filed Critical Wuhan Dream Database Co ltd
Priority to CN202310525136.3A priority Critical patent/CN116527761A/en
Publication of CN116527761A publication Critical patent/CN116527761A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • 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/45575Starting, stopping, suspending or resuming virtual machine instances
    • 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/45595Network integration; Enabling network access in virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a database proxy service adding method, a device, equipment and a storage medium, which detect that a proxy service adding event of a preset database is triggered, and determine a target proxy service mirror image, wherein the preset database is deployed in a Kubernetes cluster, and proxy service is used for interacting with a monitoring system corresponding to the preset database; and starting the database container of the target database node by running the preset database mirror image and starting the proxy service container corresponding to the target database node by running the target proxy service mirror image in the same container set. By adopting the technical scheme, the problems that the existing database proxy service adding method is complex in steps, easy to make mistakes, low in deployment efficiency and inconvenient to maintain later are solved, and the beneficial effects that the database proxy service adding step is simplified, the error rate is reduced, the deployment proxy service efficiency is effectively improved, and the subsequent maintenance is convenient are achieved.

Description

Database proxy service adding method, device, equipment and storage medium
Technical Field
The present invention relates to the field of database technologies, and in particular, to a method, an apparatus, a device, and a storage medium for adding a database proxy service.
Background
In recent years, the network data volume is increased in an explosive manner, so that in order to meet the processing and storage requirements of massive data, database clusters are generated and are favored by enterprises rapidly, and the reliability and the performance of the databases are improved effectively. And when the number of nodes in the database cluster is excessive, a database proxy service needs to be added to monitor the nodes.
The existing database proxy service adding method generally realizes the addition of the database service proxy to the container where the database is located in the form of plug-in or script, but the method adds the database proxy service, which has complicated steps, is easy to make mistakes, has low efficiency and is inconvenient for subsequent maintenance.
Disclosure of Invention
The invention provides a database proxy service adding method, a device, equipment and a storage medium, which are used for solving the problems that the existing database proxy service adding method is complex in steps, easy to make mistakes, low in efficiency and inconvenient to follow-up maintenance.
According to an aspect of the present invention, there is provided a database proxy service adding method, including:
detecting that a proxy service adding event of a preset database is triggered, and determining a target proxy service mirror image, wherein the preset database is deployed in a Kubernetes cluster, and the proxy service is used for interacting with a monitoring system corresponding to the preset database;
and starting the database container of the target database node by running the preset database mirror image and starting the proxy service container corresponding to the target database node by running the target proxy service mirror image in the same container set.
According to another aspect of the present invention, there is provided a database proxy service adding apparatus including:
the image determining module is used for detecting that a proxy service adding event of a preset database is triggered and determining a target proxy service image, wherein the preset database is deployed in a Kubernetes cluster, and the proxy service is used for interacting with a monitoring system corresponding to the preset database;
and the container starting module is used for starting the database container of the target database node by running the preset database mirror image and starting the proxy service container corresponding to the target database node by running the target proxy service mirror image in the same container set.
According to another aspect of the present invention, there is provided a database proxy service adding apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the database proxy service addition method of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the database proxy service addition apparatus method of any of the embodiments of the present invention when executed.
According to the technical scheme, the target proxy service mirror image is determined by detecting that a proxy service adding event of a preset database is triggered, wherein the preset database is deployed in a Kubernetes cluster, and the proxy service is used for interacting with a monitoring system corresponding to the preset database; and starting the database container of the target database node by running the preset database mirror image and starting the proxy service container corresponding to the target database node by running the target proxy service mirror image in the same container set. By adopting the technical scheme, the proxy service is deployed in the independent container, the proxy service container is started in a mirror image running mode, and the proxy service container and the corresponding database node are in the same container set (also called pod), and the containers can share the same life cycle in the same pod, so that the proxy service container corresponding to the target database node can be started through the target proxy service mirror image while the database container of the target database node is started through the preset database mirror image, the problems that the conventional database proxy service adding method is complicated in steps, easy to make mistakes and low in deployment efficiency are solved, the database proxy service adding steps are simplified, the error rate is reduced, the deployment proxy service efficiency is effectively improved, and the follow-up maintenance is facilitated.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for adding a database proxy service according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a database proxy service adding method according to a second embodiment of the present invention;
fig. 3 is a flowchart of a database proxy service adding method according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a database proxy service adding device according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a database proxy service adding device according to a fifth embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a method for adding a database proxy service according to a first embodiment of the present invention, where the method may be applied to a case where a database management system monitors a database state and an operating node, and the method may be performed by a database proxy service adding device, where the database proxy service adding device may be implemented in hardware and/or software, and the database proxy service adding device may be configured in a database proxy service adding device, such as a remote host, and the remote host may be configured as a database node. As shown in fig. 1, the method includes:
s101, detecting that a proxy service adding event of a preset database is triggered, and determining a target proxy service mirror image.
The preset database is deployed in the Kubernetes cluster, and the proxy service is used for interacting with a monitoring system corresponding to the preset database.
In this embodiment, the preset database may be understood as a warehouse, such as a dream database, that organizes, stores and manages data according to a data structure. Kubernetes cluster is a set of node computers for running containerized applications for automating the deployment, expansion, and management of containers. The monitoring system may include a centralized management platform, such as a dream-ready enterprise management system, that monitors, manages, and maintains databases through a web interface. The proxy service may include a proxy deployed on the remote machine corresponding to a monitoring system that accesses the remote host through the proxy service and enables monitoring of the remote host.
In this embodiment, the target proxy service image may be understood as a lightweight, executable proxy service software package containing content required to run the proxy service, such as libraries, environment variables, configuration files, etc. when the proxy service is run.
By way of example, the event of adding proxy service to the preset database may be understood as an event requiring the addition of proxy service to the preset database, and the triggering condition of the event may be set according to the actual requirement. After the event is triggered, confirming that the proxy service needs to be added to the preset database, and determining a target proxy service image for adding the proxy service.
Alternatively, the proxy service image may be made using a text file that builds the image before determining the proxy service image. Illustratively, the proxy service image is manufactured by writing a Dockerf file, and the manufacturing flow is as follows: (1) Determining proxy service image related information, including basic images and image producer information; (2) Preparing proxy service related files including a target proxy service package (which can be understood as a proxy service installation file, taking a dream database as an example, can be recorded as a dmagent package), a jdk package of a JAVA environment and related script files, wherein the script files comprise a master script file dmagent. Sh, and all configuration work on the proxy service is in the dmagent. Sh; (3) After initializing the container, running a main script file to complete the configuration and opening of the JAVA environment and the proxy service; (4) And (5) making a proxy service mirror image, and making the mirror image by using a docker build command.
S102, starting a database container of a target database node by running a preset database mirror image and starting a proxy service container corresponding to the target database node by running a target proxy service mirror image in the same container set.
In this embodiment, the same container set may be understood as a pod in a Kubernetes cluster, where one or more containers may be contained in one pod and share the same network namespace and storage volume for deploying an application. A preset database image is understood to be a lightweight, executable database software package containing all the content needed to run the database, e.g. the content contains libraries, environment variables, configuration files etc. when running the database. A database container can be understood as a running instance created by a database mirror, i.e. a master container in a pod. A proxy service container may be understood as a running instance created by a proxy service image, i.e. a slave container in a pod.
Specifically, in one pod, the master container and the slave container have the same life cycle, when the database container on the corresponding node of the Kubernetes cluster is started up by running the preset database mirror image, the proxy service container can be started up in a sidecar mode by running the target proxy service mirror image on the node synchronously by automatically loading the related information of the proxy service container.
According to the technical scheme, the target proxy service mirror image is determined by detecting that a proxy service adding event of a preset database is triggered, wherein the preset database is deployed in a Kubernetes cluster, and the proxy service is used for interacting with a monitoring system corresponding to the preset database; and starting the database container of the target database node by running the preset database mirror image and starting the proxy service container corresponding to the target database node by running the target proxy service mirror image in the same container set. By adopting the technical scheme, the proxy service is deployed in the independent container, the proxy service container is started in a mirror image running mode, and the proxy service container and the corresponding database nodes are in the same container set, and the same life cycle can be enjoyed among the containers in the same pod, so that the proxy service container corresponding to the target database node can be started through the target proxy service mirror image when the database container of the target database node is started through the preset database mirror image, the problems that the conventional database proxy service adding method is complex in steps, easy to make mistakes and low in deployment efficiency are solved, the steps of adding the database proxy service are simplified, the error rate is reduced, the deployment proxy service efficiency is effectively improved, and the follow-up maintenance is facilitated.
In some embodiments, the preset database comprises: at least one of a stand-alone database, a master-slave database cluster and a distributed database cluster. The method has stronger generalization capability, and the practicability and the application range of the method are effectively improved.
In this embodiment, a stand-alone database is understood to be a database deployed on one server, where the stand-alone database and the corresponding proxy service are deployed in the same pod. The master-slave database cluster can be understood as forming a virtual single database logical image by using at least two database servers, and can provide transparent data services for clients like a single database system, wherein the master database node and the corresponding proxy service are deployed in the same pod, and each slave database node and the corresponding proxy service are deployed in the same pod, namely, the number of pods, the number of database nodes and the number of proxy service containers are consistent. A distributed database cluster is understood to mean that each node in the distributed database is made into a database cluster, wherein a fractional database is understood to mean that the number of pod, the number of database nodes and the number of proxy service containers are identical by a group of logically interrelated databases distributed over a computer network.
Specifically, the preset database may be deployed on a single server, a multi-server cluster, or a distributed cluster, and other different architectures, and then the proxy service corresponding to the database may be started in these architectures. The present embodiment is not limited to the architecture type.
Example two
Fig. 2 is a flowchart of a database proxy service adding method according to a second embodiment of the present invention, where the method is optimized and expanded based on the foregoing alternative embodiments. The present embodiment further optimizes step S102, and expands to describe how to start the proxy service container corresponding to the target database node by running the target proxy service image, as shown in fig. 2, the method includes:
and S201, detecting that a proxy service adding event of a preset database is triggered, and determining a target proxy service mirror image.
S202, starting a database container of the target database node by running a preset database mirror image.
S203, by operating the target proxy service mirror image in the initialized proxy service container corresponding to the target database node, address information of the monitoring system is transmitted into the proxy service container, an operating environment of the proxy service is configured, the proxy service installation file is decompressed, address information of the monitoring system is written into the proxy service configuration, and the proxy service is started.
In this embodiment, the purpose of initializing the container is to do some pre-processing work before the proxy service container runs. The address information of the monitoring system may include service IP, i.e., dem_ip, exposed to the outside of the pod where the monitoring system is located. Configuring the operating environment of the proxy service may include configuring a Java environment, for example, setting parameters of java_home, PATH, etc. The decompressed proxy service installation file includes a dmagent package, etc.
In the Kubernetes environment, for example, when it is determined that a proxy service is added while a target database node starts a database container, the container in the pod corresponding to the node is initialized. And then, by running the target proxy service mirror image, automatically transmitting address information dem_ip corresponding to the monitoring system into the initialized proxy service container, automatically modifying related Java environment parameters, decompressing the agent package, and modifying the corresponding parameters in the agent.
After the target proxy service mirror image is determined, the proxy service container is initialized, address information of a monitoring system, an operating environment for configuring the proxy service and a decompressed proxy service installation file are automatically transmitted into the proxy service container, and meanwhile, address information of the monitoring system is automatically written into the proxy service configuration, so that the proxy service is started. By adopting the technical scheme, the automatic deployment of the proxy service container can be realized, and the error rate of adding proxy service is effectively reduced.
In some embodiments, address information of an incoming monitoring system in a proxy service container includes: and acquiring the address information of the monitoring system by reading the preset configuration file, and transmitting the address information of the monitoring system into the proxy service container. The monitoring system can accurately find the proxy service container corresponding to the preset database, and interaction between the monitoring system and the proxy service container is realized.
In this embodiment, the preset configuration file may be understood as a yaml file in the chart repository file, which is used to deploy the proxy service image. The file may include information such as a proxy image version parameter (dmagent_image), a proxy on switch (dmagent_is_seed), and a service IP (dem_ip) exposed to the outside of the pod where the monitoring system is located. Taking a chart warehouse of a main and standby cluster as an example, when a main and standby cluster is deployed on kuber networks by using a helm command, the deployment command is 'helm install dmwatcher-n segment/dmwatch', and a file under a dmwatch path is the content in the chart warehouse, and the structure is as follows:
Chart.yaml
NOTES.txt
README.md
template (File)
_helpers.tpl
monitor-node-deployment.yaml
monitor-node-service.yaml
primary-node-deployment.yaml
primary-node-service.yaml
standby-node-deployment.yaml
standby-node-service.yaml
values.yaml
The yaml files comprise values.yaml for deploying global settings of the main and standby clusters and yaml files corresponding to depth in templates defining basic information of the main container of the database. The value.yaml file may be added with content such as a proxy service image version parameter (dmagent_image), a proxy service on switch (dmagent_is_need), and a service IP (dem_ip) exposed outwards by the pod where the monitoring system is located; a proxy service container setting is added in the template file of the depth resource yaml in the template path at the same level as the main container, the method comprises the steps of judging whether the proxy service is started or not, and using the service IP of the proxy service mirror image and the monitoring system.
Specifically, service IP (dem_ip) information exposed by the pod where the monitoring system is located is found in a yaml file set before the proxy service deployment, and the information is loaded into an initialized proxy service container.
In some embodiments, determining the target proxy service image includes: and determining the target proxy service image by reading the proxy service image version information in the preset configuration file.
For example, after the target proxy service image is manufactured, version information of the target proxy service image can be added into the yaml file, and then the target proxy service image corresponding to the database is determined by reading the version information of the proxy service image in the yaml file.
Example III
Fig. 3 is a flowchart of a database proxy service adding method according to a third embodiment of the present invention, where the method is optimized and expanded based on the foregoing alternative embodiments. In this embodiment, further optimizing step S101, the triggering of the proxy service addition event of the preset database may include at least one of the following two situations, when the preset database is deployed (when a preset deployment command of the preset database is received), and when the pod is restarted. When the two conditions are included, when any one of the two conditions occurs, the target proxy service mirror image is further determined, and then the proxy service container is automatically started. As shown in fig. 3, the method includes:
s301, after a preset deployment command of a preset database is received, a preset configuration file is read, and when the preset configuration file is determined to contain proxy service starting information, the fact that a proxy service adding event of the preset database is triggered is determined to be detected.
In this embodiment, the pre-deployment command includes a command to deploy an application on the kubernetes cluster, for example, the pre-deployment command may include a helm command or a kubectl command.
For example, on kubernetes cluster, when the database proxy service device receives a deployment preset database using a helm command, proxy service on-off information (dmagent_is_need) in the yaml file is read, and if the value is true, the proxy service is required to be deployed while the database is deployed. Alternatively, if the value is false, only the database container of the target database node may be started.
S302, determining a target proxy service mirror image.
S303, starting a database container of the target database node by running a preset database mirror image and starting a proxy service container corresponding to the target database node by running a target proxy service mirror image in the same container set.
And S304, when the restart of the target container set containing the proxy service container is detected, determining that the proxy service adding event of the preset database is detected to be triggered.
In this embodiment, the target container set may be understood as a container set in which a restart is currently occurring. For example, if a pod of a slave database node in the master/slave database cluster is restarted, the pod becomes the target container set. The number of target container sets may be one or more.
Illustratively, in one pod, when a database container as a master container causes the pod to restart due to unexpected exit, the proxy service container as a slave container can complete the restart along with the master container.
S305, determining the target proxy service mirror image.
S306, starting a database container of the target database node by running a preset database mirror image and starting a proxy service container corresponding to the target database node by running a target proxy service mirror image in the same target container set.
Wherein, the target database node is the database node in the target container set with restart.
The database proxy service provided by the embodiment of the invention can determine the target proxy service mirror image under the conditions of first deployment of the database node and restarting of the pod where the database node is located, and starts the proxy service container by starting the database container. By adopting the technical scheme, the method can be effectively improved in applicability by integrating various conditions which possibly trigger the preset database proxy service addition event, and meanwhile, the convenience of maintenance work is improved.
Example IV
Fig. 4 is a schematic structural diagram of a database proxy service adding device according to a fourth embodiment of the present invention. As shown in fig. 4, the apparatus includes: a mirror determination module 41 and a container start-up module 42.
Wherein:
the mirror image determining module 41 is configured to detect that a proxy service adding event of a preset database is triggered, determine a target proxy service mirror image, where the preset database is deployed in a Kubernetes cluster, and the proxy service is configured to interact with a monitoring system corresponding to the preset database; the container starting module 42 is configured to start, within the same container set, a database container of the target database node by running a preset database mirror image, and a proxy service container corresponding to the target database node by running a target proxy service mirror image.
The technical scheme provided by the embodiment of the invention solves the problems that the existing database proxy service adding method is complex in steps, easy to make mistakes and low in deployment efficiency, simplifies the database proxy service adding steps, reduces the error rate, effectively improves the proxy service deployment efficiency and facilitates subsequent maintenance.
Optionally, the container start module 42 includes:
and the database container starting subunit is used for starting the database container of the target database node by running the preset database mirror image.
And the proxy service container starting subunit is used for starting the proxy service container corresponding to the target database node by running the target proxy service mirror image.
Optionally, the proxy service container starter unit is specifically configured to transmit the address information of the monitoring system into the initialized proxy service container corresponding to the target database node by running the target proxy service image, configure the running environment of the proxy service, decompress the proxy service installation file, write the address information of the monitoring system in the proxy service configuration, and start the proxy service.
Optionally, address information of the monitoring system is transmitted into the proxy service container, including: and acquiring the address information of the monitoring system by reading the preset configuration file, and transmitting the address information of the monitoring system into the proxy service container.
Optionally, the mirror image determining module 41 includes:
and the event detection unit is used for detecting whether the proxy service adding event of the preset database is triggered.
And the proxy service mirror image determining unit is used for determining a target proxy service mirror image when detecting that the proxy service adding event of the preset database is triggered.
Optionally, the event detection unit includes a first detection unit, where the first detection unit is specifically configured to read a preset configuration file after receiving a preset deployment command of a preset database, and determine that a proxy service addition event of the preset database is triggered when determining that the preset configuration file includes proxy service start information.
Optionally, the event detection unit includes a second detection subunit, where the second detection subunit is specifically configured to determine that a proxy service addition event of the preset database is detected to be triggered when a restart of the target container set including the proxy service container is detected; wherein within the same container set, including within the same target container set.
Optionally, determining the target proxy service image includes: and determining the target proxy service image by reading the proxy service image version information in the preset configuration file.
Optionally, the preset database includes: at least one of a stand-alone database, a master-slave database cluster and a distributed database cluster.
The database proxy service adding device provided by the embodiment of the invention can execute the database proxy service adding method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executing method.
Example five
Fig. 5 is a schematic structural diagram of a database proxy service adding device according to a fifth embodiment of the present invention. The database proxy service addition device may be an electronic device intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 50 includes at least one processor 51, and a memory, such as a Read Only Memory (ROM) 52, a Random Access Memory (RAM) 53, etc., communicatively connected to the at least one processor 51, in which the memory stores a computer program executable by the at least one processor, and the processor 51 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 52 or the computer program loaded from the storage unit 58 into the Random Access Memory (RAM) 53. In the RAM 53, various programs and data required for the operation of the electronic device 50 can also be stored. The processor 51, the ROM 52 and the RAM 53 are connected to each other via a bus 54. An input/output (I/O) interface 55 is also connected to bus 54.
Various components in the electronic device 50 are connected to the I/O interface 55, including: an input unit 56 such as a keyboard, a mouse, etc.; an output unit 57 such as various types of displays, speakers, and the like; a storage unit 58 such as a magnetic disk, an optical disk, or the like; and a communication unit 59 such as a network card, modem, wireless communication transceiver, etc. The communication unit 59 allows the electronic device 50 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks.
The processor 51 may be a variety of general and/or special purpose processing components having 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 specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 51 performs the various methods and processes described above, such as the database proxy service addition method.
In some embodiments, the database proxy service addition method may be implemented as a computer program tangibly embodied on 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 onto the electronic device 50 via the ROM 52 and/or the 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, the processor 51 may be configured to perform the database proxy service addition method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out 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, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here 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 a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A database proxy service addition method, comprising:
detecting that a proxy service adding event of a preset database is triggered, and determining a target proxy service mirror image, wherein the preset database is deployed in a Kubernetes cluster, and the proxy service is used for interacting with a monitoring system corresponding to the preset database;
and starting the database container of the target database node by running a preset database mirror image and starting the proxy service container corresponding to the target database node by running a target proxy service mirror image in the same container set.
2. The method of claim 1, wherein the launching the proxy service container corresponding to the target database node by running a target proxy service image comprises:
and the target proxy service mirror image is operated to be in an initialized proxy service container corresponding to the target database node, address information of the monitoring system is transmitted to configure the operation environment of the proxy service, a proxy service installation file is decompressed, the address information of the monitoring system is written in the proxy service configuration, and the proxy service is started.
3. The method of claim 2, wherein said entering address information of said monitoring system in said proxy service container comprises:
and acquiring the address information of the monitoring system by reading a preset configuration file, and transmitting the address information of the monitoring system into the proxy service container.
4. The method of claim 1, wherein detecting that a proxy service add event of a preset database is triggered comprises:
after a preset deployment command of a preset database is received, a preset configuration file is read, and when the preset configuration file contains proxy service starting information, the trigger of a proxy service adding event of the preset database is detected.
5. The method of claim 1, wherein detecting that a proxy service add event of a preset database is triggered comprises:
when the restart of a target container set containing the proxy service container is detected, determining that the proxy service adding event of the preset database is detected to be triggered;
wherein the containers are in the same container set, including in the same target container set.
6. The method of claim 2, wherein the determining the target proxy service image comprises:
and determining the target proxy service image by reading the proxy service image version information in the preset configuration file.
7. The method according to any one of claims 1-6, wherein the pre-set database comprises: at least one of a stand-alone database, a master-slave database cluster and a distributed database cluster.
8. A database proxy service adding apparatus, comprising:
the system comprises a mirror image determining module, a target proxy service mirror image determining module and a target proxy service determining module, wherein the mirror image determining module is used for detecting that a proxy service adding event of a preset database is triggered, the preset database is deployed in a Kubernetes cluster, and the proxy service is used for interacting with a monitoring system corresponding to the preset database;
and the container starting module is used for starting the database container of the target database node by running the preset database mirror image and starting the proxy service container corresponding to the target database node by running the target proxy service mirror image in the same container set.
9. A database proxy service adding apparatus, characterized in that the database proxy service adding apparatus comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the database proxy service addition method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to implement the database proxy service addition method of any one of claims 1-7 when executed.
CN202310525136.3A 2023-05-10 2023-05-10 Database proxy service adding method, device, equipment and storage medium Pending CN116527761A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310525136.3A CN116527761A (en) 2023-05-10 2023-05-10 Database proxy service adding method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310525136.3A CN116527761A (en) 2023-05-10 2023-05-10 Database proxy service adding method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116527761A true CN116527761A (en) 2023-08-01

Family

ID=87404461

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310525136.3A Pending CN116527761A (en) 2023-05-10 2023-05-10 Database proxy service adding method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116527761A (en)

Similar Documents

Publication Publication Date Title
US11663037B2 (en) Service information processing method, apparatus, device and computer storage medium
CN113220420B (en) Service monitoring method, device, equipment, storage medium and computer program product
EP4095678A1 (en) Method and apparatus of deploying a cluster, device and storage medium
CN114640709B (en) Edge node processing method, device and medium
CN114185734B (en) Method and device for monitoring clusters and electronic equipment
CN112181724B (en) Big data disaster recovery method and device and electronic equipment
CN117435569A (en) Dynamic capacity expansion method, device, equipment, medium and program product for cache system
CN116248689A (en) Capacity expansion method, device, equipment and medium for cloud native application
CN114070889B (en) Configuration method, traffic forwarding device, storage medium, and program product
CN116527761A (en) Database proxy service adding method, device, equipment and storage medium
WO2022142716A1 (en) Information processing method and apparatus regarding wireless hotspot
CN115952004B (en) Resource allocation method, device, electronic equipment and storage medium
CN118363626A (en) Android application program upgrading method and device, electronic equipment and storage medium
CN117555570A (en) Service management method and device, electronic equipment and storage medium
CN117675820A (en) Big data cluster deployment method, device, equipment and storage medium
CN115237485A (en) Method, device, equipment and medium for managing start of microservice
CN118012534A (en) Application program loading method and device, electronic equipment and storage medium
CN118113410A (en) Cluster operation and maintenance method and device, electronic equipment and storage medium
CN117707643A (en) Plug-in building method and device and plug-in running method and device
CN117271062A (en) Micro-service deployment method and device, electronic equipment and storage medium
CN117591134A (en) Database deployment method and device, electronic equipment and storage medium
CN117407111A (en) Method and device for starting graphic display service, electronic equipment and storage medium
CN117076048A (en) Container application starting method and device, storage medium and electronic equipment
CN118093211A (en) Distributed lock processing method, device, equipment and medium
CN114398150A (en) Application running method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination