REDIS automatic deployment method for multiple machine rooms
Through the cooperation method of two types of nodes, the automated deployment and monitoring of Redis multi-machine rooms are realized, which solves the time delay problem of fault detection and processing in the Redis multi-machine room environment, and improves the availability and maintenance efficiency of the system.
Patent Information
- Application Number
- CN202410392775.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-02
- Publication Date
- 2024-08-23
AI Technical Summary
Existing technology is difficult to realize the automated deployment and maintenance of Redis in multiple computer rooms, which results in a long time to discover and solve problems when a Redis instance fails in a multi-machine room environment, affecting system availability and customer experience.
Two types of node collaboration methods are adopted. The main control node is responsible for graphical interface management and distribution of deployment information. The work node is responsible for completing the installation, deployment and fault detection of Redis in the target computer room. It collects status snapshot information through scheduled tasks and issues notifications to achieve Automated deployment and monitoring of Redis clusters.
It simplifies the installation process of Redis, shields the underlying details, realizes the automated deployment and monitoring of Redis clusters, detects and handles abnormal situations in a timely manner, and improves the availability and maintenance efficiency of the system.
Smart Images

Figure CN118535085A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automated operation and maintenance, and in particular to a REDIS automated deployment method for multiple computer rooms. Background Art
[0002] Redis is an open source, high-performance in-memory data storage system that is widely used in databases, caches, and messaging middleware. The system is designed with a focus on fast read and write access and supports a variety of data structures such as strings, hashes, lists, sets, and ordered sets. With the continuous growth of Internet applications, the demand for high-performance, scalable, and reliable data storage systems is increasing, and Redis has become one of the key technologies to meet these needs.
[0003] Redis can be deployed in a variety of ways, each with different effects. The first is a simple stand-alone deployment, which is suitable for small projects or development environments. Then there is master-slave replication, in which the master node is responsible for writing data and the slave node is responsible for reading data, which can improve read performance and data redundancy. Next is the sentinel mode, which introduces monitoring nodes and can automatically fail over when the master node fails to ensure system availability. Finally, there is the cluster mode, which can distribute data on multiple nodes, improving the system's concurrent processing capabilities and data storage capacity. Redis has different deployment methods and its related configurations will be different, so the manual installation and deployment of Redis involves a series of complex configurations and parameter settings. For operators who are not familiar with Redis, the learning curve is steep. Configuration file adjustments, network settings, and security settings all require in-depth understanding, and incorrect configurations may lead to usage problems. Every time you install REDIS, you often need to check the relevant documents and then follow the documentation to install it. Especially now that the documents are also facing outdated, manual installation and deployment of REDIS has always been accompanied by a series of related problems.
[0004] At present, in many companies, different teams are developing or maintaining projects, and when REDIS is used in the project, it needs to be deployed by operation and maintenance. With the increase of internal applications in the company, there will be more and more REDIS instances, especially in the environment of multiple internal computer rooms. With the increasing number of REDIS instances, when there is a problem with the REDIS instance, we often find it difficult to find the problem in the first time. When the application using the REDIS cluster fails, we often find the problem after it has caused some losses, leaving a bad impression on customers. For the above scenarios, there is a real need for a method for the REDIS cluster to automatically check the status of the relevant REDIS cluster after installation, and in the abnormal state, we hope to notify the relevant personnel of the abnormal information.
[0005] In view of the above problems, a method is needed to simplify or even fully automate the deployment of REDIS, to simplify or even shield the underlying details of REDIS installation, and to allow users to complete the deployment of REDIS by clicking through a graphical interface. After the REDIS deployment is completed, it is also necessary to monitor the REDIS cluster and collect its related indicators at the same time, and notify relevant personnel in time when anomalies are found, so as to find and solve problems in time to further improve the availability of REDIS.
[0006] 202010912032.4 Multi-computer room data synchronization method, computing device and storage medium, the method includes: receiving a data write request sent by a client, encapsulating the data write request, sending the encapsulated data write request to the master node in the Redis group corresponding to the computer room, so that the master node can execute the encapsulated data write request, and record the data operation in the log file of the master node; reading the data operation in the log file of the master node in each Redis group in the computer room, and using the synchronization link to send the read data operation to be synchronized to the opposite computer room, so that the opposite computer room can deduplicate the data operation to be synchronized according to the first file offset corresponding to the synchronized data operation recorded in real time. This solution realizes breakpoint resumption, effectively reduces resource consumption, and effectively ensures idempotence during data synchronization, ensuring data consistency in multiple computer rooms.
[0007] CN201510713989.5 discloses a multi-computer room deployment system and a cross-computer room business data processing method. The system includes: a main computer room and a backup computer room, the main computer room includes at least one business server and a main cache database and a main database for storing business data, and the backup computer room includes at least one business server and a backup cache database and a backup database for storing business data; business data is bidirectionally synchronized between the main cache database and the backup cache database, and business data is bidirectionally synchronized between the main database and the backup database; at least one business server in the backup computer room is used to: read business data from the main database when receiving a business data read request; and write business data to the main database when receiving a business data write request. In this system, when bidirectionally synchronizing business data between the main database and the backup database, the business data of the main database is used as the main data, so that the data of the backup database and the main database can maintain strong consistency.
[0008] CN 202011335476.2 discloses a multi-computer room data synchronization and deployment method based on the end side, including the following steps; Step 1, the smart terminal uploads the original data to the storage server, which can be audio and video data or other data; Step 2, the storage server stores the data after receiving it, and synchronizes the time record and node-related information to the data server; Step 3, the end side accesses the data server to obtain the computer room node information, including which computer rooms the data is stored in, the specific time period distribution, and the node domain name information; Step 4, the data service center on the end side calculates the domain name information of all required computer rooms according to the time period of the data distribution to be obtained, or the specified computer room and other information. The present invention satisfies the requirements of incremental acquisition of multi-computer room data, on-demand acquisition, and no impact on the new computer room business, saves the server the cost of data stream processing, data integration services, data distribution, etc., and reduces the scenario of concurrent data requests on the server side. No right - rejected
[0009] CN201510240847.1 discloses a method for testing the cache synchronization function of multiple computer rooms, which is used to test the cache synchronization function of the system under test using fewer processing resources. The method includes: intercepting a cache device synchronization instruction sent by the system under test to a message agent; sending the intercepted instruction to at least two cache devices to instruct the at least two cache devices to update data; and determining the test result of the cache synchronization function of the system under test based on the data update results of the at least two cache devices. The present application also discloses a test device for the cache synchronization function of multiple computer rooms. Summary of the invention
[0010] The technical problem to be solved by the present invention is to overcome the deficiencies of the prior art and provide a method for automatic deployment of REDIS in multiple computer rooms. The present application mainly relates to the automatic deployment of REDIS and secondly to the automatic maintenance of REDIS.
[0011] In order to solve the above technical problems, the present invention provides a REDIS automatic deployment method for multiple computer rooms. The REDIS automatic operation and maintenance of multiple computer rooms is completed through two types of nodes. The first type of node is the main control node, which is deployed in the central computer room. This type of node is responsible for allowing users to view and manage all REDIS information and other system basic information through a graphical interface. This type of node is also responsible for sending REDIS deployment information, REDIS alarm information and other basic resource information to the working node; the second type of node is the working node, which mainly includes the following functions: 1. Directly connect to the REDIS instance that has been deployed in the current computer room, and collect the status snapshot information of the REDIS instance in the form of a scheduled task; 2. Automatically detect whether the REDIS cluster that the working node is responsible for is in a fault or dangerous state according to the latest status snapshot information of REDIS, and issue a notification in time for the abnormal situation of the REDIS cluster; 3. Responsible for executing the REDIS cluster deployment task issued by the main control node, and send instructions to the target machine through the external machine central control service to complete the installation and deployment of REDIS on the machine. Since the node needs to be directly connected to the redis service, the node can be installed in the computer room where REDIS needs to be managed. At the same time, the data interaction between the master node and the working node is divided into two categories. One is instant network request. This type of operation usually has high real-time requirements. For example, users hope to directly see the REDIS cluster status of each computer room, view the current REDIS effective configuration, and restart the REDIS instance... For such operations, the master node uses a dedicated network line to directly send requests to the working node across computer rooms. The working node returns the operation results after completing the actual related operations; the other is cross-computer room data synchronization. For some basic information, such as machine resource information, basic user information..., due to the large amount of data and low real-time requirements, in order to avoid wasting network dedicated line bandwidth, the cross-computer room data synchronization solution is used to synchronize the basic information of the master node to the working node; at the same time, some core execution logs of the working node are sent back to the master node for operation archiving and problem troubleshooting. There is no need for each working node to perceive each other, nor will they call each other. The deployment and operation and maintenance problems of REDIS in multiple computer rooms are solved through the mutual cooperation of two types of nodes. The REDIS deployment steps are as follows:
[0012] Step 1: The user selects / enters the basic information of REDIS deployment on the graphical interface of the master node. The basic information includes but is not limited to: the target computer room for REDIS deployment, the version of REDIS, the deployment mode of REDIS, the number of nodes deployed by REDIS, and the memory limit of the REDIS instance.
[0013] Step 2: Based on the REDIS deployment basic information submitted in step 1, an algorithm is used in the target computer room to select suitable and available deployment machine targets based on the machine resource information of the target computer room. After selection, the targets are displayed to the user and the user is provided with the ability to manually change the deployment machine.
[0014] Step 3: The instance types of REDIS are divided into four categories: master node, slave node, sentinel node and cluster node. After studying the configuration of the above four types of nodes, the configuration items of each type of node are further divided into three categories. The first category is the preset configuration. This type of configuration is basic and important. It is a configuration that must be set for each node and cannot be changed by the user. The configuration includes but is not limited to: instance listening port, instance binding IP...; the second category is important configuration. This type of configuration has a greater impact on the function of REDIS, but it can still be changed by the user. At the same time, default values are provided for this type of configuration. The configuration includes but is not limited to: data saving frequency...; the third category is other configurations. This type of configuration is less commonly used but does exist in the configuration of REDIS. The system provides default values for this type of configuration. According to the deployment mode and number of deployed nodes provided in step 1, the user interface can optionally display the configuration of the master node, slave node, sentinel node and cluster node. Users can selectively view and change the configuration, and users can complete the deployment and startup of the REDIS cluster normally without making changes.
[0015] Step 4: Based on the information collected in the above steps, obtain the available port range of the machine to be deployed from the target computer room, and then optionally calculate a port that can be used in common for the master node and slave node according to the REDIS instance deployment type; calculate a port that can be used in common for the sentinel node; and calculate a port that can be used in common for the cluster node. If there are multiple instances of the same type on a machine, downgrade is performed, and the nearby ports are preferred.
[0016] Step 5: Summarize all the information in Step 4, Step 3, Step 2, and Step 1, formulate a REDIS release plan and generate relevant release information for each REDIS instance, and the master node pushes the release plan down to the working node in the designated computer room. REDIS instance release information includes but is not limited to: target machine, instance type, REDIS configuration information...
[0017] Step 6: Users can see the complete release plan on the interface, can directly view and modify the generated REDIS instance configuration file, can also selectively automatically execute the release plan or manually click to start the deployment plan for each instance.
[0018] Step 7: When the REDIS cluster is deployed, the working node will automatically save the cluster information to the storage service. The subsequent working nodes will periodically collect the status snapshot information of the REDIS instance based on the REDIS cluster information. The REDIS status snapshot information includes but is not limited to: instance connection status, instance memory usage, instance memory fragmentation rate, instance client connection number...
[0019] Step 8: Automatic fault detection of working nodes is completed by alarm rules. Users can create / select alarm rules on the graphical interface of the master node and bind them to the REDIS cluster. After the binding request is submitted, the master node will send the alarm rules directly to the working node where the REDIS cluster is located.
[0020] Step 9: The working node will periodically use the latest collected REDIS instance status snapshot information to measure the alarm rules and notify the abnormal status of the cluster.
[0021] In step 1, the optional deployment modes of REDIS are single instance mode, master-slave mode, and cluster mode. Different deployment modes lead to differences in the number of nodes to be input. In single instance mode, there is only one REDIS master node and the node has only one instance; in master-slave mode, there is only one REDIS master node instance. There are two optional node types in master-slave mode. One optional node is a slave node type, and the user can choose to fill in the number of slave nodes. The other optional node is a sentinel node type, and the user can choose to fill in the number of sentinel nodes. In cluster mode, the user is required to fill in the number of master nodes and spare nodes. The spare nodes must be integer multiples of the master nodes and the minimum multiple is 1. At the same time, the number of master nodes should be greater than or equal to 3.
[0022] In step 2, the machine resource information of the target computer room comes from other external platforms, which can dynamically provide the latest data of the machine, including but not limited to: total memory, current memory usage, number of CPUs, machine system version, machine installed libraries, etc.
[0023] In step 2, in order to meet the installation and deployment of REDIS, it is necessary to filter the existing machine resources in advance and select the machine resources suitable for installation and deployment. For the installation of REDIS, the installation of REDIS depends on the operating system version and a part of basic libraries. If the operating system version of a machine does not meet the requirements, or a part of the basic libraries are not installed, the installation of REDIS cannot be successfully completed, or problems will occur during the use process; for the deployment of REDIS, the most core is whether the machine where REDIS is deployed has enough memory for use, and the upper limit of the memory used by the REDIS instance can be specified by the REDIS configuration item maxmemory. The user needs to estimate the size of the data stored on REDIS and fill it in the REDIS instance memory limit item on the graphical interface. The algorithm for machine selection first filters the machine information according to the system version and installed libraries of the machine, and then according to the current remaining memory quantity of the machine and the REDIS instance memory limit in step 1, the algorithm will rank the machines according to the following levels, with the priority gradually decreasing from level 1 to level 4. According to this level, the most suitable machine will be selected for deploying REDIS. (This algorithm is not used for selecting sentinel-type instances. At the same time, for machines of level 3 and level 4, the current machine memory and the words indicating insufficient memory will be marked on the interface.)
[0024] Level 1: REDIS instance memory limit + 500MB <= Machine current remaining memory quantity <= REDIS instance memory limit + 1500MB
[0025] Level 2: REDIS instance memory limit + 1500MB <= Machine current remaining memory quantity
[0026] Level 3: REDIS instance memory limit <= Machine current remaining memory quantity < REDIS instance memory limit + 500MB
[0027] Level 4: Other machines remaining after screening by levels 1, 2, and 3.
[0028] In step 6, the steps for deploying the REDIS instance are as follows:
[0029] Step 6-1: Check whether the target machine for deployment has installed the specified version of REDIS at the specified location. If not, go to step 6-2; otherwise, directly go to step 6-3;
[0030] Step 6-2: Install REDIS to the specified directory.
[0031] Step 6-3: Download the REDIS configuration file to the specified location.
[0032] Step 6-4: Start REDIS using the specified configuration file.
[0033] Step 6-5: Check whether the REDIS instance can be connected normally.
[0034] In step 8, the alarm rules used for automatic fault detection are divided into two categories. One category is cluster alarm rules. Cluster alarm rules check the overall health status of the cluster and whether the REDIS instance in the cluster can be connected normally. Such rules apply to all clusters by default, and users do not need to explicitly operate the rules and bind the cluster in the graphical interface; the second category is REDIS instance alarm rules. Such rules are used to detect whether the status of the REDIS instance is normal, such as: whether the memory usage of the REDIS instance is too high (more than 90%), whether the memory fragmentation rate of REDIS is high... When adding alarm rules, users can set the detection indicators and expected values / expected ranges of indicators. The working node will use the latest collected REDIS instance status snapshot information to measure the instance alarm rules.
[0035] Beneficial effect: The prior art only reads the data operations in the log file of the master node in each Redis group in the computer room, and uses the synchronization link to send the read data operations to be synchronized to the opposite computer room, so that the opposite computer room can deduplicate the data operations to be synchronized according to the first file offset corresponding to the synchronized data operations recorded in real time. The automation of Redis services is mainly used to achieve automatic startup; while the present invention can support the automated deployment of REDIS. In addition, the present invention collaborates through two types of nodes to complete the automated operation and maintenance of REDIS in multiple computer rooms, so that users do not need to pay attention to the downloading, installation, configuration, and startup of REDIS. Only the core parameters need to be entered in the graphical interface to automatically complete the construction of the REDIS cluster by this method. For ordinary people, a large number of underlying details of REDIS installation are shielded, which is convenient for quick use.
[0036] The present invention can also support monitoring and alarming of REDIS clusters. After the REDIS cluster is created, the relevant information of the REDIS cluster is automatically saved, and survival detection and alarm rule calculation will be performed on the REDIS cluster at regular intervals later. A major pain point of subsequent maintenance of REDIS is solved. Generally, problems with the REDIS cluster are discovered only when problems occur in the actual use of REDIS in applications. Monitoring and alarming of the REDIS cluster can allow relevant personnel to discover and solve problems earlier, reducing the scope of impact of the problem.
[0037] Features of the present invention: 1. Supports automated deployment of REDIS. The present invention uses two types of nodes to collaborate to complete the automated operation and maintenance of REDIS in multiple computer rooms, so that users do not need to pay attention to the download, installation, configuration, and startup of REDIS. Only the core parameters need to be entered in the graphical interface, and the method automatically completes the construction of the REDIS cluster. For ordinary people, a large number of underlying details of REDIS installation are shielded, which is convenient for quick use.
[0038] 2. Support monitoring and alarming of REDIS cluster. After the REDIS cluster is created, the relevant information of the REDIS cluster will be automatically saved, and the survival detection and alarm rule calculation of the REDIS cluster will be performed regularly in the future. Solve a major pain point in the subsequent maintenance of REDIS. Generally, problems with the REDIS cluster are not discovered until problems occur in the actual use of REDIS in the application. Monitoring and alarming of the REDIS cluster can allow relevant personnel to discover problems earlier, solve problems earlier, and reduce the scope of the problem. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 Configuration diagram for example implementation DETAILED DESCRIPTION
[0040] The present invention provides a REDIS automated deployment method for multiple computer rooms. The REDIS automated operation and maintenance of multiple computer rooms is completed through collaboration of two types of nodes. The first type of node is a master control node, which is deployed in a central computer room. This type of node is responsible for allowing users to view and manage all REDIS information and other system basic information through a graphical interface. This type of node is also responsible for sending REDIS deployment information, REDIS alarm information and other basic resource information to a working node; the second type of node is a working node, which mainly includes the following functions: 1. Directly connect to the REDIS instance that has been deployed in the current computer room, and collect the state snapshot information of the REDIS instance in the form of a scheduled task; 2. Automatically detect whether the REDIS cluster that the working node is responsible for is in a fault or dangerous state according to the latest state snapshot information of REDIS, and issue a notification in time for the abnormal situation of the REDIS cluster; 3. Responsible for executing the REDIS cluster deployment task issued by the master control node, and send instructions to the target machine through the external machine central control service to complete the installation and deployment of REDIS on the machine. Since the node needs to be directly connected to the redis service, the node can be installed in the computer room where REDIS needs to be managed. At the same time, the data interaction between the master node and the working node is divided into two categories. One is instant network request. This type of operation usually has high real-time requirements. For example, users hope to directly see the REDIS cluster status of each computer room, view the current REDIS effective configuration, and restart the REDIS instance... For such operations, the master node uses a dedicated network line to directly send a request to the working node across the computer room, and the working node returns the operation result after completing the actual related operations; the other is cross-computer room data synchronization. For some basic information, such as machine resource information, basic user information..., due to the large amount of data and low real-time requirements, in order to avoid wasting network dedicated line bandwidth, the cross-computer room data synchronization solution is used to synchronize the basic information of the master node to the working node; at the same time, some core execution logs of the working node are sent back to the master node for operation archiving and problem troubleshooting. There is no need for each working node to perceive each other, nor will they call each other. The mutual cooperation of the two types of nodes solves the problem of multi-computer room REDIS automated deployment and operation and maintenance.
[0041] In normal use, Redis can be deployed in a variety of ways, each with different effects. The first is a simple stand-alone deployment, suitable for small projects or development environments. Then there is master-slave replication, in which the master node is responsible for writing data and the slave node is responsible for reading data, which can improve read performance and data redundancy. Next is sentinel mode, which introduces monitoring nodes and can automatically fail over when the master node fails to ensure system availability. Finally, there is cluster mode, which can distribute data across multiple nodes, improving the system's concurrent processing capabilities and data storage capacity. Which method to choose depends on the user's application requirements and the requirements for performance, availability, and scalability. In this method, the optional deployment modes of REDIS are divided into single instance mode, sentinel mode, and cluster mode. According to the different deployment modes, the difference in the number of nodes input is derived; in the single instance mode, there is only a REDIS master node and the node has only one instance; in the sentinel mode, there is only one REDIS master node instance. There are two optional node types in the sentinel mode, one of which is: slave node type (node functions include: 1. Automatically receive data synchronized from the master node, and provide data read-only service to external applications, sharing the access pressure of the master node; 2. When the master node is abnormal, it can be manually or sentinel node to send slave nodes to the slave node. Click to switch directly to the master node, so that the external services of the REDIS cluster can quickly return to normal), the user can choose to fill in the number of slave nodes, the second optional node is: sentinel node type (node functions include: 1. Monitor the actual running status of the master node and slave node. 2. In the event of an abnormality in the master node, automatically select a suitable slave node to switch to the master node, and the original master node will be set as a slave node after recovery.), the user can choose to fill in the number of sentinel nodes; Cluster mode: The user is required to fill in the number of master nodes and the number of backup nodes. The backup nodes must be an integer multiple of the master nodes and the minimum multiple is 1. At the same time, the number of master nodes should be greater than or equal to 3.
[0042] The following is further described with reference to the accompanying drawings and implementation examples:
[0043] like Figure 1 As shown, the steps of REDIS automated deployment example are as follows:
[0044] Step 1: The user selects / enters the basic information of REDIS deployment on the graphical interface of the master node. The basic information includes but is not limited to: the target computer room for REDIS deployment, the version of REDIS, the deployment mode of REDIS, the number of nodes deployed by REDIS, and the memory limit of the REDIS instance.
[0045] Step 2: Based on the REDIS deployment basic information submitted in step 1, an algorithm is used in the target computer room to select suitable and available deployment machine targets based on the machine resource information of the target computer room. After selection, the targets are displayed to the user and the user is provided with the ability to manually change the deployment machine.
[0046] Step 3: In this method, the instance types of REDIS are divided into four categories: master node, slave node, sentinel node and cluster node. After studying the configuration of the above four types of nodes, the configuration items of each type of node are further divided into three categories. The first category is the preset configuration. This type of configuration is basic and important. It is a configuration that must be set for each node and cannot be changed by the user. The configuration includes but is not limited to: instance listening port, instance binding IP...; the second category is important configuration. This type of configuration has a greater impact on the function of REDIS, but it can still be changed by the user. At the same time, default values are provided for this type of configuration. The configuration includes but is not limited to: data saving frequency...; the third category is other configurations. This type of configuration is less commonly used but does exist in the configuration of REDIS. The system provides default values for this type of configuration. According to the deployment mode and the number of deployed nodes provided in step 1, the user interface can optionally display the configuration of the master node, slave node, sentinel node and cluster node. The user can selectively view and change the configuration, and the user can complete the deployment and startup of the REDIS cluster normally without making any changes.
[0047] Step 4: Based on the information collected in the above steps, obtain the available port range of the machine to be deployed from the target computer room, and then optionally calculate a port that can be used in common for the master node and slave node according to the REDIS instance deployment type; calculate a port that can be used in common for the sentinel node; and calculate a port that can be used in common for the cluster node. If there are multiple instances of the same type on a machine, downgrade is performed, and the nearby ports are preferred.
[0048] Step 5: Summarize all the information in Step 4, Step 3, Step 2, and Step 1, formulate a REDIS cluster release plan and generate relevant release information for each REDIS instance, and the master node pushes the release plan down to the working node in the designated computer room. REDIS instance release information includes but is not limited to: target machine, instance type, REDIS configuration information...
[0049] Step 6: Users can see the complete release plan on the interface, can directly view and modify the generated REDIS instance configuration file, can also selectively automatically execute the release plan or manually click to start the deployment plan for each instance.
[0050] Step 7: When the REDIS cluster is deployed, the working node will automatically save the cluster information to the storage service. The subsequent working nodes will periodically collect the status snapshot information of the REDIS instance based on the REDIS cluster information. The REDIS status snapshot information includes but is not limited to: instance connection status, instance memory usage, instance memory fragmentation rate, instance client connection number...
[0051] Step 8: Automatic fault detection of working nodes is completed by alarm rules. Users can create / select alarm rules on the graphical interface of the master node and bind them to the REDIS cluster. After the binding request is submitted, the master node will send the alarm rules directly to the working node where the REDIS cluster is located.
[0052] Step 9: The working node will periodically use the latest collected REDIS instance status snapshot information to measure the alarm rules and notify the abnormal status of the cluster.
[0053] In step 1, the optional deployment modes of REDIS are single instance mode, master-slave mode, and cluster mode. Different deployment modes lead to differences in the number of nodes to be input. In single instance mode, there is only one REDIS master node and the node has only one instance; in master-slave mode, there is only one REDIS master node instance. There are two optional node types in master-slave mode. One optional node is a slave node type, and the user can choose to fill in the number of slave nodes. The other optional node is a sentinel node type, and the user can choose to fill in the number of sentinel nodes. In cluster mode, the user is required to fill in the number of master nodes and spare nodes. The spare nodes must be integer multiples of the master nodes and the minimum multiple is 1. At the same time, the number of master nodes should be greater than or equal to 3.
[0054] In step 2, the machine resource information of the target computer room comes from other external platforms, which can dynamically provide the latest data of the machine, including but not limited to: total memory, current memory usage, number of CPUs, machine system version, machine installed libraries, etc.
[0055] In step 2, the upper limit of memory used by the REDIS instance can be specified by the REDIS configuration item maxmemory. This requires the user to estimate the size of the data stored on REDIS and fill in the REDIS instance memory limit item on the graphical interface. The machine selection algorithm first filters the machine information according to the system version and installed class libraries of the machine, and then according to the current remaining memory of the machine and the REDIS instance memory limit in step 1, the algorithm will classify the machines according to the following levels, with the priority gradually decreasing from level 1 to level 4. According to this level, the most suitable machine is selected for deploying REDIS;
[0056] The algorithm for machine selection first filters machine information based on the system version of the machine and the installed libraries, and then, according to the current remaining memory of the machine and the REDIS instance memory limit in step 1, the algorithm will classify the machines into the following levels, with the priority decreasing gradually from level 1 to level 4. The most suitable machine will be selected according to this level for deploying REDIS. (This algorithm is not used for selecting sentinel-type instances. At the same time, for machines at level 3 and level 4, the current machine memory and the words indicating insufficient memory will be marked on the interface.)
[0057] Level 1: REDIS instance memory limit + 500MB <= current remaining memory of the machine <= REDIS instance memory limit + 1500MB
[0058] Level 2: REDIS instance memory limit + 1500MB <= current remaining memory of the machine
[0059] Level 3: REDIS instance memory limit <= current remaining memory of the machine < REDIS instance memory limit + 500MB
[0060] Level 4: Other machines remaining after being screened by levels 1, 2, and 3.
[0061] In step 6 mentioned above, the steps for deploying the REDIS instance are as follows:
[0062] Step 6-1: Check whether the target machine for deployment has installed the specified version of REDIS at the specified location. If not, go to step 6-2; otherwise, directly go to step 6-3;
[0063] Step 6-2: Install REDIS to the specified directory.
[0064] Step 6-3: Download the REDIS configuration file to the specified location.
[0065] Step 6-4: Start REDIS using the specified configuration file.
[0066] Step 6-5: Detect whether the REDIS instance can be normally connected.
[0067] In step 8, the alarm rules used for automatic fault detection are divided into two categories. One category is cluster alarm rules. Cluster alarm rules check the overall health status of the cluster and whether the REDIS instance in the cluster can be connected normally. Such rules apply to all clusters by default, and users do not need to explicitly operate the rules and bind the cluster in the graphical interface; the second category is REDIS instance alarm rules. Such rules are used to detect whether the status of the REDIS instance is normal, such as: whether the memory usage of the REDIS instance is too high (more than 90%), whether the memory fragmentation rate of REDIS is high... When adding alarm rules, users can set the detection indicators and expected values / expected ranges of indicators. The working node will use the latest collected REDIS instance status snapshot information to measure the instance alarm rules.
[0068] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for automatically deploying REDIS in multiple computer rooms, It is characterized in that Two types of nodes are used to collaborate to complete the REDIS automated operation and maintenance of multiple computer rooms. The first type of node is the master node, which is deployed in the central computer room. This type of node is responsible for allowing users to view and manage all REDIS information and other basic system information through a graphical interface. This type of node is also responsible for sending REDIS deployment information, REDIS alarm (rule) information and other basic resource information to the working node; the second type of node is the working node, which has the following functions: 1) Directly connect to the REDIS instance that has been deployed in the current computer room, and collect the status snapshot information of the REDIS instance in the form of a scheduled task; 2) Automatically detect whether the REDIS cluster that the working node is responsible for is in a faulty or dangerous state based on the latest status snapshot information of REDIS, and promptly notify the abnormal situation of the REDIS cluster; 3) Responsible for executing the REDIS cluster deployment tasks issued by the master node, and send instructions to the target machine through the external machine central control service to complete the installation and deployment of REDIS on the machine; Since this node needs to be directly connected to re dis service, so the node can be installed in the computer room where REDIS needs to be managed; at the same time, the data interaction between the master node and the working node is divided into two categories. One is instant network request. This type of operation usually has high real-time requirements: users can directly see the REDIS cluster status of each computer room, view the current REDIS effective configuration, and execute REDIS instance restart... For this type of operation, the master node uses a network dedicated line to directly send a request to the working node across the computer room, and the working node returns the operation result after completing the actual related operations; the other type is cross-computer room data synchronization. For some basic information: machine resource information, basic user information..., due to the large amount of data and low real-time requirements, in order to avoid wasting network dedicated line bandwidth, the cross-computer room data synchronization solution is used to synchronize the basic information of the master node to the working node; at the same time, some core execution logs of the working node are sent back to the master node for operation archiving and problem troubleshooting; there is no need for each working node to perceive each other, nor will they call each other; the specific steps of REDIS deployment and fault detection are as follows: Step 1: The user selects / enters the basic information of REDIS deployment on the graphical interface of the master node. The basic information includes: the target computer room for REDIS deployment, the version of REDIS, the deployment mode of REDIS, the number of nodes deployed by REDIS, and the memory limit of the REDIS instance; Step 2: Based on the REDIS deployment basic information submitted in step 1, an algorithm is used in the target computer room to select suitable and available deployment machine targets based on the machine resource information of the target computer room. After selection, the targets are displayed to the user and the user is provided with the ability to manually change the deployment machine. Step 3: The instance types actually deployed by REDIS are divided into four categories: master node, slave node, sentinel node and cluster node; after studying the configuration of the above four types of nodes, the configuration items of each type of node are further divided into three categories. The first category is the preset configuration. This type of configuration is basic and important. It is a configuration that must be set for each node and cannot be changed by the user. The configuration includes but is not limited to: instance listening port, instance binding IP...; The second category is important configuration. This type of configuration has a greater impact on the function of REDIS, but it can still be changed by the user. At the same time, default values are provided for this type of configuration, including but not limited to: data saving frequency...; The third category is other configurations. This type of configuration is less commonly used but does exist in the configuration of REDIS. The system provides default values for this type of configuration; According to the deployment information provided in step 1, including the step mode and the number of deployed nodes, the user interface can optionally display the required master node configuration, slave node configuration, sentinel node configuration and cluster node configuration. Users can selectively view and change the configuration, and at the same time allow users to complete the deployment and startup of the REDIS cluster normally without making changes; Step 4: Based on the information collected in the above steps, obtain the available port range of the machine to be deployed from the target computer room, and then optionally calculate a common port for the master node and slave node based on the REDIS instance deployment type; calculate a common port for the sentinel node; calculate a common port for the cluster node; if there are multiple instances of the same instance type on a machine, perform downgrade and give priority to using ports that are close to each other; Step 5: Summarize all the information in step 4, step 3, step 2, and step 1, formulate a REDIS release plan and generate relevant release information for each REDIS instance, and the master node pushes the release plan down to the working node in the designated computer room; REDIS instance release information includes but is not limited to: target machine, instance type, REDIS configuration information... Step 6: Users can see the complete release plan on the interface, can directly view and modify the generated REDIS instance configuration file, can also selectively automatically execute the release plan or manually click to start the deployment plan for each instance; Step 7: When the REDIS cluster is deployed, the working node will automatically save the cluster information to the storage service. The subsequent working nodes will periodically collect the status snapshot information of the REDIS instance based on the REDIS cluster information. The REDIS status snapshot information includes but is not limited to: instance connection status, instance memory usage, instance memory fragmentation rate, instance client connection number...; Step 8: Automatic fault detection of working nodes is completed by alarm rules. Users can create / select alarm rules on the graphical interface of the master node and bind them to the REDIS cluster. After the binding request is submitted, the master node will directly send the alarm rules to the working node where the REDIS cluster is located. Step 9: The working node will periodically use the latest collected REDIS instance status snapshot information to measure the alarm rules and notify the abnormal status of the cluster.
2. According to claim 1, a method for automatically deploying REDIS in multiple computer rooms, It is characterized in that In the step 1, in normal use, Redis can be deployed in a variety of ways, each with different effects; first is a simple stand-alone deployment, suitable for small projects or development environments; then master-slave replication, in which the master node is responsible for writing data and the slave node is responsible for reading data, which can improve reading performance and data redundancy; then the sentinel mode, which introduces a monitoring node, can automatically fail over when the master node fails to ensure system availability; finally, the cluster mode, which distributes data on multiple nodes, improves the system's concurrent processing capabilities and data storage capacity; which method to choose depends on the user's application requirements and performance, availability and scalability requirements; the optional deployment mode of REDIS is divided into single instance mode, sentinel mode, and cluster mode, and the difference in the number of nodes input is derived according to the different deployment modes; the single instance mode only has a REDIS master node and the node has only one instance; the sentinel mode has and only has one REDIS master node instance, and there are two optional node types in the sentinel mode, One optional node is: Node type, node functions include: 1) automatically receiving data synchronized from the master node, and providing data read-only service to external applications, sharing the access pressure of the master node; 2) when the master node is abnormal, the slave node will be directly switched to the master node through manual or sentinel nodes, so that the external services of the REDIS cluster can quickly return to normal; The user can choose to fill in the number of slave nodes. The second optional node is: sentinel node type. The node functions include: 1) monitoring the actual operating status of the master node and slave nodes; 2) in the event of an abnormality in the master node, automatically selecting a suitable slave node to switch to the master node. The original master node will be set as a slave node after recovery; the user chooses to fill in the number of sentinel nodes; cluster mode: the user is required to fill in the number of master nodes and the number of backup nodes. The number of backup nodes must be an integer multiple of the master node and the minimum multiple is 1. At the same time, the number of master nodes should be greater than or equal to 3.
3. According to claim 1, a method for automatically deploying REDIS in multiple computer rooms, It is characterized in that In step 2, the machine resource information of the target computer room comes from other external platforms, which can dynamically provide the latest data of the machine, including but not limited to: total memory, current memory usage, number of CPUs, machine system version, and machine installed class libraries.
4. A method for automatically deploying REDIS in multiple computer rooms according to claim 1, It is characterized in that In the step 2, in order to meet the installation and deployment of REDIS, it is necessary to filter the existing machine resources in advance and select the machine resources suitable for installation and deployment; for the installation of REDIS, the installation of REDIS depends on the operating system version and some basic class libraries. If the operating system version of a machine does not meet the requirements, or some basic class libraries are not installed, the installation of REDIS cannot be successfully completed or problems will occur during use; for the deployment of REDIS, the most important thing is whether the machine where REDIS is deployed has enough memory for use, and the upper limit of the memory used by the REDIS instance can be specified by the REDIS configuration item maxmemory; this requires the user to estimate the size of the data stored in REDIS and fill it in the REDIS instance memory limit item on the graphical interface; the machine selection algorithm first filters the machine information according to the system version and installation class library of the machine, and then according to the current remaining memory amount of the machine and the REDIS instance memory limit in step 1, the algorithm will classify the machine according to the following levels, with the priority gradually decreasing from level 1 to level 4, and select the most suitable machine for deploying REDIS according to this level; This algorithm is not used for sentinel instances. For level 3 and level 4 machines, the current machine memory and the message "Insufficient memory" will be indicated on the interface. Level 1: REDIS instance memory limit + 500MB <= machine's current remaining memory amount <= REDIS instance memory limit + 1500MB Level 2: REDIS instance memory limit + 1500MB <= the amount of memory currently available on the machine Level 3: REDIS instance memory limit <= machine's current remaining memory amount < REDIS instance memory limit + 500MB Level 4: Other machines remaining after screening at levels 1, 2, and 3.
5. The method for automatically deploying REDIS in multiple computer rooms according to claim 1, It is characterized in that In step 6, the REDIS instance deployment steps are as follows: Step 6-1: Check whether the target machine for deployment has installed the specified version of REDIS in the specified location. If not, proceed to step 6-2, otherwise proceed directly to step 6-3; Step 6-2: Install REDIS to the specified directory; Step 6-3: Download the REDIS configuration file to the specified location; Step 6-4: Start REDIS using the specified configuration file; Step 6-5: Check whether the REDIS instance can be connected normally.
6. A method for automatically deploying REDIS in multiple computer rooms according to claim 1, It is characterized in that In step 8, the alarm rules used for automatic fault detection are divided into two categories. One category is cluster alarm rules. Cluster alarm rules check the overall health status of the cluster and whether the REDIS instance in the cluster can be connected normally. Such rules apply to all clusters by default, and users do not need to explicitly operate the rules and bind the cluster in the graphical interface; The second category is REDIS instance alarm rules. These rules are used to detect whether the status of the REDIS instance is normal, whether the memory usage of the REDIS instance is too high, whether it is too high if it exceeds 90%, whether the memory fragmentation rate of REDIS is high... When adding alarm rules, users set the detection indicators and the expected values / expected ranges of indicators; the working nodes will use the latest collected REDIS instance status snapshot information to measure the instance alarm rules.
Citation Information
Cited By
Hybrid database deployment method and apparatus
WO2026113506A1
