CN117742737A - Redis cluster deployment and operation method, device, system and equipment - Google Patents
Redis cluster deployment and operation method, device, system and equipment Download PDFInfo
- Publication number
- CN117742737A CN117742737A CN202311676413.7A CN202311676413A CN117742737A CN 117742737 A CN117742737 A CN 117742737A CN 202311676413 A CN202311676413 A CN 202311676413A CN 117742737 A CN117742737 A CN 117742737A
- Authority
- CN
- China
- Prior art keywords
- redis cluster
- description file
- container
- deployment
- redis
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 238000012423 maintenance Methods 0.000 claims abstract description 81
- 238000009434 installation Methods 0.000 claims abstract description 36
- 230000006870 function Effects 0.000 claims description 58
- 230000004048 modification Effects 0.000 claims description 15
- 238000012986 modification Methods 0.000 claims description 15
- 230000009471 action Effects 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 9
- 230000008439 repair process Effects 0.000 claims description 5
- 230000008569 process Effects 0.000 description 19
- 238000010586 diagram Methods 0.000 description 13
- 238000004891 communication Methods 0.000 description 6
- 238000012544 monitoring process Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 4
- 238000011084 recovery Methods 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000008602 contraction Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000013515 script Methods 0.000 description 2
- 238000007792 addition Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 239000010419 fine particle Substances 0.000 description 1
- 210000001503 joint Anatomy 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 239000002245 particle Substances 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000002688 persistence Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000004083 survival effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application discloses a Redis cluster deployment and operation method, a device, a system and equipment, wherein the method comprises the following steps: acquiring a preconfigured Redis cluster description file; each Redis cluster description file is configured for a corresponding Redis cluster; the Redis cluster description file comprises deployment and operation configuration parameters; and deploying and operating the Redis cluster corresponding to the Redis cluster description file on a container platform according to the deployment and operation configuration parameters in the Redis cluster description file. According to the method and the device, the automatic installation and deployment, automatic operation and maintenance and the like of the Redis cluster can be realized, the complexity of manual installation and deployment and operation and maintenance is greatly simplified, the workload of personnel is reduced, the standardization of installation, deployment, operation and maintenance work is improved, and the subsequent upgrading and maintenance operation is facilitated.
Description
Technical Field
The application belongs to the technical field of automatic operation and maintenance, and particularly relates to a Redis cluster deployment and operation and maintenance method, device, system and equipment.
Background
Redis belongs to an infrastructure in the field of NoSQL memory databases, the Redis reading and writing speed is very high, data persistence into a disk is supported, and the performance and usability of applications can be greatly improved by using Redis such as real-time change and display functions, message queues, chat system implementation and the like in some common real-time computation. Meanwhile, redis also belongs to one of the database categories, but Redis operation and maintenance work is relatively traditional and conservative, and the degree of automation is not high.
Disclosure of Invention
The embodiment of the application provides a Redis cluster deployment and operation method, device, system and equipment, which can realize automatic installation deployment and automatic operation of the Redis cluster.
The Redis cluster deployment and operation and maintenance method provided by the embodiment of the application comprises the following steps:
acquiring a preconfigured Redis cluster description file; each Redis cluster description file is configured for a corresponding Redis cluster; the Redis cluster description file comprises deployment and operation configuration parameters;
and deploying and operating the Redis cluster corresponding to the Redis cluster description file on a container platform according to the deployment and operation configuration parameters in the Redis cluster description file.
The Redis cluster automation installation, deployment and operation device provided by the embodiment of the application comprises:
a file acquisition unit, configured to acquire a preconfigured Redis cluster description file; each Redis cluster description file is configured for a corresponding Redis cluster; the Redis cluster description file comprises deployment and operation configuration parameters;
the deployment operation and maintenance unit is used for deploying and operating the Redis cluster corresponding to the Redis cluster description file on the container platform according to the deployment and operation and maintenance configuration parameters in the Redis cluster description file.
The Redis cluster automation installation deployment system provided by the embodiment of the application comprises a Redis automation operation and maintenance controller, wherein the Redis automation operation and maintenance controller comprises a function code module and a Redis cluster description file, logic codes are packaged in the function code module, and the logic codes of the function code module are used for executing the following steps:
acquiring a preconfigured Redis cluster description file; each Redis cluster description file is configured for a corresponding Redis cluster; the Redis cluster description file comprises deployment and operation configuration parameters;
and deploying and operating the Redis cluster corresponding to the Redis cluster description file on a container platform according to the deployment and operation configuration parameters in the Redis cluster description file.
The embodiment of the application provides a computer readable storage medium, on which a computer program is stored, which when executed in a computer, causes the computer to execute the method.
The computing device provided by the embodiment of the application comprises a memory and a processor, wherein executable codes are stored in the memory, and the method is realized when the executable codes are executed by the processor.
According to the Redis cluster deployment and operation and maintenance method, device, system and equipment, firstly, a preconfigured Redis cluster description file is obtained, and then according to each Redis cluster description file, a Redis cluster corresponding to the Redis cluster description file is automatically installed, deployed and operated and maintained on a container platform. According to the embodiment of the application, the automatic installation and deployment, automatic operation and maintenance and the like of the Redis cluster can be realized, the complexity of manual installation and deployment and operation and maintenance is greatly simplified, the workload of personnel is reduced, the standardization of installation, deployment, operation and maintenance work is improved, and the subsequent upgrading and maintenance operation is facilitated.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described, and it is possible for a person skilled in the art to obtain other drawings according to these drawings without inventive effort.
FIG. 1 is a flow diagram of a Redis cluster automation installation deployment and operation and maintenance method in one embodiment of the present application;
FIG. 2 is a schematic diagram of a Redis cluster automation installation deployment operation and maintenance system in one embodiment of the present application;
FIG. 3 is a schematic diagram of a relationship between a Redis cluster automation installation deployment operation and maintenance system, a container platform, and a Redis cluster in one embodiment of the present application;
FIG. 4 is a schematic diagram of a relationship between a Redis cluster of a client, a sentinel mode, and a client in one embodiment of the present application;
FIG. 5 is a schematic diagram of a Redis cluster deployment operation and maintenance device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a computing device in one embodiment of the present application.
Detailed Description
Features and exemplary embodiments of various aspects of the present application are described in detail below to make the objects, technical solutions and advantages of the present application more apparent, and to further describe the present application in conjunction with the accompanying drawings and the detailed embodiments. It should be understood that the specific embodiments described herein are intended to be illustrative of the application and are not intended to be limiting. It will be apparent to one skilled in the art that the present application may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present application by showing examples of the present application.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
In order to solve the problems in the prior art, an embodiment of the present application provides a method for deploying and operating and maintaining a dis cluster, referring to fig. 1, the method includes the following steps:
s110, acquiring a preconfigured Redis cluster description file; each Redis cluster description file is configured for a corresponding Redis cluster; the Redis cluster description file comprises deployment and operation configuration parameters;
s120, deploying and operating the Redis cluster corresponding to the Redis cluster description file on a container platform according to the deployment and operation configuration parameters in the Redis cluster description file.
That is, if a new Redis cluster is to be installed and deployed, the Redis cluster description file of the Redis cluster is acquired first, and then the Redis cluster is automatically installed and deployed and automatically operated and maintained on the container platform according to the Redis cluster description file.
Specifically, referring to fig. 2 and fig. 3, the logic code corresponding to each step in the embodiment of the present application may be packaged as a functional code module, and the functional code module and the dis cluster description file are included in the dis automatic operation and maintenance controller. That is, the method provided by the embodiment of the present application may be performed by a functional code module in the Redis automatic operation and maintenance controller.
The function code module is a standardized code module obtained by pre-writing logic codes and then packaging the logic codes. The function of the logic code in the function code module is to automatically install, deploy and automatically operate and maintain the Redis cluster corresponding to the Redis cluster description file on the container platform according to each Redis cluster description file. It can be seen that the automatic installation, deployment and automatic operation and maintenance of the Redis cluster on the container platform can be realized through the function code module.
Wherein, the Redis automatic operation and maintenance controller is a stateless container which independently starts operation. A functional code module and a container platform interface are arranged in the Redis automatic operation and maintenance controller.
Wherein, installing the deployed Redis cluster on the container platform may also be referred to as Redis container cluster. Kubernetes, docker or other container platforms may be employed.
In one embodiment, S120 may include: and deploying and operating the Redis cluster corresponding to the Redis cluster description file on the container platform by calling the container platform interface according to the deployment and operation configuration parameters in the Redis cluster description file.
Specifically, a plurality of container platform interfaces can be set in the Redis automatic operation and maintenance controller, and when automatic installation, deployment and automatic operation and maintenance are required, corresponding functions are realized by calling corresponding container platform interfaces.
The container platform interface is an interface used for being in butt joint with the container platform on the Redis automatic operation and maintenance controller. The English of the container platform interface is Container Platform SPI, and the interface is a function.
In one embodiment, the plurality of container platform interfaces may include: at least two of creating a container interface, querying an interface, deleting a container interface, restarting a container interface, creating a service interface, deleting a service interface, and executing a command within a container.
Wherein the function code module can create a new container on the container platform by calling the create container interface.
The function code module can inquire different information through different kinds of inquiry interfaces.
The function code module can delete the appointed container on the container platform by calling the delete container interface.
The function code module can restart the appointed container on the container platform by calling the restarting container interface.
Wherein the function code module can create a specified service on the container platform by invoking the create service interface.
The function code module can delete the appointed service on the container platform by calling the deleting service interface.
The function code module can connect the appointed container by calling the in-container execution command and execute the local command or script in the appointed container.
The service refers to a Redis service, and there are various Redis services, such as a read-write service, a storage service, and the like.
It can be understood that the function code module in the Redis automatic operation and maintenance controller can realize the creation of related containers and the creation of related services in the Redis cluster in the container platform through the functions provided by the container platform interface, thereby realizing the works such as automatic installation and deployment of the Redis cluster.
In one embodiment, the functions of the automatic operation and maintenance may include at least one of a function of fine-grained monitoring of the dis cluster, a custom alarm function, a log function, a data backup function, and a data recovery function.
Namely, according to the embodiment of the application, the operation and maintenance of multiple aspects such as fine granularity monitoring, custom alarm, log, data backup and data recovery can be realized.
The function of fine granularity monitoring is that after the Redis cluster is installed and deployed, in the operation process of the Redis cluster, a plurality of fine granularity monitoring indexes in the operation process are collected and displayed at the front end, so that a worker at the front end can know the operation condition of the Redis cluster in time conveniently. The fine particle size may be a time particle size in seconds or minutes.
The self-defined alarm function is a function of comparing a monitoring index in the Redis cluster operation process with a corresponding alarm rule, and if the alarm rule is hit, performing alarm operation.
The log function is a function for recording and analyzing generated log data in the Redis cluster running process.
The data backup function refers to a function of data backup processing in the Redis cluster running process, for example, a slave working node backs up data on a master working node to keep master-slave synchronization.
The data recovery function refers to a function of recovering lost data in the operation process of the Redis cluster, for example, after a failure of a master working node, the data on the master working node can be recovered according to the data in the slave working node.
The above improved operation and maintenance functions are relatively advanced operation and maintenance functions, and of course, the automatic operation and maintenance functions can also comprise basic operation and maintenance works, such as password expiration reminding, mirror image version upgrading reminding and the like, expansion of working nodes, modification of passwords, management of sentinel nodes, management of working nodes and the like.
In one embodiment, at least one of the Redis cluster configuration information, the instance list, the user list, and the control authority information is defined in the Redis cluster description file.
Specifically, a dis cluster corresponds to a dis cluster description file, where relevant configuration information of the dis cluster, a list formed by an instance of a relevant container, a list formed by each user of the dis cluster, control rights of each user, and the like are recorded in the dis cluster description file. It can be seen that the Redis cluster description file is used to define the relevant information of the Redis cluster in advance. Thus, the function code module can realize automatic installation, deployment and automatic operation and maintenance of the Redis cluster according to the Redis cluster description file of the Redis cluster.
In one embodiment, the Redis cluster configuration information in the Redis cluster description file may include a mode and node configuration information of a Redis cluster, where the mode is a stand-alone mode, a master-slave mode, a sentinel mode, or a cluster mode.
The mode of the Redis cluster refers to a working mode of the Redis cluster, and installation and deployment processes of the Redis clusters in different modes may be different.
The node configuration information may include configuration information of a master working node, configuration information of a slave working node, configuration information of a sentinel node, and the like.
Of course, the Redis cluster configuration information may include configuration information such as a data partition mode, the number of pages of the exchange file, and the like, in addition to the mode and the node configuration information.
It can be seen that, by defining the Redis cluster configuration information in the Redis cluster description file in advance, the mode and the node of the Redis cluster can be configured in a related manner.
In one embodiment, the Redis cluster description file may further include adjustable parameters in the process of automatic installation, deployment and automatic operation and maintenance;
correspondingly, the method provided by the embodiment of the application can further comprise the following steps:
receiving a modification submission instruction of an operation and maintenance personnel for deployment and operation and maintenance configuration parameters in the Redis cluster description file, wherein the modification submission instruction comprises the modified deployment and operation and maintenance configuration parameters;
and according to the modified deployment and operation configuration parameters, adjusting the deployment and operation of the Redis cluster corresponding to the Redis cluster description file.
That is, the logic code of the function code module may also be used to: after receiving a modification submitting instruction of an operation and maintenance person to the adjustable parameter in a Redis cluster description file, correspondingly adjusting the automatic installation deployment and automatic operation and maintenance process of the Redis cluster corresponding to the Redis cluster description file according to the modified adjustable parameter.
The Redis cluster description file of the Redis cluster states which parameters in the automatic installation deployment and automatic operation and maintenance process can be adjusted, and initial values of the adjustable parameters can be further set. Therefore, the operation and maintenance personnel only need to modify the adjustable parameters and submit the parameters, and the automatic installation and deployment and the adjustment of the automatic operation and maintenance process can be realized after the submission is effective, so that the operation and maintenance personnel do not need to operate other scripts, other configuration files and the like, and the operation and maintenance personnel are very convenient.
Further, the adjusting the deployment and the operation of the dis cluster corresponding to the dis cluster description file according to the modified deployment and operation configuration parameters may specifically include: comparing the modified deployment and operation adjustment parameters with the actual configuration condition of the Redis cluster; and adjusting according to the comparison result.
That is, the logic code of the function code module may be specifically configured to: receiving a modification submitting instruction of operation and maintenance personnel to deployment and operation and maintenance configuration parameters in the Redis cluster description file; the modification submitting instruction comprises modified deployment and operation configuration parameters; comparing the modified deployment and operation adjustment parameters with the actual configuration condition of the Redis cluster; and adjusting according to the comparison result.
That is, after the operator modifies and submits the adjustable parameters in the Redis cluster description file, a modification submission instruction is generated. After receiving the modification submitting instruction, the function code module enters a parameter adjustment state. In the parameter adjustment state, the adjusted adjustable parameters and the actual configuration condition of the Redis cluster are compared, so that the Redis cluster is automatically adjusted according to the comparison result. Therefore, when the Redis cluster works normally, operation and maintenance personnel can modify the configuration parameters of the Redis cluster at any time through the Redis cluster description file, so that the automatic adjustment of the Redis cluster is realized.
In one embodiment, in a case where the mode of the Redis cluster is a sentinel mode, the deployment and operation configuration parameters include master node configuration information, slave node configuration information, master-slave relationship configuration information, and sentinel configuration information; according to the deployment and operation configuration parameters in the Redis cluster description file, deploying and operating the Redis cluster corresponding to the Redis cluster description file on a container platform can comprise the following steps S1-S4:
S1, reading main node configuration information in a sentinel mode from a Redis cluster description file of the Redis cluster; generating a container template of the main working node according to the main node configuration information; generating a container instance of the master working node in a container template of the master working node by calling a create container interface in a container platform interface; creating a main node service on a container platform according to the service information of the main working node; associating the primary node service with a container instance of the primary working node;
s2, reading slave node configuration information in a sentinel mode from a Redis cluster description file of the Redis cluster; generating a container template of the slave working node according to the slave node configuration information; generating a container instance of the slave working node in the container template of the slave working node by calling a create container interface in the container platform interface;
s3, reading master-slave relation configuration information from a Redis cluster description file of the Redis cluster; detecting and determining a master-slave relationship in a container instance entering each working node by calling a query interface in a container platform interface;
s4, sentinel configuration information is obtained from a Redis cluster description file of the Redis cluster; generating a container template of the sentinel node according to the sentinel configuration information; generating a container instance of the sentinel node in a container template of the sentinel node by calling a create container interface in a container platform interface; creating a sentinel service on the container platform according to the service information of the sentinel nodes; associating the sentinel service with a container instance of the sentinel node.
Specifically, the logic code of the functional code module includes a first code unit, where the first code unit is configured to automatically install and deploy a Redis cluster when a mode of the Redis cluster is a sentinel mode; the first code unit is specifically configured to execute the steps S1 to S4. That is, in the case that the mode of one Redis cluster is the sentinel mode, the automatic installation and deployment process of the logic code of the function code module to the Redis cluster may include the steps S1 to S4 described above.
Based on the above steps S1 to S4, the process of automatically installing the dis cluster deploying the sentinel mode may approximately include: first, a container instance and service of a primary working node are created on a container platform, and then the two are associated. And creating a container instance of the slave working node on the container platform, and carrying out master-slave association on the instance of the master working node and the instance of the slave working node. And then, creating a container instance and service of the sentinel node on the container platform, and associating the container instance and the service with each other, so as to finish the installation and deployment of the Redis cluster of the sentinel mode.
After deployment is completed, any one container in the sentinel nodes in the Redis cluster is selected, the functional code module is connected to the container through an interface of the container platform, and the Redis command is called so as to confirm the deployment state of the Redis cluster.
Referring to fig. 4, a Redis cluster is automatically installed and deployed on a Kubernetes container platform through a Redis automatic operation and maintenance controller, wherein the Redis cluster comprises three working nodes and three sentinel nodes, the three working nodes comprise a master working node and two slave working nodes, the master working node is used for providing a Redis service, and the two slave working nodes keep data synchronization with the master working node. One of the three sentinel nodes is used to interact data between the client at the front end and the master working node at the back end, e.g., the sentinel node detects the survival status of the instance on the master working node and then sends it to the client at the front end. If the sentinel node fails, one of the remaining two sentinel nodes is replaced.
In an embodiment, the method provided in the embodiment of the present application may further include:
after the Redis cluster is installed and deployed, entering an automatic control state;
in the automatic control state, a query interface in a container platform interface is called regularly, and container state information and service state information in the Redis cluster are obtained;
judging whether the container state information and the service state information accord with the expected setting condition in a Redis cluster description file of the Redis cluster or not;
If not, performing automatic repair action.
That is, the logic code of the function code module may be used to: entering an automatic control state after installing and deploying a Redis cluster; in the automatic control state, a query interface in a container platform interface is called regularly, and container state information and service state information in the Redis cluster are obtained; judging whether the container state information and the service state information accord with the expected setting condition in a Redis cluster description file of the Redis cluster; if the data is not matched with the data, performing automatic repairing action.
That is, after installing and deploying a Redis cluster, the function code module enters an automatic control state. In the automatic control state, the function code module can call the query interface regularly, so that container state information and service state information in the Redis cluster are obtained, and the state information is compared with expected setting conditions in the Redis cluster description file. When the difference occurs, automatic repair action can be performed.
In one embodiment, the performing an automatic repair action may include: if the number of the containers is inconsistent, a new container needs to be created or an illegal container needs to be deleted; if a container falls into a false dead condition, it is necessary to destroy the container and rebuild a new container.
That is, the types of self-repair may include:
1. if the number of the containers is inconsistent, a new container needs to be created or an illegal container needs to be deleted;
2. if a container falls into a false dead condition, it is necessary to destroy the container and rebuild a new container.
It can be understood that, by self-repairing, the operation condition of the Redis cluster and the expected setting condition in the Redis cluster description file can be ensured to be consistent as far as possible.
In an actual scene, an operation and maintenance person can revise the Redis cluster description file on a computer interface, set a capacity expansion and contraction rule, for example, the capacity expansion requirement is that the CPU occupancy rate of a container instance reaches 80%, and 80% is a capacity expansion threshold. The automatic expansion and contraction logic code of the function code module in the Redis automatic operation and maintenance controller is responsible for monitoring whether various states of all container examples in the Redis cluster are consistent with the expected states of the Redis cluster description file, judging whether the current CPU occupancy rate of the container examples reaches 80%, and expanding one container example if the current CPU occupancy rate reaches the 80%.
Therefore, in the embodiment of the application, based on the container technology, the logic codes of the automatic installation, deployment and operation and maintenance functions are packaged into the function code modules, and the automatic installation, deployment, automatic operation and maintenance and the like of the Redis clusters are realized through the function code modules and the Redis cluster description file, so that the complexity of manual installation, deployment and operation and maintenance is greatly simplified, the workload of personnel is reduced, the standardization of installation, deployment, operation and maintenance work is improved, and the subsequent upgrading, maintenance and operation is facilitated.
An embodiment of the present application provides a dis cluster automation installation deployment apparatus, referring to fig. 5, the apparatus includes:
a file acquisition unit, configured to acquire a preconfigured Redis cluster description file; each Redis cluster description file is configured for a corresponding Redis cluster; the Redis cluster description file comprises deployment and operation configuration parameters;
the deployment operation and maintenance unit is used for deploying and operating the Redis cluster corresponding to the Redis cluster description file on the container platform according to the deployment and operation and maintenance configuration parameters in the Redis cluster description file.
It will be appreciated that the Redis cluster automatically installs the deployment device, i.e., the functional code module above.
In one embodiment, the deployment operation and maintenance unit is specifically configured to: and deploying and operating the Redis cluster corresponding to the Redis cluster description file on the container platform by calling the container platform interface according to the deployment and operation configuration parameters in the Redis cluster description file.
In one embodiment, the apparatus may further include:
the first receiving subunit is used for receiving a modification submitting instruction of an operation and maintenance personnel to the deployment and operation and maintenance configuration parameters in the Redis cluster description file, and the modification submitting instruction comprises the modified deployment and operation and maintenance configuration parameters;
An automatic adjustment subunit, configured to compare the modified deployment and operation adjustment parameters with the actual configuration situation of the Redis cluster; and adjusting according to the comparison result.
In one embodiment, the auto-tuning subunit is specifically configured to: after receiving a modification submitting instruction of operation and maintenance personnel to the adjustable parameters in a Redis cluster description file, entering a parameter adjustment state; in the parameter adjustment state, comparing the adjusted adjustable parameter with the actual configuration condition of the Redis cluster; and (5) automatically adjusting according to the comparison result.
In one embodiment, at least one of the Redis cluster configuration information, the instance list, the user list, and the control authority information is defined in the Redis cluster description file.
In one embodiment, the Redis cluster configuration information includes a mode of the Redis cluster and node configuration information, and the mode is a stand-alone mode, a master-slave mode, a sentinel mode or a cluster mode.
In one embodiment, in a case where the mode of the Redis cluster is a sentinel mode, the deployment and operation configuration parameters include master node configuration information, slave node configuration information, master-slave relationship configuration information, and sentinel configuration information; the deployment operation and maintenance unit is specifically configured to:
Reading main node configuration information in a sentinel mode from a Redis cluster description file of the Redis cluster; generating a container template of the main working node according to the main node configuration information; generating a container instance of the master working node in a container template of the master working node by calling a create container interface in a container platform interface; creating a main node service on a container platform according to the service information of the main working node; associating the primary node service with a container instance of the primary working node;
reading slave node configuration information in a sentinel mode from a Redis cluster description file of the Redis cluster; generating a container template of the slave working node according to the slave node configuration information; generating a container instance of the slave working node in the container template of the slave working node by calling a create container interface in the container platform interface;
reading master-slave relation configuration information from a Redis cluster description file of the Redis cluster; detecting and determining a master-slave relationship in a container instance entering each working node by calling a query interface in a container platform interface;
the sentinel configuration information is obtained from a Redis cluster description file of the Redis cluster; generating a container template of the sentinel node according to the sentinel configuration information; generating a container instance of the sentinel node in a container template of the sentinel node by calling a create container interface in a container platform interface; creating a sentinel service on the container platform according to the service information of the sentinel nodes; associating the sentinel service with a container instance of the sentinel node.
In one embodiment, the apparatus may further include:
the automatic repairing unit is used for calling a query interface in a container platform interface at regular time under the condition that the Redis cluster corresponding to the Redis cluster description file is deployed, and acquiring container state information and service state information in the Redis cluster; judging whether the container state information and the service state information accord with the expected setting condition in a Redis cluster description file of the Redis cluster or not; if not, performing automatic repair action.
It may be understood that, for explanation, specific implementation, beneficial effects, examples, etc. of the content in the apparatus provided by the embodiments of the present application, reference may be made to corresponding parts in the foregoing methods provided by the embodiments of the present application, which are not repeated herein.
The embodiment of the application provides a Redis cluster automation installation deployment system, which comprises a Redis automatic operation and maintenance controller, wherein the Redis automatic operation and maintenance controller comprises a function code module and a Redis cluster description file, logic codes are packaged in the function code module, and the logic codes of the function code module are used for executing the following steps:
acquiring a preconfigured Redis cluster description file; each Redis cluster description file is configured for a corresponding Redis cluster; the Redis cluster description file comprises deployment and operation configuration parameters;
And deploying and operating the Redis cluster corresponding to the Redis cluster description file on a container platform according to the deployment and operation configuration parameters in the Redis cluster description file.
In one embodiment, the Redis automatic operation and maintenance controller further comprises a plurality of container platform interfaces; correspondingly, the logic code of the functional code module is specifically configured to: and according to the deployment and operation configuration parameters in the Redis cluster description file, automatically installing and deploying the Redis cluster corresponding to the Redis cluster description file on a container platform by calling a container platform interface.
It may be understood that, for explanation, specific implementation, beneficial effects, examples, etc. of the content in the system provided by the embodiments of the present application, reference may be made to corresponding parts in the foregoing method provided by the embodiments of the present application, and details are not repeated herein.
Embodiments of the present application provide a computing device including a memory having executable code stored therein and a processor, which when executing the executable code, implements a method in any of the embodiments of the execution specification.
Fig. 6 shows a schematic hardware structure of a computing device according to an embodiment of the present invention. A processor 601 and a memory 602 storing computer program instructions may be included in a computing device.
In particular, the processor 601 may include a central processing unit (Central Processing Unit, CPU), or an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured as one or more integrated circuits implementing embodiments of the present invention.
Memory 602 may include mass storage for data or instructions. By way of example, and not limitation, memory 602 may include a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, magnetic tape, or universal serial bus (Universal Serial Bus, USB) Drive, or a combination of two or more of the above. In one example, the memory 602 may include removable or non-removable (or fixed) media, or the memory 602 is a non-volatile solid state memory. Memory 602 may be internal or external to the integrated gateway disaster recovery device.
In one example, memory 602 may include Read Only Memory (ROM), random Access Memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical/tangible memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software comprising computer-executable instructions and when the software is executed (e.g., by one or more processors) it is operable to perform the operations described with reference to a method according to an aspect of the present application.
Processor 601 reads and executes computer program instructions stored in memory 602 to implement the Redis cluster automation installation deployment and operation and maintenance method in the embodiment shown in FIG. 1.
In one example, the computing device may also include a communication interface 603 and a bus 604. As shown in fig. 6, the processor 601, the memory 602, and the communication interface 603 are connected to each other through the bus 604 and perform communication with each other.
The communication interface 603 is mainly used for implementing communication between each module, apparatus, unit and/or device in the embodiment of the present invention.
Bus 604 includes hardware, software, or both, coupling components of the online data flow billing device to each other. By way of example, and not limitation, the buses may include an accelerated graphics port (Accelerated Graphics Port, AGP) or other graphics Bus, an enhanced industry standard architecture (Extended Industry Standard Architecture, EISA) Bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an industry standard architecture (Industry Standard Architecture, ISA) Bus, an infiniband interconnect, a Low Pin Count (LPC) Bus, a memory Bus, a micro channel architecture (MCa) Bus, a Peripheral Component Interconnect (PCI) Bus, a PCI-Express (PCI-X) Bus, a Serial Advanced Technology Attachment (SATA) Bus, a video electronics standards association local (VLB) Bus, or other suitable Bus, or a combination of two or more of the above. Bus 604 may include one or more buses, where appropriate. Although embodiments of the invention have been described and illustrated with respect to a particular bus, the invention contemplates any suitable bus or interconnect.
The computing device can execute each step in the Redis cluster automation installation deployment and operation and maintenance method in the embodiment of the application, so that the Redis cluster automation installation deployment and operation and maintenance method described in connection with FIG. 1 is realized.
In addition, in combination with the Redis cluster automation installation deployment and operation and maintenance method in the above embodiment, the embodiment of the invention can be implemented by providing a computer storage medium. The computer storage medium has stored thereon computer program instructions; the computer program instructions, when executed by a processor, implement any of the Redis cluster automated installation deployment and operation method of the above embodiments.
It should be understood that the invention is not limited to the particular arrangements and instrumentality described above and shown in the drawings. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present invention are not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after appreciating the spirit of the present invention.
The functional blocks shown in the above-described structural block diagrams may be implemented in hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine readable medium or transmitted over transmission media or communication links by a data signal carried in a carrier wave. A "machine-readable medium" may include any medium that can store or transfer information. Examples of machine-readable media include electronic circuitry, semiconductor Memory devices, read-Only Memory (ROM), flash Memory, erasable Read-Only Memory (Erasable Read Only Memory, EROM), floppy disks, compact discs (Compact Disc Read-Only Memory, CD-ROM), optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and the like. The code segments may be downloaded via computer networks such as the internet, intranets, etc.
It should also be noted that the exemplary embodiments mentioned in this disclosure describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, or may be performed in a different order from the order in the embodiments, or several steps may be performed simultaneously.
Aspects of the present disclosure are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to being, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware which performs the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In the foregoing, only the specific embodiments of the present invention are described, and it will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the systems, modules and units described above may refer to the corresponding processes in the foregoing method embodiments, which are not repeated herein. It should be understood that the scope of the present invention is not limited thereto, and any equivalent modifications or substitutions can be easily made by those skilled in the art within the technical scope of the present invention, and they should be included in the scope of the present invention.
Claims (13)
1. A method for deploying and operating a dis cluster, comprising:
acquiring a preconfigured Redis cluster description file; each Redis cluster description file is configured for a corresponding Redis cluster; the Redis cluster description file comprises deployment and operation configuration parameters;
and deploying and operating the Redis cluster corresponding to the Redis cluster description file on a container platform according to the deployment and operation configuration parameters in the Redis cluster description file.
2. The method according to claim 1, wherein the deploying and operating the dis cluster corresponding to the dis cluster description file on the container platform according to the deployment and operation configuration parameters in the dis cluster description file comprises:
And deploying and operating the Redis cluster corresponding to the Redis cluster description file on the container platform by calling the container platform interface according to the deployment and operation configuration parameters in the Redis cluster description file.
3. The method according to claim 1, wherein the method further comprises:
receiving a modification submission instruction of an operation and maintenance personnel for deployment and operation and maintenance configuration parameters in the Redis cluster description file, wherein the modification submission instruction comprises the modified deployment and operation and maintenance configuration parameters;
and according to the modified deployment and operation configuration parameters, adjusting the deployment and operation of the Redis cluster corresponding to the Redis cluster description file.
4. The method of claim 3, wherein the adjusting the deployment and the operation of the dis cluster corresponding to the dis cluster description file according to the modified deployment and operation configuration parameters comprises:
comparing the modified deployment and operation adjustment parameters with the actual configuration condition of the Redis cluster;
and adjusting according to the comparison result.
5. The method of claim 1, wherein the dis cluster description file further comprises at least one of dis cluster configuration information, instance list, user list, and control authority information.
6. The method of claim 5, wherein the Redis cluster configuration information includes a mode of the Redis cluster and node configuration information, and the mode is a stand-alone mode, a master-slave mode, a sentinel mode, or a cluster mode.
7. The method of claim 6, wherein in the event that the mode of the dis cluster is a sentinel mode, the deployment and operational configuration parameters include master node configuration information, slave node configuration information, master slave relationship configuration information, and sentinel configuration information; according to the deployment and operation configuration parameters in the Redis cluster description file, deploying and operating the Redis cluster corresponding to the Redis cluster description file on a container platform, wherein the method comprises the following steps:
reading main node configuration information in a sentinel mode from the Redis cluster description file; generating a container template of the main working node according to the main node configuration information; generating a container instance of the master working node in a container template of the master working node by calling a create container interface in a container platform interface; creating a main node service on a container platform according to the service information of the main working node; associating the primary node service with a container instance of the primary working node;
Reading slave node configuration information in a sentinel mode from the Redis cluster description file; generating a container template of the slave working node according to the slave node configuration information; generating a container instance of the slave working node in the container template of the slave working node by calling a create container interface in the container platform interface;
reading master-slave relation configuration information from the Redis cluster description file; detecting and determining a master-slave relationship in a container instance entering each working node by calling a query interface in a container platform interface;
the sentinel configuration information is obtained from the Redis cluster description file; generating a container template of the sentinel node according to the sentinel configuration information; generating a container instance of the sentinel node in a container template of the sentinel node by calling a create container interface in a container platform interface; creating a sentinel service on the container platform according to the service information of the sentinel nodes; associating the sentinel service with a container instance of the sentinel node.
8. The method as recited in claim 1, further comprising:
under the condition that the Redis cluster corresponding to the Redis cluster description file is deployed, a query interface in a container platform interface is called regularly, and container state information and service state information in the Redis cluster are obtained;
Judging whether the container state information and the service state information accord with expected setting conditions in a Redis cluster description file of the Redis cluster;
if not, performing automatic repair action.
9. A dis cluster automation installation deployment apparatus, comprising:
a file acquisition unit, configured to acquire a preconfigured Redis cluster description file; each Redis cluster description file is configured for a corresponding Redis cluster; the Redis cluster description file comprises deployment and operation configuration parameters;
the deployment operation and maintenance unit is used for deploying and operating the Redis cluster corresponding to the Redis cluster description file on the container platform according to the deployment and operation and maintenance configuration parameters in the Redis cluster description file.
10. The Redis cluster automation installation deployment system is characterized by comprising a Redis automatic operation and maintenance controller, wherein the Redis automatic operation and maintenance controller comprises a function code module and a Redis cluster description file, logic codes are packaged in the function code module, and the logic codes of the function code module are used for executing the following steps:
acquiring a preconfigured Redis cluster description file; each Redis cluster description file is configured for a corresponding Redis cluster; the Redis cluster description file comprises deployment and operation configuration parameters;
And deploying and operating the Redis cluster corresponding to the Redis cluster description file on a container platform according to the deployment and operation configuration parameters in the Redis cluster description file.
11. The system of claim 10, wherein the Redis automation controller further comprises a plurality of container platform interfaces therein;
correspondingly, the logic code of the functional code module is specifically configured to: and deploying and operating the Redis cluster corresponding to the Redis cluster description file on the container platform by calling the container platform interface according to the deployment and operation configuration parameters in the Redis cluster description file.
12. A computer readable storage medium, having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of any of claims 1 to 8.
13. A computing device comprising a memory and a processor, the memory having executable code stored therein, the processor, when executing the executable code, implementing the method of any one of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311676413.7A CN117742737A (en) | 2023-12-07 | 2023-12-07 | Redis cluster deployment and operation method, device, system and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311676413.7A CN117742737A (en) | 2023-12-07 | 2023-12-07 | Redis cluster deployment and operation method, device, system and equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117742737A true CN117742737A (en) | 2024-03-22 |
Family
ID=90280379
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311676413.7A Pending CN117742737A (en) | 2023-12-07 | 2023-12-07 | Redis cluster deployment and operation method, device, system and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117742737A (en) |
-
2023
- 2023-12-07 CN CN202311676413.7A patent/CN117742737A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110647580B (en) | Distributed container cluster mirror image management main node, slave node, system and method | |
CN110275992B (en) | Emergency processing method, device, server and computer readable storage medium | |
CN111258850B (en) | Method and device for updating software information based on Linux system | |
US11782800B2 (en) | Methods to automatically correct and improve system recovery and replication processes | |
CN112817827B (en) | Operation and maintenance method, device, server, equipment, system and medium | |
CN117742737A (en) | Redis cluster deployment and operation method, device, system and equipment | |
CN116860601A (en) | Collaborative debugging method, device, gateway, server and system | |
EP3824611A1 (en) | Secure remote access to a reefer control system | |
CN114677211A (en) | Credit parameter updating method, apparatus, electronic device, medium, and program product | |
CN111221556B (en) | Remote upgrade RSU mirror image method and system | |
CN114625664A (en) | Automatic testing method, device, equipment and storage medium | |
CN114490196A (en) | Database switching method, system, device and medium | |
CN115543527A (en) | Monitoring method, device, equipment and readable storage medium | |
CN113014675A (en) | Data processing method and device, electronic equipment and storage medium | |
CN112698913A (en) | Virtual machine snapshot generation method and device, electronic equipment and medium | |
CN118410111A (en) | Method, device, equipment, medium and program product for monitoring data update conflict | |
CN116991881A (en) | Data processing method, apparatus, device, medium and computer program product | |
CN118819959A (en) | Disaster recovery system management and control method, device, equipment, storage medium and program product | |
CN118132118B (en) | Firmware upgrading method and device | |
CN117493193A (en) | Code testing method, device, equipment and computer storage medium | |
CN118170380A (en) | Scene flow generation method, device, equipment, storage medium and program product | |
CN117633100A (en) | Data processing method, device, apparatus, medium, program product and vehicle | |
CN117193798A (en) | Application deployment method, apparatus, device, readable storage medium and program product | |
CN118316803A (en) | Vehicle configuration word processing method, device, equipment and medium | |
CN117909411A (en) | Data synchronization method and system based on Internet of things platform |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |