Mycat system deployment and operation method, device, equipment and storage medium

By automatically matching and pre-occupying resources, Mycat's automatic deployment and operation is realized, which solves the problems of deployment complexity and operation and maintenance difficulty, improves efficiency and simplifies business operations.

CN114647501BActive Publication Date: 2024-10-01SF TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202011499252.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-17
Publication Date
2024-10-01
Estimated Expiration
2040-12-17

AI Technical Summary

Technical Problem

The deployment of Mycat is complex, requiring manual efforts to find servers with resources and deploy services in different computer rooms, causing the difficulty of operation and maintenance to rise exponentially as the number of shards increases.

Method used

By obtaining the deployment information of the target Mycat, it automatically matches the target host that matches the specification information, preemptes and creates resources, realizes automatic deployment and operation and maintenance, and reduces manual intervention.

Benefits of technology

It improves deployment efficiency, reduces the workload of business personnel, and reduces deployment complexity and operation and maintenance difficulty.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114647501B_ABST
    Figure CN114647501B_ABST
Patent Text Reader

Abstract

The present application discloses a Mycat system deployment and operation method, device, equipment and storage medium, the method comprising obtaining the deployment information of the target Mycat, wherein the deployment information carries a deployment area identifier for deploying the target Mycat and the specification information of the target Mycat; searching for the target deployment area corresponding to the deployment area identifier and the resource pool bound to the target deployment area, wherein the resource pool includes multiple clusters, each cluster includes multiple hosts; searching for a host adapted to the specification information from the multiple hosts to obtain the target host; pre-occupying resources for the target host according to the specification information to obtain pre-occupancy information; creating resources in the target host according to the pre-occupancy information to complete the deployment and operation of the target Mycat. The present application realizes fast and automated Mycat deployment and operation, greatly improves the deployment and operation efficiency, and reduces the workload of business personnel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database technology, and in particular to a Mycat system deployment and operation method, device, equipment and storage medium. Background Art

[0002] Mycat is an open source distributed database system and a server that implements the MySQL protocol. Front-end users can view it as a database proxy middleware and access it using MySQL client tools and commands, while back-end personnel can communicate with multiple MySQL servers using the MySQL native protocol or with most mainstream database servers using the JDBC protocol. Its core function is table and database sharding, which means splitting a large table into multiple small tables and storing them in the back-end MySQL server or other databases. Therefore, Mycat reduces the pressure on a single database and can implement master-slave, hot standby, and database and table sharding, thereby realizing a distributed architecture of the database.

[0003] Due to the distributed architecture of Mycat, when deploying it, the existing technology needs to manually find a server with resources, then deploy the Mycat service on the server, and modify the configuration of the Mycat service according to different demand specifications. At the same time, the standard cluster architecture of Mycat needs to deploy 5 Mycat services, and these 5 Mycat services are required to be deployed in different computer rooms.

[0004] In view of the existing technology, the deployment of Mycat requires manual search for servers with resources, and the Mycat service needs to be deployed separately in different computer rooms, which easily leads to greater complexity in the deployment of Mycat, and the difficulty of Mycat operation and maintenance will increase exponentially with the increase in the number of shards. Summary of the invention

[0005] The present application provides a Mycat system deployment and operation and maintenance method, device, equipment and storage medium, aiming to solve the problem in the prior art of manually finding a server with resources and deploying Mycat services in different computer rooms, resulting in a large deployment complexity and an exponential increase in the difficulty of operation and maintenance as the number of shards increases.

[0006] In a first aspect, the present application provides a Mycat system deployment and operation method, including:

[0007] Obtaining deployment information of the target Mycat, wherein the deployment information carries a deployment zone identifier for deploying the target Mycat and specification information of the target Mycat;

[0008] Find a target deployment zone corresponding to the deployment zone identifier and a resource pool bound to the target deployment zone, wherein the resource pool includes multiple clusters, and each cluster includes multiple hosts;

[0009] From multiple hosts, search for a host that matches the specification information to obtain a target host;

[0010] Pre-occupy resources of the target host according to the specification information to obtain pre-occupancy information;

[0011] Create resources in the target host according to the pre-occupancy information to complete the deployment and operation of the target Mycat.

[0012] In a possible implementation of the present application, searching for a host that matches the specification information from multiple hosts to obtain a target host includes:

[0013] Each host in multiple clusters is traversed until the specification information matches the host specification of the host, and then the traversal is stopped to obtain the target host.

[0014] In a possible implementation of the present application, the specification information includes instance information of the target Mycat, and resources are pre-occupied on the target host according to the specification information to obtain pre-occupancy information, including:

[0015] Binding the instance information to the target host, and saving binding information for recording the binding relationship between the instance information and the target host;

[0016] Subtract the specification information from the host specification of the target host to complete resource pre-occupancy and obtain pre-occupancy information, wherein the pre-occupancy information includes the specification information and the host information of the target host.

[0017] In a possible implementation of the present application, the instance information includes the shard host instance information and the Mycat instance information, and resources are created in the target host according to the pre-occupied information, including:

[0018] Generate the basic information of the target Mycat according to the pre-occupied information, wherein the basic information includes the domain name of the target host;

[0019] Obtaining a binding application for a virtual Internet Protocol address of a target Mycat, and binding the virtual Internet Protocol address to a domain name so that the virtual Internet Protocol address is associated with the domain name;

[0020] Create the load balancing resource and monitoring service of the target Mycat based on the basic information. The load balancing resource is used to distribute the load to the target Mycat, and the monitoring service is used to monitor the operation of the load balancing resource.

[0021] According to the pre-occupancy information, a shard host instance and a Mycat instance are created, wherein the shard host instance matches the shard host instance information, and the Mycat instance matches the Mycat instance information.

[0022] In a possible implementation of the present application, obtaining a binding application for a virtual Internet Protocol address of a target Mycat and binding the virtual Internet Protocol address to a domain name include:

[0023] Obtain binding applications for virtual Internet Protocol addresses of target Mycat, calculate the number of binding applications, and establish a corresponding virtual Internet Protocol address list;

[0024] Recording a list of virtual Internet Protocol addresses into basic information;

[0025] Bind the virtual Internet Protocol addresses in the virtual Internet Protocol address list to the domain names respectively.

[0026] In a possible implementation of the present application, the basic information includes connection information of the target Mycat, and the connection information is used to create load balancing resources and monitor services.

[0027] In a possible implementation of the present application, after the target Mycat deployment and operation are completed, the method further includes:

[0028] Get the expansion information of the target Mycat;

[0029] Searching for a host that matches the expansion information among multiple hosts to obtain the expanded host;

[0030] Pre-occupy the capacity expansion resources of the expansion host according to the capacity expansion information to obtain the capacity expansion pre-occupancy information;

[0031] According to the expansion pre-occupancy information, the expansion host is scheduled to expand and the target Mycat expansion is completed.

[0032] In a second aspect, the present application also provides a Mycat system deployment and operation and maintenance device, including:

[0033] An acquisition module, used to acquire deployment information of a target Mycat, wherein the deployment information carries a deployment zone identifier for deploying the target Mycat and specification information of the target Mycat;

[0034] A processing module, configured to search for a target deployment zone corresponding to the deployment zone identifier and a resource pool bound to the target deployment zone, wherein the resource pool includes a plurality of clusters, and each cluster includes a plurality of hosts;

[0035] From multiple hosts, search for a host that matches the specification information to obtain a target host;

[0036] Pre-occupy resources of the target host according to the specification information to obtain pre-occupancy information;

[0037] The deployment module is used to create resources in the target host according to the pre-occupancy information to complete the deployment and operation of the target Mycat.

[0038] In a possible implementation of the present application, the processing module is specifically used to:

[0039] Each host in multiple clusters is traversed until the specification information matches the host specification of the host, and then the traversal is stopped to obtain the target host.

[0040] In a possible implementation of the present application, the specification information includes instance information of the target Mycat, and the processing module is further used to:

[0041] Binding the instance information to the target host, and saving binding information for recording the binding relationship between the instance information and the target host;

[0042] Subtract the specification information from the host specification of the target host to complete resource pre-occupancy and obtain pre-occupancy information, wherein the pre-occupancy information includes the specification information and the host information of the target host.

[0043] In a possible implementation of the present application, the instance information includes shard host instance information and Mycat instance information, and the deployment module is specifically used for:

[0044] Generate the basic information of the target Mycat according to the pre-occupied information, wherein the basic information includes the domain name of the target host;

[0045] Obtaining a binding application for a virtual Internet Protocol address of a target Mycat, and binding the virtual Internet Protocol address to a domain name so that the virtual Internet Protocol address is associated with the domain name;

[0046] Create the load balancing resource and monitoring service of the target Mycat based on the basic information. The load balancing resource is used to distribute the load to the target Mycat, and the monitoring service is used to monitor the operation of the load balancing resource.

[0047] According to the pre-occupancy information, a shard host instance and a Mycat instance are created, wherein the shard host instance matches the shard host instance information, and the Mycat instance matches the Mycat instance information.

[0048] In a possible implementation of the present application, the deployment module is further specifically used for:

[0049] Obtain binding applications for virtual Internet Protocol addresses of target Mycat, calculate the number of binding applications, and establish a corresponding virtual Internet Protocol address list;

[0050] Recording a list of virtual Internet Protocol addresses into basic information;

[0051] Bind the virtual Internet Protocol addresses in the virtual Internet Protocol address list to the domain names respectively.

[0052] In a possible implementation of the present application, the acquisition module is further used to obtain the expansion information of the target Mycat;

[0053] The processing module is further used to find a host that is compatible with the expansion information among the multiple hosts to obtain the expanded host;

[0054] Pre-occupy the capacity expansion resources of the expansion host according to the capacity expansion information to obtain the capacity expansion pre-occupancy information;

[0055] The deployment module is also used to schedule the expansion of the expansion host according to the expansion pre-occupancy information to complete the target Mycat expansion.

[0056] In a third aspect, the present application also provides a Mycat system deployment and operation and maintenance device, including:

[0057] one or more processors;

[0058] Memory; and

[0059] One or more applications, wherein the one or more applications are stored in a memory and configured to be executed by a processor to implement the Mycat system deployment and operation method of the first aspect.

[0060] In a fourth aspect, the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program is loaded by a processor to execute the steps in the Mycat system deployment and operation method of the first aspect.

[0061] In this application, first, according to the deployment information of the target Mycat set by the user, the target Mycat is automatically matched with a target host that matches its specification information, and then resources are pre-occupied and created for the target host according to the specification information to achieve automatic deployment and operation of the target Mycat. There is no need to manually search for the computer room and deploy Mycat, which saves time and effort. Users do not need to understand the complete architecture of Mycat, but only need to select relevant deployment information that matches their needs to quickly and automatically complete the Mycat deployment, which greatly improves deployment efficiency and reduces the workload of business personnel. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the technical solution in the present application, the drawings required for use in the description of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0063] Figure 1 This is a schematic diagram of an embodiment scenario of the Mycat system deployment and operation and maintenance system provided in this application;

[0064] Figure 2 This is a flowchart of an embodiment of the Mycat system deployment and operation method provided in this application;

[0065] Figure 3 It is a schematic diagram of an embodiment structure of the relationship between the resource pool, cluster and host provided in this application;

[0066] Figure 4 This is a schematic diagram of an embodiment of the process of obtaining pre-occupancy information in the present application;

[0067] Figure 5 This is a schematic diagram of an embodiment of resource creation in this application;

[0068] Figure 6 It is a schematic diagram of an embodiment of binding a virtual Internet Protocol address and a domain name in the present application;

[0069] Figure 7 This is a flowchart of an embodiment of the present application to achieve the target Mycat expansion;

[0070] Figure 8 This is a schematic diagram of the structure of an embodiment of the Mycat system deployment and operation and maintenance device provided in this application;

[0071] Fig. 9 It is a structural diagram of an embodiment of the Mycat system deployment and operation and maintenance equipment provided in this application. DETAILED DESCRIPTION

[0072] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0073] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first" and "second" are used only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0074] In this application, the word "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.

[0075] The present application provides a Mycat system deployment and operation and maintenance method, device, equipment and storage medium, which are described in detail below.

[0076] See also Figure 1 , Figure 1 This is a schematic diagram of an embodiment scenario of the Mycat system deployment and operation and maintenance system provided in the present application. The Mycat system deployment and operation and maintenance system may include a server 100 and an operation terminal 200. The server 100 is integrated with a Mycat system deployment and operation and maintenance device. The operation terminal 200 is provided with an interactive interface. The user can set the Mycat system parameters through the interactive interface on the operation terminal 200. The server 100 can communicate with the operation terminal 200 and process the Mycat system parameters uploaded by each operation terminal 200, thereby completing the deployment and operation of the Mycat system.

[0077] In the present application, the server 100 is mainly used to obtain the deployment information of the target Mycat, wherein the deployment information carries the deployment area identifier for deploying the target Mycat and the specification information of the target Mycat; searching for the target deployment area corresponding to the deployment area identifier, and the resource pool bound to the target deployment area, wherein the resource pool includes multiple clusters, and each cluster includes multiple hosts; searching for a host that matches the specification information from the multiple hosts to obtain the target host; pre-occupying resources for the target host according to the specification information to obtain pre-occupancy information; creating resources in the target host according to the pre-occupancy information to complete the deployment and operation of the target Mycat.

[0078] In the present application, the server 100 may be an independent server, or a server network or server cluster composed of servers. For example, the server 100 described in the present application includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of a plurality of servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.

[0079] In the present application, the server 100 and the operation terminal 200 can realize network communication through any communication mode, including but not limited to mobile communication based on the 3rd Generation Partnership Project (3GPP), Long Term Evolution (LTE), Worldwide Interoperability for Microwave Access (WiMAX), or computer network communication based on TCP / IP Protocol Suite (TCP / IP), User Datagram Protocol (UDP), etc. The operation terminal 200 can upload the deployment information about the Mycat system set by the user to the server 100 through the above communication mode, such as the specification information of the Mycat system, the deployment area of ​​the Mycat system, etc.

[0080] In the present application, the above-mentioned operation terminal 200 can be a general-purpose computer device or a special-purpose computer device. In a specific implementation, the operation terminal 200 can be a palm computer, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, etc. The present application does not limit the type of the above-mentioned operation terminal 200.

[0081] Those skilled in the art will understand that Figure 1The application environment shown in the figure is only an application scenario adapted to the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application scenarios may also include Figure 1 More or fewer operating terminals 200 are shown in FIG. Figure 1 Only two operation terminals 200 are shown. It can be understood that the Mycat system deployment and operation system can also include other operation terminals that are communicatively connected to the server 100, which are not specifically limited here.

[0082] In addition, if Figure 1 As shown, the Mycat system deployment and operation and maintenance system may further include a display 300, which may be communicatably connected to the server 100, and is used to display the Mycat system deployment and operation and maintenance results to the user.

[0083] It should be noted that Figure 1 The scenario diagram of the Mycat system deployment and operation and maintenance system shown is only an example. The Mycat system deployment and operation and maintenance system and the scenario described in this application are intended to more clearly illustrate the technical solution of this application and do not constitute a limitation on the technical solution provided by this application. Ordinary technicians in this field can know that with the evolution of the Mycat system deployment and operation and maintenance system and the emergence of new business scenarios, the technical solution provided by this application is also applicable to similar technical problems.

[0084] First, the present application provides a Mycat system deployment and operation method, the execution body of the Mycat system deployment and operation method is a Mycat system deployment and operation device, the Mycat system deployment and operation device is applied to server 100, and server 100 is located in the Mycat system deployment and operation system. The Mycat system deployment and operation method includes: obtaining the deployment information of the target Mycat, wherein the deployment information carries a deployment area identifier for deploying the target Mycat and specification information of the target Mycat; searching for the target deployment area corresponding to the deployment area identifier, and a resource pool bound to the target deployment area, wherein the resource pool includes multiple clusters, and each cluster includes multiple hosts; from the multiple hosts, searching for a host that is compatible with the specification information to obtain the target host; pre-occupying resources for the target host according to the specification information to obtain pre-occupancy information; creating resources in the target host according to the pre-occupancy information to complete the deployment and operation of the target Mycat.

[0085] like Figure 2 As shown, it is a schematic diagram of an embodiment of the Mycat system deployment and operation method provided in this application, and the Mycat system deployment and operation method includes:

[0086] S201. Obtain deployment information of a target Mycat, wherein the deployment information carries a deployment area identifier for deploying the target Mycat and specification information of the target Mycat.

[0087] In an embodiment of the present application, the way in which the server obtains the deployment information of the target Mycat can be an active acquisition method or a passive acquisition method. For example, in the passive acquisition method, the user can independently select the deployment information of the target Mycat through the interactive interface on the operation terminal. After the user completes the deployment information selection, the operation terminal actively uploads the deployment information to the server, so that the server obtains the deployment information of the target Mycat; and in the active acquisition method, after the user completes the deployment information selection on the operation terminal, the operation terminal or a storage device with a storage function saves the deployment information, and the server regularly accesses the operation terminal or the storage device at a time interval preset by the user. If there is new deployment information in the operation terminal or the storage device, the deployment information is actively acquired.

[0088] In an embodiment of the present application, the user can select the deployment information of the target Mycat according to business needs, for example, select the server area where the target Mycat is to be deployed, the software version of the target Mycat to be deployed, the specification information of the target Mycat, etc., where the server area corresponds to a deployment area identifier that uniquely identifies the server area.

[0089] For example, according to business needs, the user needs to deploy a Mycat system with the software version of Mycat1.5.3 in Futian District, Shenzhen. The specification information of the Mycat system is that the database version connected to Mycat is MySQL5.7.19, the hard disk is 200G, and it includes 8 master instances and 1 node. When the user selects the deployment information, the deployment area identifier selected is the identifier of Futian District, Shenzhen (such as "02"), the software version is Mycat1.5.3, and the specification information is the database version MySQL5.7.19, the hard disk is 200G, 8 master instances and 1 node.

[0090] S202: Find a target deployment zone corresponding to the deployment zone identifier and a resource pool bound to the target deployment zone, wherein the resource pool includes multiple clusters, and each cluster includes multiple hosts.

[0091] In an embodiment of the present application, each deployment area is configured with a deployment area identifier that can uniquely identify the deployment area. Therefore, the deployment area identifier is similar to the identity proof of the deployment area, and each deployment area corresponds to a server host resource pool, which can include multiple server clusters, and each server cluster can include multiple hosts. The correspondence between the above-mentioned deployment area identifiers, deployment areas, resource pools, clusters and hosts can be stored in the server in the form of a relationship table, wherein the correspondence between the deployment area identifier, deployment area and resource pool can be expressed in the form of "deployment area identifier-deployment area-resource pool". After obtaining the deployment area identifier of the target Mycat through S201, the server can find the target deployment area corresponding to the deployment area identifier and the resource pool corresponding to the target deployment area by calling the relationship table.

[0092] If, in the information of the relationship table, there is a record of "deployment area identifier-deployment area-resource pool" as "02-Shenzhen Futian District-Resource Pool No. 1", then according to the deployment area identifier (such as "02"), the corresponding deployment area can be found through the relationship table as Shenzhen Futian District, and the resource pool bound to Shenzhen Futian District is Resource Pool No. 1. It should be noted that in this application, in addition to the one-to-one correspondence, the correspondence between the deployment area and the resource pool can also be one-to-many or many-to-one. For example, in addition to Shenzhen Futian District being bound to Resource Pool No. 1, Shenzhen Nanshan District can also be bound to Resource Pool No. 1 (such as "01-Shenzhen Nanshan District-Resource Pool No. 1"), or Shenzhen Futian District can be bound to Resource Pool No. 2 in addition to Resource Pool No. 1 (such as "02-Shenzhen Futian District-Resource Pool No. 2"). The above correspondence can be selected according to the actual application, and the specific details are not limited here.

[0093] S203: Search for a host that matches the specification information from multiple hosts to obtain a target host.

[0094] Since the resource pool may include multiple server clusters, and each server cluster may include multiple hosts, no matter whether there is one or more resource pools bound to the target deployment area, it is necessary to find a host that is compatible with the specification information of the target Mycat from multiple hosts. In the embodiment of the present application, searching for a host that is compatible with the specification information may be to search for a compatible target host among the hosts according to the hard disk specifications in the specification information. It is worth noting that the adaptation described in the embodiment of the present application is not limited to the case where the two are equal, and usually, in order to avoid Mycat service abnormalities due to insufficient resources, the hard disk specifications in the specification information of the target Mycat should be smaller than the hard disk specifications of the host to ensure the normal operation of Mycat.

[0095] like Figure 3As shown, it is a schematic diagram of an embodiment of the relationship between the resource pool, cluster and host provided in this application. If the resource pool bound to Shenzhen Futian District is only resource pool No. 1, and resource pool No. 1 includes 4 server clusters (such as "cluster 1-1", "cluster 1-2", "cluster 1-3" and "cluster 1-4"), each cluster includes 8 hosts, then the number of hosts in the entire resource pool is 32, and it is necessary to find a host that matches the specification information from these 32 hosts. It is worth noting that the host specifications of all hosts in the same cluster of the same resource pool can be the same or different. For example, among the 8 hosts in "cluster 1-1", the host specification of each host can be "main memory 256G + hard disk 512G", or the host specification of "host 1-1-1" is "main memory 256G + hard disk 512G", and the host specification of "host 1-1-2" is "main memory 125G + hard disk 256G", etc. The host specification of each host can be selected according to the actual application, and is not limited here.

[0096] For example, the hard disk specification in the specification information of the target Mycat is 200G, the host specification of "Host 1-1-1" is "256G main memory + 512G hard disk", and the host specification of "Host 1-1-2" is "125G main memory + 256G hard disk". Although the hard disks of "Host 1-1-1" and "Host 1-1-2" are both larger than 200G, "Host 1-1-2" wastes less resources than "Host 1-1-1" while ensuring that the target Mycat can run normally. Therefore, the target host found can be "Host 1-1-2".

[0097] S204: Pre-occupy resources of the target host according to the specification information to obtain pre-occupancy information.

[0098] In an embodiment of the present application, after S203 finds a target host that is compatible with the specification information, resources can be pre-occupied for the target host first to prevent other programs from pre-occupying the target host. Therefore, when resource pre-occupancy is completed and pre-occupancy information is obtained, the host specifications of the target host are different from the host specifications before resource pre-occupancy. The host specifications at this time are smaller than the host specifications before resource pre-occupancy, and the reduced specification amount can be the specification amount of the specification information in the deployment information. Therefore, in an embodiment of the present application, the information of the target host and the specification information can be recorded in the pre-occupancy information.

[0099] For example, if the specification information of the target Mycat includes a hard disk of 200G, and the target host is "host 1-1-2" in S203, and its host specification is "main memory 125G + hard disk 256G", after pre-occupying resources of the target host according to the specification information, the pre-occupation information may include that the target host is "host 1-1-2", and the remaining hard disk specification of "host 1-1-2" is 56G, and the required hard disk specification of the target Mycat is 200G.

[0100] S205. Create resources in the target host according to the pre-occupancy information to complete the deployment and operation of the target Mycat.

[0101] Because usually, the Mycat architecture can include a virtual Internet Protocol address (Virtual Internet Protocol, VIP), load balancing resources, monitoring services, Mycat instances and sharding host instances, wherein the business virtual Internet Protocol address points to the load balancing resource, the monitoring service is used to monitor the working status of the load balancing resource, the load balancing resource is connected to the Mycat instance, the Mycat instance is connected to the sharding host instance, and after the business application server initiates an access request to a database such as a MySQL database, it first accesses the load balancing resource through the VIP, distributes the load balancing to the Mycat instance through the load balancing resource, and monitors the operation of the load balancing resource through the monitoring service, and finally accesses the sharding host instance through the Mycat instance to realize the business application server's access to the database. Therefore, creating resources according to the pre-occupied information can include setting the virtual Internet Protocol address, creating load balancing resources, monitoring services, sharding host instances and Mycat instances, etc. It should be noted that in the embodiment of the present application, resource creation can also include other related settings related to Mycat deployment, such as the master-slave relationship and the master-master relationship of the sharding host instance, which are not specifically limited here.

[0102] In the embodiment of the present application, first, according to the deployment information of the target Mycat set by the user, the target Mycat is automatically matched with a target host that matches its specification information, and then resources are pre-occupied and created for the target host according to the specification information to realize automatic deployment and operation of the target Mycat. There is no need to manually search for the computer room and deploy Mycat, which saves time and effort. In addition, the user does not need to understand the complete architecture of Mycat, but only needs to select the relevant deployment information that matches his or her own needs to quickly and automatically complete the Mycat deployment, which greatly improves the deployment efficiency and reduces the workload of business personnel.

[0103] In some embodiments of the present application, searching for a host that matches the specification information from multiple hosts to obtain a target host may further include:

[0104] Each host in multiple clusters is traversed until the specification information matches the host specification of the host, and then the traversal is stopped to obtain the target host.

[0105] In the embodiment of the present application, since the resource pool may include multiple server clusters and each server cluster may include multiple hosts, when searching for a host that matches the specification information, each host in each cluster may be traversed one by one.

[0106] Assume that there are 4 clusters in the resource pool (such as "Cluster 1-1", "Cluster 1-2", "Cluster 1-3" and "Cluster 1-4"), and each cluster has 8 hosts. The first host in "Cluster 1-1" is named "Host 1-1-1", and the second host in "Cluster 1-1" is named "Host 1-1-2", and so on. When traversing the hosts in the clusters, the 8 hosts in "Cluster 1-1" can be traversed first. If there is no host that matches the specification information, the 8 hosts in "Cluster 1-2" can be traversed. If there is still no host that matches the specification information, the 8 hosts in "Cluster 1-3" can be traversed. , that is, traverse in the order of cluster arrangement until a host that matches the specification information is found, then stop traversing; in addition to sequential traversal, you can also traverse in reverse order according to the cluster arrangement, for example, first traverse the 8 hosts in "Cluster 1-4", if there is no host that matches the specification information, then traverse the 8 hosts in "Cluster 1-3", if there is still no host that matches the specification information, then traverse the 8 hosts in "Cluster 1-2", that is, traverse in reverse order according to the cluster arrangement, until a host that matches the specification information is found, then stop traversing; in addition, for the 8 hosts in each cluster, you can also refer to the above-mentioned cluster traversal method for traversal, which will not be described in detail here. It should be noted that in addition to traversing in the order of cluster arrangement, reverse order, etc., you can also traverse the cluster randomly. In actual applications, you can choose the traversal method according to the actual situation, which is not limited here.

[0107] like Figure 4 As shown, it is a flow chart of an embodiment of obtaining pre-occupancy information in the present application. In some embodiments of the present application, the specification information includes instance information of the target Mycat, and resources are pre-occupied on the target host according to the specification information to obtain the pre-occupancy information, which may further include:

[0108] S401: Bind instance information to a target host, and save binding information for recording a binding relationship between the instance information and the target host.

[0109] In an embodiment of the present application, the instance information of the target Mycat can be the shard host instance information and the Mycat instance information. Binding the instance information with the target host means binding the shard host instance information with the target host, and binding the Mycat instance information with the target host so that a corresponding relationship, i.e. a binding relationship, is formed between the shard host instance information and the target host, and between the Mycat instance information and the target host. The binding information may include the above-mentioned corresponding relationship and is stored in the server.

[0110] For example, the shard host instance information may include relational database service (RDS) information and the shard host instance name, the Mycat instance information may include the target Mycat instance name, and the binding information may be the binding relationship between the RDS information, the shard host instance name, the target Mycat instance name and the target host.

[0111] S402: Subtract the specification information from the host specification of the target host to complete resource preoccupancy and obtain preoccupancy information, wherein the preoccupancy information includes the specification information and the host information of the target host.

[0112] In the embodiment of the present application, pre-occupancy of resources for the target host can be regarded as occupying the resources of the target host required for deploying the target Mycat first according to the specification information of the target Mycat, so as to prevent other programs from occupying the target host resources before deploying the target Mycat. Therefore, when pre-occupying resources, the host specifications of the target host are subtracted from the specification information, and the subtracted part is the part used to deploy the target Mycat. Therefore, the pre-occupancy information can be obtained based on the information of the subtracted host specifications, and the pre-occupancy information records the information of the target host and the specification information.

[0113] Assume that the specification information of the target Mycat includes a 200G hard disk, and the target host is "host 1-1-2" in S203, and its host specification is "125G main memory + 256G hard disk". According to the specification information, resources are pre-occupied for the target host, that is, the 256G hard disk of "host 1-1-2" is subtracted from the 200G hard disk in the specification information. The pre-occupation information may include that the target host is "host 1-1-2", and the remaining hard disk specification of "host 1-1-2" is 56G, and the specification information of the target Mycat is a 200G hard disk.

[0114] like Figure 5 As shown, it is a schematic diagram of an embodiment of resource creation in the present application. In some embodiments of the present application, the instance information includes the shard host instance information and the Mycat instance information. Creating resources in the target host according to the pre-occupied information may further include:

[0115] S501. Generate basic information of the target Mycat according to the pre-occupied information, wherein the basic information includes the domain name of the target host.

[0116] In an embodiment of the present application, the basic information may include information of the target host, specification information, instance information, the domain name (Domain Name, DN) of the target host, and connection information between the various parts under the target Mycat structure, such as the virtual Internet Protocol address, load balancing resources, monitoring services, Mycat instances, and the connection relationship between shard host instances. Among them, the domain name is a network composed of a string of names separated by dots, such as the name used to identify the target host on a local area network. It is used to locate and identify the target host during data transmission.

[0117] S502: Obtain a binding application for the virtual Internet Protocol address of the target Mycat, and bind the virtual Internet Protocol address to the domain name so that the virtual Internet Protocol address is associated with the domain name.

[0118] In the Mycat architecture, the virtual Internet Protocol address VIP is a floating access Internet Protocol address (Internet Protocol, VIP), which can be used to access the Mycat cluster, i.e., the Mycat instance. Since the VIP address has the disadvantages of being inconvenient to remember and cannot display the name and nature of the address organization, the embodiment of the present application binds the VIP address to the domain name, and can also map the domain name and VIP address to each other through the domain name system (DNS) to ensure that the domain name and the VIP address correspond one to one.

[0119] For example, the VIP address is "192.168.209.130", the domain name of the target host is "domain.com", and the original IP address of the target host is "192.168.209.135". After binding the VIP address and the domain name, the target host can be accessed through the original IP address "192.168.209.135" or directly through the VIP address "192.168.209.130".

[0120] S503. Create a load balancing resource and a monitoring service for the target Mycat according to the basic information, wherein the load balancing resource is used to distribute the load to the target Mycat, and the monitoring service is used to monitor the operation of the load balancing resource.

[0121] In an embodiment of the present application, the load balancing resource and the monitoring service can be Haproxy combined with Keepalived, wherein Haproxy is a free and open source software written in C language, which can provide high availability, load balancing, and application proxy based on Transmission Control Protocol (TCP) and Hypertext Transfer Protocol (HTTP). The load balancing resource can distribute the load balancing to the target Mycat; Keepalived is an exchange mechanism software, which can detect whether Haproxy can be used normally. If Haproxy goes down or fails to work, Keepalived will detect it and remove Haproxy from the system, and use other Haproxy to replace the work of Haproxy. When Haproxy works normally, Keepalived automatically adds Haproxy to the system. Therefore, the working status of Haproxy can be monitored through Keepalived.

[0122] Specifically, in the embodiment of the present application, load balancing resources and monitoring services can be created based on the connection information in the basic information, such as the connection relationship between the VIP address and Haproxy, the connection relationship between Haproxy and the Mycat instance, and the monitoring relationship between Haproxy and Keepalived. In addition, in the embodiment of the present application, the configuration or deployment of the target Mycat can also be backed up regularly based on the above connection information.

[0123] S504. Create a shard host instance and a Mycat instance according to the pre-occupancy information, wherein the shard host instance matches the shard host instance information, and the Mycat instance matches the Mycat instance information.

[0124] In an embodiment of the present application, the shard host instance information may be the number of shard host instances planned to be created and the correspondence between each shard host instance, and the Mycat instance information may be the number of Mycat instances planned to be created and the correspondence between each Mycat instance and the shard host instance.

[0125] For example, the shard host instance information can be to create two shard host instances (such as "DB1-DB3" and "DB2-DB4"), where the shard host instance "DB1-DB3" is composed of the Mysql instance "DB1" and the Mysql instance "DB3", and the connection relationship is master-master replication, and the shard host instance "DB2-DB4" is composed of the Mysql instance "DB2" and the Mysql instance "DB4", and the connection relationship is master-master replication; the Mycat instance information can be to create two Mycat instances (such as "Mycat1" and "Mycat2"), where each Mycat instance is connected to the two shard host instances respectively, that is, "Mycat1" is connected to "DB1-DB3" and "DB2-DB4" for communication, and "Mycat2" is connected to "DB1-DB3" and "DB2-DB4" for communication.

[0126] like Figure 6 As shown, it is a schematic diagram of an embodiment of binding a virtual Internet Protocol address application with a domain name in the present application. In some embodiments of the present application, obtaining a binding application for a virtual Internet Protocol address of a target Mycat and binding the virtual Internet Protocol address with a domain name may further include:

[0127] S601. Obtain binding applications of virtual Internet Protocol addresses of target Mycat, calculate the number of binding applications, and establish a corresponding virtual Internet Protocol address list.

[0128] In an embodiment of the present application, there may be one or more virtual Internet Protocol addresses, which may be determined based on the specification information of the target Mycat to be deployed, wherein one virtual Internet Protocol address corresponds to one binding application. In the present application, a virtual Internet Protocol address list for storing VIP addresses may be created, and the VIP addresses may be stored in the virtual Internet Protocol address list according to the order in which the VIP addresses submit binding applications.

[0129] For example, if the VIP addresses that have applied for binding successively are VIP address 1 (such as "192.168.209.130") and VIP address 2 (such as "192.168.209.132"), the first line of the virtual Internet Protocol address list can record "1-VIP address 1-192.168.209.130", and the second line can record "2-VIP address 2-192.168.209.130".

[0130] S602: Record the virtual Internet Protocol address list into the basic information.

[0131] In the embodiment of the present application, after the virtual Internet Protocol address list is created, the virtual Internet Protocol address list can also be synchronously saved in the basic information of S501.

[0132] S603: Bind the virtual Internet Protocol addresses in the virtual Internet Protocol address list to the domain names respectively.

[0133] In an embodiment of the present application, the VIP addresses are respectively bound to the domain names so that the VIP addresses are respectively associated one-to-one with the domain names. For example, the domain name of the target host is "domain.com", and the original IP address of the target host is "192.168.209.135". After VIP address 1 and VIP address 2 are respectively bound to the domain names, the target host can be accessed not only through the original IP address "192.168.209.135", but also directly through VIP address 1 "192.168.209.130" or through VIP address 2 "192.168.209.132".

[0134] like Figure 7 As shown, it is a schematic diagram of an embodiment of the process of implementing the target Mycat expansion in an embodiment of the present application. In some embodiments of the present application, after the target Mycat is deployed and maintained, the method may further include:

[0135] S701, obtaining the expansion information of the target Mycat;

[0136] S702, searching for a host that matches the capacity expansion information among multiple hosts to obtain an expanded host;

[0137] S703, pre-occupying capacity expansion resources for the capacity expansion host according to the capacity expansion information, and obtaining capacity expansion pre-occupancy information;

[0138] S704. Perform capacity expansion scheduling for the expansion host according to the capacity expansion pre-occupancy information to complete the target Mycat capacity expansion.

[0139] In the embodiment of the present application, the expansion information is similar to the deployment information. In S702 and S703, the expansion host that is compatible with the expansion information is searched, and the expansion resources are pre-occupied for the expansion host, which is similar to the search for the target host and the pre-occupation of resources for the target host in the above embodiment. In S704, the expansion of the expansion host is orchestrated, which is also similar to the creation of resources for the target host in the above embodiment. In the embodiment of the present application, the expansion of the target Mycat is equivalent to further deployment of the target Mycat. Therefore, for the detailed steps of S701-S704, please refer to the above-mentioned embodiment of the target Mycat deployment, and the details will not be repeated here.

[0140] For example, according to business needs, the user needs to expand the target Mycat and deploy a Mycat system with the software version of Mycat1.5.3 in Shenzhen Futian District. Similarly, the specification information of the Mycat system is that the database version of Mycat docking is MySQL5.7.19, the hard disk is 200G, and it includes 8 master instances and 1 node. When selecting the expansion information, the user selects the deployment area identifier of Shenzhen Futian District (such as "02"), the software version is Mycat1.5.3, and the specification information is the database version MySQL5.7.19, the hard disk is 200G, 8 master instances and 1 node; then according to the relationship table, the resource corresponding to Shenzhen Futian District is found, which is resource pool No. 1. In resource pool No. 1, the same Similarly, the hosts in the cluster are traversed to find the hosts that match the expansion information. For example, when traversing to "host 1-1-4" in "cluster 1-1" (such as the host specification of "host 1-1-4" is "main memory 125G + hard disk 256G"), the traversal is stopped, and the expansion host is "host 1-1-4", and expansion resources are pre-occupied for "host 1-1-4", that is, the expansion pre-occupancy information may include that the target host is "host 1-1-4", and the remaining hard disk specification of "host 1-1-4" is 56G, and the target Mycat expansion requirement hard disk specification is 200G, and then the expansion is arranged according to the expansion pre-occupancy information, that is, the expansion is created. Similarly, it can include the setting of virtual Internet Protocol addresses, the creation of load balancing resources, monitoring services, shard host instances and Mycat instances, etc.

[0141] In addition, in an embodiment of the present application, the Mycat system deployment and operation method may also include offline management of the deployed target Mycat in the target host. The offline management may include two stages, wherein the first stage is to obtain the target Mycat to be taken offline. If there are multiple target Mycats to be taken offline, a corresponding offline list is generated; the second stage is to delete the monitoring service, load balancing resources, domain name system, shard host instance, and private network (Virtual Private Cloud, VPC) of the target Mycat to be taken offline, so as to realize the offline of the target Mycat.

[0142] In order to better implement the Mycat system deployment and operation and maintenance method in this application, based on the Mycat system deployment and operation and maintenance method, this application also provides a Mycat system deployment and operation and maintenance device, such as Figure 8 As shown, it is a schematic diagram of the structure of an embodiment of the Mycat system deployment operation and maintenance device provided in this application. The Mycat system deployment operation and maintenance device 800 includes:

[0143] The acquisition module 801 is used to acquire the deployment information of the target Mycat, wherein the deployment information carries the deployment area identifier for deploying the target Mycat and the specification information of the target Mycat;

[0144] Processing module 802 is used to find a target deployment zone corresponding to the deployment zone identifier and a resource pool bound to the target deployment zone, wherein the resource pool includes multiple clusters, and each cluster includes multiple hosts;

[0145] From multiple hosts, search for a host that matches the specification information to obtain a target host;

[0146] Pre-occupy resources of the target host according to the specification information to obtain pre-occupancy information;

[0147] The deployment module 803 is used to create resources in the target host according to the pre-occupancy information to complete the deployment and operation of the target Mycat.

[0148] In some embodiments of the present application, the processing module 802 may be specifically used to:

[0149] Each host in multiple clusters is traversed until the specification information matches the host specification of the host, and then the traversal is stopped to obtain the target host.

[0150] In some embodiments of the present application, the specification information includes instance information of the target Mycat, and the processing module 802 may also be used to:

[0151] Binding the instance information to the target host, and saving binding information for recording the binding relationship between the instance information and the target host;

[0152] Subtract the specification information from the host specification of the target host to complete resource pre-occupancy and obtain pre-occupancy information, wherein the pre-occupancy information includes the specification information and the host information of the target host.

[0153] In some embodiments of the present application, the instance information includes shard host instance information and Mycat instance information, and the deployment module 803 can be specifically used to:

[0154] Generate the basic information of the target Mycat according to the pre-occupied information, wherein the basic information includes the domain name of the target host;

[0155] Obtain a binding application for the virtual Internet Protocol address of the target Mycat, and bind the virtual Internet Protocol address to the domain name;

[0156] Create the load balancing resource and monitoring service of the target Mycat based on the basic information. The load balancing resource is used to distribute the load to the target Mycat, and the monitoring service is used to monitor the operation of the load balancing resource.

[0157] According to the pre-occupancy information, a shard host instance and a Mycat instance are created, wherein the shard host instance matches the shard host instance information, and the Mycat instance matches the Mycat instance information.

[0158] In some embodiments of the present application, the deployment module 803 may also be used to:

[0159] Obtain binding applications for virtual Internet Protocol addresses of target Mycat, calculate the number of binding applications, and establish a corresponding virtual Internet Protocol address list;

[0160] Recording a list of virtual Internet Protocol addresses into basic information;

[0161] Bind the virtual Internet Protocol addresses in the virtual Internet Protocol address list to the domain names respectively.

[0162] In some embodiments of the present application, the acquisition module 801 may be specifically used to acquire the expansion information of the target Mycat;

[0163] The processing module 802 may be specifically used to search for a host that matches the capacity expansion information among multiple hosts to obtain the capacity expansion host;

[0164] Pre-occupy the capacity expansion resources of the expansion host according to the capacity expansion information to obtain the capacity expansion pre-occupancy information;

[0165] The deployment module 803 may be specifically used to perform capacity expansion arrangement for the expansion host according to the capacity expansion pre-occupancy information to complete the target Mycat capacity expansion.

[0166] It should be noted that, in the present application, the relevant contents of the acquisition module 801, the processing module 802 and the deployment module 803 correspond to the above one by one, and the technicians in the relevant field can clearly understand that for the convenience and simplicity of description, the specific working process of the Mycat system deployment operation and maintenance device and its corresponding modules described above can refer to the following. Figures 2 to 7 The description of the Mycat system deployment and operation method in any embodiment will not be repeated here.

[0167] In order to better implement the Mycat system deployment and operation and maintenance method of the present application, on the basis of the Mycat system deployment and operation and maintenance method, the present application also provides a Mycat system deployment and operation and maintenance device, which integrates any Mycat system deployment and operation and maintenance device provided by the present application, and the device includes:

[0168] One or more processors 901;

[0169] Memory 902; and

[0170] One or more applications, wherein the one or more applications are stored in the memory 902 and configured to be executed by the processor 901 in the steps of the Mycat system deployment and operation and maintenance method of any embodiment of the Mycat system deployment and operation and maintenance method described above.

[0171] like Fig. 9 As shown, it shows a schematic diagram of the structure of an embodiment of the Mycat system deployment operation and maintenance equipment involved in the present application, specifically:

[0172] The device may include components such as a processor 901 with one or more processing cores, a memory 902 with one or more computer-readable storage media, a power supply 903, and an input unit 904. Those skilled in the art will appreciate that Fig. 9 The device structure shown in the figure does not constitute a limitation of the device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0173] The processor 901 is the control center of the device, and uses various interfaces and lines to connect various parts of the entire device. By running or executing software programs and / or modules stored in the memory 902, and calling data stored in the memory 902, the processor 901 performs various functions of the device and processes data, thereby monitoring the device as a whole. Optionally, the processor 901 may include one or more processing cores; the processor 901 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Preferably, the processor 901 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 901.

[0174] The memory 902 can be used to store software programs and modules. The processor 901 executes various functional applications and data processing by running the software programs and modules stored in the memory 902. The memory 902 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 902 may also include a memory controller to provide the processor 901 with access to the memory 902.

[0175] The device also includes a power supply 903 for supplying power to each component. Preferably, the power supply 903 can be logically connected to the processor 901 through a power management system, so as to manage charging, discharging, power consumption management and other functions through the power management system. The power supply 903 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0176] The device may further include an input unit 904 and an output unit 905. The input unit 904 may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0177] Although not shown, the device may also include a display unit, etc., which will not be described in detail here. Specifically in the present application, the processor 901 in the device will load the executable files corresponding to the processes of one or more applications into the memory 902 according to the following instructions, and the processor 901 will run the application stored in the memory 902 to implement various functions, as follows:

[0178] Obtaining deployment information of the target Mycat, wherein the deployment information carries a deployment zone identifier for deploying the target Mycat and specification information of the target Mycat;

[0179] Find a target deployment zone corresponding to the deployment zone identifier and a resource pool bound to the target deployment zone, wherein the resource pool includes multiple clusters, and each cluster includes multiple hosts;

[0180] From multiple hosts, search for a host that matches the specification information to obtain a target host;

[0181] Pre-occupy resources of the target host according to the specification information to obtain pre-occupancy information;

[0182] Create resources in the target host according to the pre-occupancy information to complete the deployment and operation of the target Mycat.

[0183] A person skilled in the art will appreciate that all or part of the steps in the various methods described above may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0184] To this end, the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any Mycat system deployment and operation method provided in the present application. For example, the computer program is loaded by a processor to execute the following steps:

[0185] Obtaining deployment information of the target Mycat, wherein the deployment information carries a deployment zone identifier for deploying the target Mycat and specification information of the target Mycat;

[0186] Find a target deployment zone corresponding to the deployment zone identifier and a resource pool bound to the target deployment zone, wherein the resource pool includes multiple clusters, and each cluster includes multiple hosts;

[0187] From multiple hosts, search for a host that matches the specification information to obtain a target host;

[0188] Pre-occupy resources of the target host according to the specification information to obtain pre-occupancy information;

[0189] Create resources in the target host according to the pre-occupancy information to complete the deployment and operation of the target Mycat.

[0190] Due to the instructions stored in the computer-readable storage medium, the present application can be executed. Figures 2 to 7 Corresponding to the steps in the Mycat system deployment and operation method in any embodiment, the present application can be implemented as follows Figures 2 to 7 For the beneficial effects that can be achieved by the Mycat system deployment and operation and maintenance method in any embodiment, please refer to the previous description in detail and will not be repeated here.

[0191] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.

[0192] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous embodiments and will not be repeated here.

[0193] The above is a detailed introduction to a Mycat system deployment and operation method, device, equipment and storage medium provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The above description is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A Mycat system deployment and operation method, characterized in that: The method comprises: Obtaining deployment information of a target Mycat, wherein the deployment information carries a deployment area identifier for deploying the target Mycat and specification information of the target Mycat; Searching for a target deployment zone corresponding to the deployment zone identifier and a resource pool bound to the target deployment zone, wherein the resource pool includes a plurality of clusters, and each of the clusters includes a plurality of hosts; Searching for a host that matches the specification information from the plurality of hosts to obtain a target host; Pre-occupy resources of the target host according to the specification information to obtain pre-occupancy information; Creating resources in the target host according to the pre-occupied information to complete the deployment and operation of the target Mycat; The specification information includes instance information of the target Mycat, and pre-occupying resources of the target host according to the specification information to obtain pre-occupancy information includes: Binding the instance information to the target host, and saving binding information for recording a binding relationship between the instance information and the target host; The resource pre-occupancy is completed by subtracting the specification information from the host specification of the target host, thereby obtaining the pre-occupancy information, wherein the pre-occupancy information includes the specification information and the host information of the target host.

2. The method according to claim 1, characterized in that The step of searching a host that matches the specification information from the plurality of hosts to obtain a target host includes: Each of the hosts in the plurality of clusters is traversed until the specification information matches the host specification of the host, and then the traversal is stopped to obtain the target host.

3. The method according to claim 1, characterized in that: The instance information includes shard host instance information and Mycat instance information, and creating resources in the target host according to the pre-occupied information includes: Generate basic information of the target Mycat according to the pre-occupied information, wherein the basic information includes the domain name of the target host; Obtaining a binding application for a virtual Internet Protocol address of the target Mycat, and binding the virtual Internet Protocol address to the domain name so that the virtual Internet Protocol address is associated with the domain name; According to the basic information, create a load balancing resource and a monitoring service of the target Mycat, wherein the load balancing resource is used to distribute the load to the target Mycat, and the monitoring service is used to monitor the operation of the load balancing resource; According to the pre-occupancy information, a shard host instance and a Mycat instance are created, wherein the shard host instance matches the shard host instance information, and the Mycat instance matches the Mycat instance information.

4. The method according to claim 3, characterized in that The step of obtaining a binding application for the virtual Internet Protocol address of the target Mycat and binding the virtual Internet Protocol address to the domain name includes: Obtaining binding applications for the virtual Internet Protocol addresses of the target Mycat, calculating the number of the binding applications, and establishing a corresponding virtual Internet Protocol address list; Recording the virtual Internet Protocol address list into the basic information; The virtual Internet Protocol addresses in the virtual Internet Protocol address list are respectively bound to the domain names.

5. The method according to claim 3, characterized in that: The basic information includes the connection information of the target Mycat, and the connection information is used to create the load balancing resource and the monitoring service.

6. The method according to claim 1, characterized in that After the target Mycat is deployed and maintained, the method further includes: Obtain the expansion information of the target Mycat; Searching for a host that is compatible with the capacity expansion information among the plurality of hosts to obtain an expanded host; Pre-occupying capacity expansion resources on the capacity expansion host according to the capacity expansion information to obtain capacity expansion pre-occupancy information; The expansion host is expanded and arranged according to the expansion pre-occupancy information to complete the target Mycat expansion.

7. A Mycat system deployment and operation device, characterized in that: include: An acquisition module, used to acquire deployment information of a target Mycat, wherein the deployment information carries a deployment area identifier for deploying the target Mycat and specification information of the target Mycat; A processing module, configured to search for a target deployment zone corresponding to the deployment zone identifier and a resource pool bound to the target deployment zone, wherein the resource pool includes a plurality of clusters, and each of the clusters includes a plurality of hosts; Searching for a host that matches the specification information from the plurality of hosts to obtain a target host; Pre-occupy resources of the target host according to the specification information to obtain pre-occupancy information; A deployment module, used to create resources in the target host according to the pre-occupied information to complete the deployment and operation of the target Mycat; Wherein, the specification information includes instance information of the target Mycat, and the processing module is further used for: Binding the instance information to the target host, and saving binding information for recording a binding relationship between the instance information and the target host; The resource pre-occupancy is completed by subtracting the specification information from the host specification of the target host, thereby obtaining the pre-occupancy information, wherein the pre-occupancy information includes the specification information and the host information of the target host.

8. A Mycat system deployment and operation equipment, characterized in that: The device comprises: one or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the Mycat system deployment and operation method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the Mycat system deployment and operation method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and system for dispatching cloud computed resources

    CN103248659A

  • Distributed application intelligent deployment method and system in cloud platform

    CN103810023A

  • Data fragmentation method and device

    CN111324606A

  • Server cluster deployment method and device, equipment and storage medium

    CN111459654A

  • Resource based virtual computing instance scheduling

    US20180095776A1