Cloud database control method and device, equipment and storage medium
By configuring master-slave relationships in the cloud database and using redis sentry to monitor and switch nodes, the single point of failure of redis in the cloud database is solved, improving its availability and ensuring the stability of the system.
Patent Information
- Application Number
- CN202411884620.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, the availability of cloud database redis is poor, and there is a risk of a single point of failure, resulting in data unavailability when nodes are down.
Configure master-slave relationships for multiple cloud database instances in the cloud database and start the redis sentinel process to monitor the status of the master node. When a master node fails, select one of the multiple slave nodes to switch to provide services.
Through the monitoring and switching mechanism of master-slave relationship and redis sentinel, the availability of redis cloud database is improved, ensuring that the master node can be switched to the slave node when the master node fails, ensuring the stable and continuous operation of the system.
Smart Images

Figure CN119883833A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud database technology, and in particular to a cloud database control method, device, equipment and storage medium. Background Art
[0002] With the rapid development of cloud computing technology, cloud databases have become the preferred solution for enterprise data management and storage. Cloud databases refer to databases that are optimized or deployed in cloud computing environments. They are database services built on cloud computing technology, and allow users to use database functions through the infrastructure, platform, or software-as-a-service model provided by cloud service providers. As a high-performance in-memory database, redis is widely used in scenarios such as caching and message queues. Cloud database redis deploys redis in a cloud computing environment. Single-node cloud database redis has the risk of single point failure. Once the node goes down, the corresponding data will be unavailable, making cloud database redis less available. Summary of the invention
[0003] The embodiments of the present invention provide a cloud database control method, device, equipment and storage medium to solve the technical problem of poor availability of cloud database redis in the prior art.
[0004] The technical solution of the present invention is as follows: a cloud database control method is provided, the method comprising:
[0005] In the cloud database, a master-slave relationship is configured for multiple cloud database instances to obtain a master node and several slave nodes;
[0006] Start sentinels for the master node and the slave node, and use the redis sentinel process to monitor the status of the master node;
[0007] When the redis sentinel process monitors that the master node fails, one of the slave nodes is selected from the plurality of slave nodes for switching, so that the selected slave node provides services.
[0008] Furthermore, before configuring the master-slave relationship for the multiple cloud database instances in the cloud database, the method further includes:
[0009] Obtain a request message for creating a cloud database instance, and perform parameter verification on the request message;
[0010] After the request message parameters are successfully verified, the trove-taskmanager module is enabled to create multiple cloud database instances in the cloud database according to the request message calling interface.
[0011] Further, the step of causing the trove-taskmanager module to create multiple cloud database instances in the cloud database according to the request message calling interface includes:
[0012] The trove-taskmanager module calls the application programming interface of the openstack nova module to create computing resources in the cloud database according to the computing resource specification information in the request message, calls the application programming interface of the openstack cinder module to create storage resources in the cloud database according to the disk size information in the request message, and calls the application programming interface of the openstack neutron module to create network resources in the cloud database according to the network information in the request message, so as to create multiple cloud database instances in the cloud database.
[0013] Further, the trove-taskmanager module is enabled to create multiple cloud database instances in the cloud database according to the request message calling interface, including:
[0014] The trove-taskmanager module calls the interface according to the request message, selects a corresponding configuration template from the configuration templates of multiple databases built into trove, performs corresponding customization on the corresponding configuration template, and passes it to the database instance in the form of file injection, so as to create multiple cloud database instances in the cloud database.
[0015] Furthermore, configuring a master-slave relationship for multiple cloud database instances in the cloud database includes:
[0016] Notify the trove-guestagent module in the cloud database instance to configure the master-slave relationship for multiple cloud database instances in the cloud database.
[0017] Further, performing parameter verification on the request message includes: performing parameter verification on the request message through a front-end interface component.
[0018] Furthermore, after obtaining a request message for creating a cloud database instance, the method further includes storing database instance information corresponding to the request message, wherein the database instance information includes an instance ID, database type information, and database version information.
[0019] Another technical solution of the present invention is as follows: a cloud database control device is provided, including a configuration unit, a monitoring unit and a switching unit;
[0020] The configuration unit is used to configure a master-slave relationship for multiple cloud database instances in the cloud database to obtain a master node and a plurality of slave nodes;
[0021] The monitoring unit is used to start sentinels for the master node and the slave node, and use the redis sentinel process to monitor the status of the master node;
[0022] The switching unit is used to select one of the slave nodes for switching when the redis sentinel process monitors that the master node fails, so that the selected slave node provides services.
[0023] Another technical solution of the present invention is as follows: a computer device is provided, the device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0024] Memory, used to store computer programs;
[0025] The processor is used to implement the steps of the cloud database control method described in any of the above technical solutions when executing the program stored in the memory.
[0026] Another technical solution of the present invention is as follows: a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the cloud database control method described in any of the above technical solutions are implemented.
[0027] The beneficial effects of the present invention are as follows: a master node and several slave nodes are obtained by configuring a master-slave relationship for multiple cloud database instances in a cloud database; sentinels are started for the master node and the slave nodes, and the state of the master node is monitored by the redis sentinel process; when the redis sentinel process monitors that the master node fails, one of the slave nodes is selected from the several slave nodes for switching, so that the selected slave node provides services; a master-slave relationship is configured for multiple cloud database instances to obtain a master node and several slave nodes, and when the master node fails, the slave node can be switched to, thereby improving the availability of the cloud database redis and ensuring the stable and continuous operation of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0029] Figure 1 A schematic diagram of a flow chart of a cloud database control method provided by an embodiment of the present invention;
[0030] Figure 2 A workflow diagram of cloud database control provided by an embodiment of the present invention;
[0031] Figure 3 A schematic diagram of the overall architecture of a cloud database control provided by an embodiment of the present invention;
[0032] Figure 4 A schematic diagram of the structure of a cloud database control device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] In the description of this application, the words "first", "second", etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order. In this specification, the terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0035] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0036] Figure 1 is a flow chart of the cloud database control method of an embodiment of the present invention. It should be noted that if there is substantially the same result, the cloud database control method of the present invention is not limited to Figure 1 The process sequence shown is limited. Figure 1 As shown, the cloud database control method mainly includes the following steps:
[0037] S101, configuring a master-slave relationship for multiple cloud database instances in a cloud database to obtain a master node and a plurality of slave nodes;
[0038] In an optional implementation, before configuring a master-slave relationship for multiple cloud database instances in a cloud database, the method further includes:
[0039] Obtain a request message for creating a cloud database instance, and perform parameter verification on the request message;
[0040] After the request message parameters are successfully verified, the trove-taskmanager module is enabled to create multiple cloud database instances in the cloud database according to the request message calling interface.
[0041] In an optional implementation, performing parameter verification on the request message includes: performing parameter verification on the request message through a front-end interface component.
[0042] In a specific embodiment, the front-end interface component may be trove-api, which is an important component in the openstack database as a service project trove. Trove-api performs parameter verification on the request message for the user to create a database instance.
[0043] In an optional implementation, after obtaining a request message for creating a cloud database instance, the method further includes storing database instance information corresponding to the request message, wherein the database instance information includes an instance ID, database type information, and database version information.
[0044] In a specific embodiment, the workflow diagram of cloud database control is as follows: Figure 2 As shown, trove-api performs parameter verification (checking) on the user's request message for creating a database instance. After the verification is passed, the redis resource object is stored in trove-conductor, and the database instance information corresponding to the request message is stored through trove-conductor. The database instance information includes instance ID, database type information and database version information.
[0045] In a specific embodiment, trove-conductor is a core component in the openstack trove project, which mainly plays the role of coordinating and managing database service operations. It is in the middle layer of the trove architecture, between the API service and the database engine itself.
[0046] In an optional implementation, the step of causing the trove-taskmanager module to create multiple cloud database instances in the cloud database according to the request message calling interface includes:
[0047] The trove-taskmanager module calls the application programming interface of the openstack nova module to create computing resources in the cloud database according to the computing resource specification information in the request message, calls the application programming interface of the openstack cinder module to create storage resources in the cloud database according to the disk size information in the request message, and calls the application programming interface of the openstack neutron module to create network resources in the cloud database according to the network information in the request message, so as to create multiple cloud database instances in the cloud database.
[0048] In a specific embodiment, trove-taskmanager is a key component in the openstack database service trove, which can be used to configure database virtual machine instances, manage the life cycle of database virtual machine instances, and perform various operations on database virtual machine instances. Openstack nova is a core computing component in the openstack cloud computing platform, which can be used to manage the entire life cycle of virtual machines (databases). Openstack cinder is a block storage service component in the openstack cloud computing platform, which can be used to provide persistent block storage volumes for virtual machines. Openstack neutron is a network service component in the openstack cloud computing platform, which can be used to build and manage virtual networks in a cloud computing environment and provide network connections for virtual machines.
[0049] According to the embodiment of the present invention, the trove-taskmanager module calls the application programming interface of the openstack nova module to create computing resources in the cloud database according to the computing resource specification information in the request message, calls the application programming interface of the openstack cinder module to create storage resources in the cloud database according to the disk size information in the request message, and calls the application programming interface of the openstack neutron module to create network resources in the cloud database according to the network information in the request message, so as to realize the creation of multiple cloud database instances in the cloud database, ensure that the database instances in the master database and the slave database are the same, and ensure the high availability of the cloud database redis.
[0050] In an optional implementation, the trove-taskmanager module is enabled to create multiple cloud database instances in the cloud database according to the request message calling interface, including:
[0051] The trove-taskmanager module calls the interface according to the request message, selects a corresponding configuration template from the configuration templates of multiple databases built into trove, performs corresponding customization on the corresponding configuration template, and passes it to the database instance in the form of file injection, so as to create multiple cloud database instances in the cloud database.
[0052] In a specific embodiment, by building configuration templates of different databases in Trove, when creating a database instance, the corresponding template can be found in Trove, and computing resource specification information, disk size information, and network information can be passed to the database instance through file injection for customized processing.
[0053] S102, starting sentinels for the master node and the slave node, and using the redis sentinel process to monitor the status of the master node;
[0054] In an optional implementation, configuring a master-slave relationship for multiple cloud database instances in a cloud database includes:
[0055] Notify the trove-guestagent module in the cloud database instance to configure the master-slave relationship for multiple cloud database instances in the cloud database.
[0056] In a specific embodiment, after the cloud database instance is successfully created, the trove-guestagent module in the cloud database instance is notified to configure the master-slave relationship for multiple database instances, forming a master node and several slave nodes, and start sentinels for one master node and several slave nodes. For example, there are a total of 3 cloud database instances, 1 cloud database instance is configured as the master node, and the other 2 cloud database instances are slave nodes. In this way, when a problem occurs in the master node, it can be switched to the slave node to ensure the continuous operation of the system. The sentinel is responsible for monitoring the status of the master and slave nodes, and timely discovers and switches the nodes accordingly.
[0057] S103, when the redis sentinel process monitors that the master node fails, one of the slave nodes is selected from the plurality of slave nodes for switching, so that the selected slave node provides services.
[0058] In a specific embodiment, the overall architecture diagram of the cloud database control is as follows: Figure 3 As shown, Figure 3In the example, the cloud database can be a redis database, which is controlled by the trove component. The virtual machine resources corresponding to the redis database are divided into multiple nodes by the trove component, one of which is a master node and the rest are slave nodes. The master node includes trove-guestagent, redis master and redis Sentinel (redis sentinel process), and the slave node includes trove-guestagent, redis slave and redis Sentinel. The trove component controls the sentinel modules in all nodes, such as Redis sentinel. When the master node is abnormal, any available slave node is controlled as the master node. Thus, the control of the Redis sentinel mode is realized. For example, the deployment architecture of the redis sentinel mode in the trove cloud platform includes 3 nodes, including 1 master node and 2 slave nodes. Redis (redis master in the master node and redis slave in the slave node), redis sentinel (redis sentinel process), and trove-guestagent are started in these three nodes respectively. The redis service process is responsible for data storage and read and write operations, redis sentinel is responsible for monitoring and failover, and trove-guestagent is responsible for managing redis and redis Sentinel processes. The redis master node (master database) handles all write operations and synchronizes data to the slave node (slave database), the redis slave node handles read operations and synchronizes data from the master node, and the sentinel node is responsible for monitoring the status of the redis master and slave nodes and triggering failover when the master node fails. Figure 3 In trove, trove-manage is the trove management module, which is used to manage three redis databases. Trove-manage includes trove-api, trove-taskmanager, and trove-conductor. Figure 3 In the command, slaveof is used to configure the slave node. Its main function is to let the slave node copy the data of the master node.
[0059] The cloud database control method provided by the embodiment of the present invention obtains a master node and several slave nodes by configuring a master-slave relationship for multiple cloud database instances in a cloud database; starts sentinels for the master node and the slave nodes, and uses the redis sentinel process to monitor the state of the master node; when the redis sentinel process monitors that the master node fails, one of the slave nodes is selected from the several slave nodes for switching, so that the selected slave node provides services; configures a master-slave relationship for multiple cloud database instances to obtain a master node and several slave nodes, and can switch to the slave node when the master node fails, thereby improving the availability of the cloud database redis and ensuring the stable and continuous operation of the system.
[0060] The cloud database control method provided by the embodiment of the present invention can start the sentinel, and the sentinel node can automatically detect the failure of the master node and trigger the failover process. When the master node fails, it can switch to the slave node, allowing the user to adjust the configuration of the sentinel and Redis node according to actual needs.
[0061] Figure 4 is a schematic diagram of the structure of a cloud database control device according to an embodiment of the present invention. Figure 4 As shown, the cloud database control device 40 includes a configuration unit 41, a monitoring unit 42 and a switching unit 43;
[0062] The configuration unit 41 is used to configure a master-slave relationship for multiple cloud database instances in the cloud database to obtain a master node and a plurality of slave nodes;
[0063] The monitoring unit 42 is used to start sentinels for the master node and the slave node, and use the redis sentinel process to monitor the status of the master node;
[0064] The switching unit 43 is used to select one of the slave nodes for switching when the redis sentinel process monitors that the master node fails, so that the selected slave node provides services.
[0065] In an optional embodiment, the cloud database control device 40 also includes an instance creation unit, which is used to obtain a request message for creating a cloud database instance and perform parameter verification on the request message before configuring a master-slave relationship for multiple cloud database instances in the cloud database; after the request message parameter verification is successful, the trove-taskmanager module creates multiple cloud database instances in the cloud database according to the request message calling interface.
[0066] In an optional implementation, the instance creation unit enables the trove-taskmanager module to create multiple cloud database instances in the cloud database according to the request message calling interface, including:
[0067] The trove-taskmanager module calls the application programming interface of the openstacknova module to create computing resources in the cloud database according to the computing resource specification information in the request message, calls the application programming interface of the openstackcinder module to create storage resources in the cloud database according to the disk size information in the request message, and calls the application programming interface of the openstackneutron module to create network resources in the cloud database according to the network information in the request message, so as to create multiple cloud database instances in the cloud database.
[0068] In an optional implementation, the instance creation unit enables the trove-taskmanager module to create multiple cloud database instances in the cloud database according to the request message calling interface, including:
[0069] The trove-taskmanager module calls the interface according to the request message, selects a corresponding configuration template from the configuration templates of multiple databases built into trove, performs corresponding customization on the corresponding configuration template, and passes it to the database instance in the form of file injection, so as to create multiple cloud database instances in the cloud database.
[0070] In an optional implementation, the configuration unit 41 configures a master-slave relationship for multiple cloud database instances in the cloud database, including: notifying a trove-guestagent module in the cloud database instance to configure a master-slave relationship for multiple cloud database instances in the cloud database.
[0071] In an optional implementation, the instance creation unit performs parameter verification on the request message, including: performing parameter verification on the request message through a front-end interface component.
[0072] In an optional implementation, the configuration unit 41 is further used to, after obtaining a request message for creating a cloud database instance, store database instance information corresponding to the request message, where the database instance information includes an instance ID, database type information, and database version information.
[0073] Based on the above cloud database control method, an embodiment of the present invention further provides a computer device, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;
[0074] Memory, used to store computer programs;
[0075] The processor is used to implement the steps of the cloud database control method described in any of the above embodiments when executing the program stored in the memory.
[0076] For other details about the processor in the above-mentioned cloud database control device implementing the above-mentioned technical solution, please refer to the description of the cloud database control method provided in the above-mentioned invention embodiment, which will not be repeated here.
[0077] Among them, the processor can also be called CPU (Central Processing Unit), the processor may be an integrated circuit chip with signal processing capabilities; the processor can also be a general-purpose processor, DSP (Digital Signal Process), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, among which the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0078] The embodiment of the present invention also provides a computer-readable storage medium, on which a readable computer program is stored; wherein the computer program can be stored in the above storage medium in the form of a software product, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, magnetic disk or optical disk, ROM (Read-Only Memory), RAM (Random Access Memory) and other media that can store program codes, or terminal devices such as computers, servers, mobile phones, and tablets.
[0079] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0080] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0081] In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
[0082] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0083] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0084] The technical solution provided by the present application is introduced in detail above. The principles and implementation methods of the present application are explained by using specific examples in the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
[0085] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0086] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0087] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0088] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0089] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A cloud database control method, characterized in that: The method comprises: In the cloud database, a master-slave relationship is configured for multiple cloud database instances to obtain a master node and several slave nodes; Start sentinels for the master node and the slave node, and use the redis sentinel process to monitor the status of the master node; When the redis sentinel process monitors that the master node fails, one of the slave nodes is selected from the plurality of slave nodes for switching, so that the selected slave node provides services.
2. The cloud database control method according to claim 1, characterized in that: Before configuring the master-slave relationship for multiple cloud database instances in the cloud database, you also need to: Obtain a request message for creating a cloud database instance, and perform parameter verification on the request message; After the request message parameters are successfully verified, the trove-taskmanager module is enabled to create multiple cloud database instances in the cloud database according to the request message calling interface.
3. The cloud database control method according to claim 2, characterized in that: The step of causing the trove-taskmanager module to call an interface according to the request message to create multiple cloud database instances in the cloud database includes: The trove-taskmanager module calls the application programming interface of the openstacknova module to create computing resources in the cloud database according to the computing resource specification information in the request message, calls the application programming interface of the openstackcinder module to create storage resources in the cloud database according to the disk size information in the request message, and calls the application programming interface of the openstackneutron module to create network resources in the cloud database according to the network information in the request message, so as to create multiple cloud database instances in the cloud database.
4. The cloud database control method according to claim 3, characterized in that: The trove-taskmanager module is enabled to create multiple cloud database instances in the cloud database according to the request message calling interface, including: The trove-taskmanager module calls the interface according to the request message, selects a corresponding configuration template from the configuration templates of multiple databases built into trove, performs corresponding customization on the corresponding configuration template, and passes it to the database instance in the form of file injection, so as to create multiple cloud database instances in the cloud database.
5. The cloud database control method according to claim 1, characterized in that: Configure the master-slave relationship for multiple cloud database instances in the cloud database, including: Notify the trove-guestagent module in the cloud database instance to configure the master-slave relationship for multiple cloud database instances in the cloud database.
6. The cloud database control method according to claim 2, characterized in that: Performing parameter verification on the request message includes: performing parameter verification on the request message through a front-end interface component.
7. The cloud database control method according to claim 2, characterized in that: After obtaining a request message for creating a cloud database instance, the method further includes storing database instance information corresponding to the request message, wherein the database instance information includes an instance ID, database type information, and database version information.
8. A cloud database control device, characterized in that: It includes a configuration unit, a monitoring unit and a switching unit; The configuration unit is used to configure a master-slave relationship for multiple cloud database instances in the cloud database to obtain a master node and a plurality of slave nodes; The monitoring unit is used to start sentinels for the master node and the slave node, and use the redis sentinel process to monitor the status of the master node; The switching unit is used to select one of the slave nodes for switching when the redis sentinel process monitors that the master node fails, so that the selected slave node provides services.
9. A computer device, characterized in that: The device includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the cloud database control method according to any one of claims 1 to 7 when executing the program stored in the memory.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the cloud database control method according to any one of claims 1 to 7 are implemented.