Cache deployment system, cache deployment method, electronic device and storage medium
Through the cache deployment system, users can generate deployment requests through intuitive template files input content, and the system automatically determines and builds a Redis cluster, solving the cumbersome and error-prone problems in the existing technology, and improving deployment efficiency and user experience.
Patent Information
- Application Number
- CN202011334113.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-24
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2040-11-24
AI Technical Summary
In the prior art, users lack standardized processes for applying to use Redis middleware, which leads to time-consuming and labor-intensive deployment and error-prone. In addition, the application configuration requires restarting the application using Redis, which affects the user experience.
Provides a cache deployment system, including a cache management platform, a cache computing platform, a proxy program and a proxy server cluster. Users use the cache management platform to input template content to generate deployment requests. The cache computing platform determines the scale of the Redis cluster and builds the cluster based on the request. The agent registers and monitors the Redis cluster, and the proxy server cluster pushes the Redis cluster address to the application.
It improves the deployment efficiency of Redis cluster, avoids the redundant or insufficient capacity of Redis cluster, reduces the risk and time of manual operations, and improves the user experience.
Smart Images

Figure CN114546580B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data cache technology. Specifically, the present application relates to a cache deployment system, a cache deployment method, an electronic device and a storage medium. Background Art
[0002] The existing technology usually builds a deployment package as a whole according to the commonly used cluster form. When needed, it is deployed and started through the deployment tool. The instance call address is provided offline, and the user configures the cache instance address for calling. When resources are insufficient, new instances are deployed and added to the cluster based on the cached CPU and memory usage, which are mostly manual operations by operation and maintenance personnel.
[0003] There is no standardized process or convenient channel for users to apply for the use of Redis middleware; the entire process is offline manual operation, which is time-consuming, labor-intensive and error-prone; and the application configuration to use Redis requires restarting the application, affecting the user experience. Summary of the invention
[0004] Embodiments of the present invention provide a cache deployment system, a cache deployment method, an electronic device, and a storage medium that overcome the above problems or at least partially solve the above problems.
[0005] In a first aspect, a cache deployment system is provided, the system comprising:
[0006] The cache management platform is used to receive the template content input by the user, import the template content into the template file to obtain a deployment request, and send the deployment request to the cache computing platform;
[0007] The cache computing platform is used to determine the scale of the Redis cluster required for deployment according to the deployment request, build and start the Redis cluster according to the scale, and write the address of the Redis cluster and the address of the proxy server cluster into the environment variables;
[0008] The proxy program is used to read the environment variables to obtain the address of the Redis cluster and the address of the proxy server cluster, and register the address of the Redis cluster to the proxy server cluster;
[0009] The proxy server cluster is used to push the address of the Redis cluster to the application so that the application can obtain the address of the Redis cluster and read and write cached data.
[0010] In a possible implementation, the proxy program is also used to monitor the usage status of cache resources deployed in the Redis cluster according to the address of the Redis cluster, and report the monitoring results to the cache management platform.
[0011] In a possible implementation, the cache management platform is further configured to: if the monitoring result meets the preset expansion requirement, send an expansion request to the cache computing platform so that the cache computing platform increases the number of Redis nodes in the Redis cluster.
[0012] In a possible implementation, the template content also includes a unique identifier of the user and a unique identifier of the application;
[0013] The proxy server cluster is also used to synchronize the address of the Redis cluster to the cache management platform, so that the cache management platform can establish a mapping relationship between the user's unique identifier, the application's unique identifier, and the address of the Redis cluster.
[0014] In a possible implementation, the cache management platform is also used to provide the user with the address of the Redis cluster and the monitoring result according to the mapping relationship.
[0015] In a possible implementation, the proxy server cluster includes a master proxy server and a slave proxy server;
[0016] The master proxy server is used to receive the registration request sent by the proxy program, record the address of the Redis cluster in the registration request, store the address of the Redis cluster, and synchronize the address of the Redis cluster to the slave proxy server.
[0017] In a second aspect, a cache deployment method according to the above cache deployment system is provided, comprising:
[0018] The cache management platform receives the template content input by the user, imports the template content into the template file to obtain a deployment request, and sends the deployment request to the cache computing platform;
[0019] The cache computing platform determines the scale of the Redis cluster required for deployment according to the deployment request, builds and starts the Redis cluster according to the scale, and writes the address of the Redis cluster and the address of the proxy server cluster into the environment variables;
[0020] The proxy program reads the environment variables to obtain the address of the Redis cluster and the address of the proxy server cluster, and registers the address of the Redis cluster to the proxy server cluster;
[0021] The proxy server cluster pushes the address of the Redis cluster to the application, so that the application obtains the address of the Redis cluster and reads and writes cached data.
[0022] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method provided in the second aspect are implemented.
[0023] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in the second aspect.
[0024] The cache deployment system, cache deployment method, electronic device and storage medium provided by the embodiments of the present invention receive template content input by the user through a cache management platform, and obtain a deployment request by converting the template content into a template file. Compared with the prior art in which the deployment request is completely generated by the user writing the code himself, the deployment efficiency is improved, and the cache computing platform determines the scale of the Redis cluster according to the deployment request, and can adaptively build the Redis cluster to avoid the problem of redundant or insufficient capacity of the Redis cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in describing the embodiments of the present application.
[0026] Figure 1 A schematic diagram of the structure of a cache deployment system provided in an embodiment of the present application;
[0027] Figure 2 A schematic diagram of the interface of the target file of the embodiment of the present application;
[0028] Figure 3 A schematic diagram of the interaction between the cache management platform, the proxy server cluster and the cache computing platform in an embodiment of the present application;
[0029] Figure 4 A schematic diagram of the interaction between the cache management platform and the proxy server cluster in an embodiment of the present application;
[0030] Figure 5 A method for performing cache deployment according to a cache deployment system in an embodiment of the present application is shown;
[0031] Figure 6 A workflow diagram of a cache deployment system according to another embodiment of the present application;
[0032] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present invention.
[0034] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "an" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0035] The cache deployment system, cache deployment method, electronic device and storage medium provided in this application are intended to solve the above technical problems in the prior art.
[0036] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0037] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0038] The present application embodiment provides a cache deployment system, such as Figure 1 As shown, the system includes:
[0039] The cache management platform 101 is used to receive template content input by the user, import the template content into the template file to obtain a deployment request, and send the deployment request to the cache computing platform. The template content includes cache resources required by the application developed by the user.
[0040] The cache management platform of the embodiment of the present application provides a template file to the user, so that the user can quickly generate a deployment request by inputting the corresponding template content according to the template file. It should be understood that the template content of the embodiment of the present application is used to record the specifications of the cache resources required for configuring the application.
[0041] See also Figure 2 , which is a schematic diagram of the interface of the template file of the embodiment of the present application. As shown in the figure, the interface of the template file of the embodiment of the present application is very intuitive, and the template contents such as version type, version number, architecture type, number of shards, node type, instance specifications and password settings can be set.
[0042] Specifically, the embodiment of the present application supports two version types, namely community version and enterprise version. The community version can be used out of the box, easy to use, and fully compatible with the Redis protocol.
[0043] The version number refers to the version number of the Redis cluster used to store cache resources. The embodiment of the present application supports the creation of multiple versions of Redis clusters such as Redis5.0, Redis4.0 and Redis2.8, thereby providing users with rich application scenarios. In order to further facilitate users to select the version number according to their actual needs, it also supports viewing the commands supported by the Redis cluster of each version number.
[0044] The architecture type provides multiple types such as cluster version, standard version and read-write separation version.
[0045] The number of shards refers to the number of Redis instances into which the data, specifically cache resources in this embodiment of the application, is split, so that each instance will only contain a subset of all keys. Redis sharding has two main goals:
[0046] Allows you to use the combined memory of many computers to support a larger database. Without sharding, you are limited to the memory capacity that a single machine can support.
[0047] Allows scaling computing power to multiple cores or multiple servers, and scaling network bandwidth to multiple servers or multiple network adapters.
[0048] The embodiment of the present application can support 4-sharding, 8-sharding, 10-sharding, etc.
[0049] The node type refers to whether the Redis node is a single copy or a dual copy. Taking the dual copy as an example, the dual copy is a double-click hot standby architecture. The working mechanism of dual-machine hot standby actually provides an automatic fault recovery capability for the central server of the entire network system, with data persistence and data reliability.
[0050] The instance specification is the specification of the Redis node. This specification corresponds to the above-mentioned architecture type. For example, when the cluster version architecture type is selected, the instance specification can be 16G cluster version (8 nodes). The template file only displays the specific details under different specifications. For example, under the specification of 16G cluster version (8 nodes), the number of new connections per second is 50,000, the maximum number of connections is 80,000, the loan per shard is 96Mbyte, the maximum intranet loan is 768Mbyte, and the cluster organization has 8 nodes.
[0051] After receiving the deployment request, the cache management platform sends the deployment request to the cache computing platform, so that the cache computing platform specifically calculates the scale of the created Redis cluster.
[0052] The cache computing platform 102 is used to determine the scale of the Redis cluster required for deployment according to the deployment request, build and start the Redis cluster according to the scale, and write the address of the Redis cluster and the address of the proxy server cluster into the environment variables.
[0053] In the embodiment of the present application, the cache computing platform receives the deployment request and determines the required size of the Redis cluster according to the template content recorded in the deployment request to implement containerized deployment of the cache instance. The container technology can achieve elastic expansion and contraction according to the operation status of the cache instance.
[0054] Redis cluster is a distributed, fault-tolerant Redis implementation. The functions that can be used by Redis cluster are a subset of the functions that can be used by ordinary stand-alone Redis. There is no central node or proxy node in the Redis cluster. One of the main design goals of the cluster is to achieve linear scalability. Redis cluster provides a way to run Redis, in which data is automatically partitioned between multiple Redis nodes. Redis cluster also provides a certain degree of availability during partitioning, that is, in actual situations, it can continue to run when some nodes fail or cannot communicate. The Redis cluster of the embodiment of the present application is used to store cache resources required by the application.
[0055] Environment variables refer to some parameters used to specify the operating environment of the operating system, such as temporary folder location and system folder location. An environment variable is an object with a specific name in the operating system, which contains information that will be used by one or more applications. In an embodiment of the present application, environment variables are used to store the address of the Redis cluster and the address of the proxy server cluster. The address of the Redis cluster is recorded to prepare for the subsequent application to deploy the cache using the Redis cluster. The proxy server cluster is recorded because the matter of pushing the Redis cluster address to the application in the embodiment of the present application is executed by the proxy server.
[0056] The proxy program 103 is used to read the environment variables to obtain the address of the Redis cluster and the address of the proxy server cluster, and register the address of the Redis cluster to the proxy server cluster.
[0057] In the embodiment of the present application, a proxy program is set up, and the proxy program registers the address of the Redis cluster to the proxy server cluster, so that the proxy server subsequently pushes the address of the Redis cluster to the application.
[0058] The proxy server cluster 104 is used to push the address of the Redis cluster to the application program, so that the application program obtains the address of the Redis cluster and reads and writes cached data.
[0059] The cache deployment system of the embodiment of the present application receives template content input by the user through the cache management platform, and obtains a deployment request by converting the template content into a template file. Compared with the prior art in which the deployment request is completely generated by the user writing the code himself, the deployment efficiency is improved. The cache computing platform determines the scale of the Redis cluster according to the deployment request, and can adaptively build the Redis cluster to avoid the problem of redundant or insufficient Redis cluster capacity.
[0060] Based on the above embodiments, as an optional embodiment, the agent program is also used to monitor the usage status of cache resources deployed in the Redis cluster according to the address of the Redis cluster, and report the monitoring results to the cache management platform.
[0061] The proxy program of the embodiment of the present application can register the address of the Redis cluster to the proxy server cluster. Another important function is to monitor the usage status of the cache resources deployed in the Redis cluster, thereby laying the foundation for the subsequent expansion of the Redis cluster. In addition, since the user interacts with the cache management platform, which is equivalent to the front end, the proxy program reports the monitoring results to the cache management platform, which can achieve the purpose of displaying the monitoring results by the cache management platform, thereby facilitating users to intuitively obtain the usage status of cache resources.
[0062] As an optional embodiment, the proxy program is deployed together with the Redis cluster and belongs to the same JVM (Java Virtual Machine). In this way, the proxy program can obtain the load of the Redis cluster more quickly, that is, the usage status of the cache resources deployed in the Redis cluster. The higher the usage status, the greater the load of the Redis cluster, and the greater the need for expansion.
[0063] Based on the above embodiments, as an optional embodiment, the cache management platform is also used to: if the monitoring result meets the preset expansion requirements, send an expansion request to the cache computing platform so that the cache computing platform increases the number of Redis nodes in the Redis cluster.
[0064] Specifically, for example, when the cache resource is used too frequently, causing the memory utilization of the Redis cluster to exceed 95%, the monitoring result is considered to meet the preset expansion requirements. After the cache computing platform is expanded, the cache resources will be migrated in the background according to the new sharding algorithm.
[0065] Based on the above embodiments, as an optional embodiment, the template content also includes a unique identifier of the user and a unique identifier of the application;
[0066] The proxy server cluster is also used to synchronize the address of the Redis cluster to the cache management platform, so that the cache management platform can establish a mapping relationship between the user's unique identifier, the application's unique identifier, and the address of the Redis cluster.
[0067] Figure 3 The schematic diagram of the interaction among the cache management platform, the proxy server cluster and the cache computing platform in the embodiment of the present application is as follows: Figure 3 As shown, after the cache computing platform builds each Redis node in the Redis cluster, the agent program reports the address of the Redis cluster to the proxy server cluster, and the proxy server cluster further synchronizes the address of the Redis cluster to the cache management platform, so that the user can know the location where the cache resources of the application are deployed.
[0068] The cache management platform of the embodiment of the present application can create a directory locally, and the levels of the directory from high to low are users, applications, and Redis clusters. For example, the cache of application 110 developed by user 001 is deployed in Redis cluster 200, so the address of Redis cluster 200 is stored in the subfolder of application 110 in the folder of user 001 of the cache management platform. User 001 also developed another application 120, and the cache of application 120 is deployed in Redis cluster 300, so the address of Redis cluster 300 is stored in the subfolder of application 120 in the folder of user 001 of the cache management platform. When the user opens the folder of user 001 in the cache management platform, he can see the subfolders of application 110 and application 120, so as to facilitate the user to better manage cache resources.
[0069] On the basis of the above embodiments, as an optional embodiment, the cache management platform of the embodiment of the present application further provides the user with the address of the Redis cluster and the monitoring results according to the mapping relationship.
[0070] It should be noted that the user can input a query request to the cache management platform, and the query request records the user's unique identifier. The cache management platform then provides the address of the Redis cluster and monitoring results based on the unique identifier of the user recorded in the query request and the mapping relationship.
[0071] On the basis of the above embodiments, the proxy server cluster of the embodiment of the present application includes a master proxy server and a slave proxy server;
[0072] Among them, the main proxy server user receives the registration request sent by the proxy program, records the address of the Redis cluster in the registration request, stores the address of the Redis cluster, and synchronizes the address of the Redis cluster to the slave proxy server.
[0073] Figure 4 Schematic diagram of the interaction between the cache management platform and the proxy server cluster in the embodiment of the present application, such as Figure 4 As shown, after obtaining the address of the proxy server cluster, the proxy program can establish a connection to any master proxy server in the proxy server cluster, and then send the address of the Redis cluster to it. The master proxy server that receives the address of the Redis cluster synchronizes the address of the Redis cluster to other master proxy servers and the slave proxy servers connected to itself, so that the proxy server cluster is synchronized with the address of the Redis cluster. The master proxy server also synchronizes the address of the Redis cluster to the cache management platform.
[0074] The proxy servers in the proxy server cluster of the embodiment of the present application have two roles, one is a master proxy server with read and write permissions, and the other is a slave proxy server with only read permissions. The slave proxy server has the ability to elect a master.
[0075] The master proxy server is used to receive the registration request sent by the proxy program, and the address of the Redis cluster is recorded in the registration request. After receiving the registration request, the master proxy server stores the address of the Redis cluster on the one hand, and synchronizes the address of the Redis cluster to the slave proxy server on the other hand, so that all proxy servers in the entire proxy server cluster synchronize the address of the Redis cluster, so that any proxy server can push the address of the Redis cluster to the application. In the embodiment of the present application, the address of the Redis cluster can be synchronized by the master proxy server to the cache management platform.
[0076] On the basis of the above embodiments, the number of proxy servers in the proxy server cluster is odd, which can ensure successful master election when a small number of proxy servers are down.
[0077] Figure 5 The method for performing cache deployment according to the cache deployment system in the embodiment of the present application is shown. Figure 5 , we can know that:
[0078] S101, the user inputs the target content through the template file provided by the cache management platform, the cache management platform generates a deployment request, and sends the deployment request to the cache computing platform;
[0079] S102, the cache computing platform determines the scale of the Redis cluster required for deployment according to the deployment request, builds and starts the Redis cluster according to the scale, and writes the address of the Redis cluster and the address of the proxy server cluster into the environment variables;
[0080] S104, the proxy program reads the environment variables, obtains the address of the Redis cluster and the address of the proxy server cluster, and registers the address of the Redis cluster in the proxy server cluster;
[0081] S105. The proxy server cluster pushes the address of the Redis cluster to the application program, and the application program deploys the cache resources to the Redis cluster, completing the arrangement of the cache resources.
[0082] Figure 6 This is a workflow diagram of a cache deployment system according to another embodiment of the present application. Figure 6 As shown, including:
[0083] The first step is to transform cache technology into a service, converting the long offline application process into an online visible self-service: users can visually apply for the cache resources required for application operation through template files on the cache management platform. Standardized Redis cluster indicators are provided through orchestration templates, and the required Redis clusters are orchestrated according to user needs. Redis middleware is provided to users as a service and allocated on demand.
[0084] The second step is to deploy automation, integrate the cache computing platform, and realize the automatic deployment and cluster building of the Redis cluster: Different from the traditional manual and script-based deployment and configuration of the cache cluster, the embodiment of the present application uses the cache computing platform to realize the calculation of the Redis cluster scale and the scheduling of network resources, and completes the deployment and automatic script configuration of the Redis cluster according to the template file compiled by the user. This saves labor costs and reduces the risks of manual operations.
[0085] The third step is to automate registration and discovery, using proxy programs and proxy server clusters to automatically register Redis clusters and push Redis cluster addresses. The proxy program is used to register the address information of the Redis cluster after it is started to the proxy server cluster. The proxy server cluster uses the push function to enable applications to discover the Redis cluster, reducing manual configuration and offline interaction with users. The proxy server cluster provides monitoring and health checks for the cache, improving efficiency while ensuring high availability of the system.
[0086] In the fourth step, the application implements cache deployment based on the obtained Redis cluster address.
[0087] An electronic device is provided in an embodiment of the present application, and the electronic device includes: a memory and a processor; at least one program, which is stored in the memory and is used to be executed by the processor. Compared with the prior art, it can achieve: receiving template content input by a user through a cache management platform, and obtaining a deployment request by converting the template content into a template file. Compared with the prior art, the deployment request is completely generated by the user writing the code by himself, which improves the deployment efficiency, and the cache computing platform determines the scale of the Redis cluster according to the deployment request, and can adaptively build the Redis cluster to avoid the problem of redundant or insufficient capacity of the Redis cluster.
[0088] In an alternative embodiment, an electronic device is provided, such as Figure 7 As shown, Figure 7 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.
[0089] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0090] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0091] The memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0092] The memory 4003 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the application code stored in the memory 4003 to implement the contents shown in the above method embodiment.
[0093] The embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer is run on a computer, the computer can execute the corresponding content in the aforementioned method embodiment. Compared with the prior art, the cache management platform receives the template content input by the user, and obtains the deployment request by converting the template content into a template file. Compared with the prior art, the user completely writes the code to generate the deployment request, which improves the deployment efficiency. The cache computing platform determines the scale of the Redis cluster according to the deployment request, and can adaptively build the Redis cluster to avoid the problem of redundant or insufficient capacity of the Redis cluster.
[0094] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0095] The above are only some embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A cache deployment system, characterized in that: include: The cache management platform is used to receive the template content input by the user, import the template content into the template file to obtain a deployment request, and send the deployment request to the cache computing platform; The cache computing platform is used to determine the scale of the Redis cluster required for deployment according to the deployment request, build and start the Redis cluster according to the scale, and write the address of the Redis cluster and the address of the proxy server cluster into environment variables; The proxy program is used to read the environment variables to obtain the address of the Redis cluster and the address of the proxy server cluster, and register the address of the Redis cluster to the proxy server cluster; The proxy server cluster is used to push the address of the Redis cluster to the application program, so that the application program obtains the address of the Redis cluster and reads and writes cached data.
2. The cache deployment system according to claim 1, characterized in that: The proxy program is also used to monitor the usage status of the cache resources deployed in the Redis cluster according to the address of the Redis cluster, and report the monitoring results to the cache management platform.
3. The cache deployment system according to claim 2, characterized in that: The cache management platform is also used to: if the monitoring result meets the preset expansion requirement, send an expansion request to the cache computing platform, so that the cache computing platform increases the number of Redis nodes in the Redis cluster.
4. The cache deployment system according to claim 2, characterized in that: The template content also includes a unique identifier of the user and a unique identifier of the application; The proxy server cluster is also used to synchronize the address of the Redis cluster to the cache management platform, so that the cache management platform establishes a mapping relationship between the unique identifier of the user, the unique identifier of the application, and the address of the Redis cluster.
5. The cache deployment system according to claim 4, characterized in that: The cache management platform is also used to provide the user with the address of the Redis cluster and the monitoring result according to the mapping relationship.
6. The cache deployment system according to claim 1, characterized in that: The proxy server cluster includes a master proxy server and a slave proxy server; The master proxy server is used to receive a registration request sent by the proxy program, record the address of the Redis cluster in the registration request, store the address of the Redis cluster, and synchronize the address of the Redis cluster to the slave proxy server.
7. The cache deployment system according to claim 6, characterized in that: The number of proxy servers in the proxy server cluster is odd.
8. A cache deployment method according to the cache deployment system according to any one of claims 1 to 7, characterized in that: include: The cache management platform receives the template content input by the user, imports the template content into the template file to obtain a deployment request, and sends the deployment request to the cache computing platform; The cache computing platform determines the scale of the Redis cluster required for deployment according to the deployment request, builds and starts the Redis cluster according to the scale, and writes the address of the Redis cluster and the address of the proxy server cluster into environment variables; The proxy program reads the environment variables to obtain the address of the Redis cluster and the address of the proxy server cluster, and registers the address of the Redis cluster to the proxy server cluster; The proxy server cluster pushes the address of the Redis cluster to the application program, so that the application program obtains the address of the Redis cluster and reads and writes cached data.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the cache deployment method as claimed in claim 8 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the steps of the cache deployment method as claimed in claim 8.
Citation Information
Patent Citations
Automatic disposition and maintenance method based on virtualization platform Redis service
CN106506191A
Hadoop cluster distributed deployment method and apparatus
CN107463582A