WO2021072967A1 - Method and device for managing configuration information - Google Patents

Method and device for managing configuration information Download PDF

Info

Publication number
WO2021072967A1
WO2021072967A1 PCT/CN2019/126437 CN2019126437W WO2021072967A1 WO 2021072967 A1 WO2021072967 A1 WO 2021072967A1 CN 2019126437 W CN2019126437 W CN 2019126437W WO 2021072967 A1 WO2021072967 A1 WO 2021072967A1
Authority
WO
WIPO (PCT)
Prior art keywords
cluster
configuration
configuration information
application
application host
Prior art date
Application number
PCT/CN2019/126437
Other languages
French (fr)
Chinese (zh)
Inventor
林万伟
Original Assignee
厦门网宿有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 厦门网宿有限公司 filed Critical 厦门网宿有限公司
Publication of WO2021072967A1 publication Critical patent/WO2021072967A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Definitions

  • This application relates to the field of configuration information management, and in particular to a method and device for configuration information management.
  • each application system includes a business system for realizing business functions and a configuration management system for managing configuration information.
  • the embodiments of the present application provide a configuration information management method and device, which solves the problem of low fault tolerance in modification of configuration information of an application host in the prior art.
  • an embodiment of the present application provides a configuration information management method, including: the application host monitors the main configuration cluster in real time to obtain configuration updates, and modifies local configuration information based on the configuration updates; the application host If it is determined that the main configuration cluster cannot be communicated normally, the monitoring of the main configuration cluster is stopped, and the main configuration cluster is re-determined from the available configuration clusters, and returns to the monitoring step.
  • the application host monitors the main configuration cluster in real time to obtain configuration updates, and modifies the local configuration information based on the configuration updates, so that the local configuration information can be modified in real time.
  • the monitoring of the main configuration cluster is stopped, and the main configuration cluster is re-determined from the available configuration clusters, and returns to the monitoring step, thereby improving the application host configuration information Modified fault tolerance.
  • the application host monitoring the main configuration cluster in real time to obtain configuration updates includes: the application host monitoring in real time update messages issued by the main configuration cluster, and obtaining configuration updates from the received update messages, wherein the update The message is issued when the master configuration cluster determines that the configuration information managed by itself is updated.
  • the method for obtaining the local configuration information of the application host includes: before the monitoring, establishing a connection with the main configuration cluster, and obtaining the full amount of configuration information required by the application host from the main configuration cluster, Save it locally.
  • the step of stopping the monitoring of the main configuration cluster includes setting the main configuration cluster as an unavailable configuration cluster, and monitoring it, and setting it as an available configuration if it is determined that normal communication is possible Cluster.
  • the method for the application host to determine whether it normally communicates with the main configuration cluster includes: monitoring and receiving heartbeat messages periodically sent by the main configuration cluster; if the receiving cycle is abnormal, or the heartbeat message cannot be received, determining Cannot communicate with the main configuration cluster normally.
  • the re-determining the main configuration cluster from the available configuration clusters of the application host includes: the application host re-determining the main configuration cluster from the available configuration clusters according to a set policy;
  • the determination strategy includes at least one or a combination of the following: the re-determined configuration cluster and the application host are located in the same local area network; the communication rate between the re-determined configuration cluster and the application host conforms to the design Set conditions.
  • each of the configuration clusters stores the configuration information of the application host in a key-value pair; the application host modifies the local configuration information, including: the application host performs a key-value pair on the local configuration information to modify.
  • the method further includes: the application host obtains an authority certificate corresponding to the main configuration cluster, and establishes a connection with the main configuration cluster based on the authority certificate.
  • an embodiment of the present application provides a configuration information management method, which is applied to a configuration management system.
  • the configuration management system includes a central cluster and at least one edge cluster.
  • the method includes: Update instructions for the configuration information of the system; the central cluster implements the update instructions to update the locally stored configuration information of the application system; the central cluster synchronizes the updated configuration information of the application system To the at least one edge cluster; the central cluster and the edge cluster send update messages for the configuration information of the application system, so that the application host deployed with the application system can monitor the central cluster or the
  • the edge cluster receives the update message, and modifies the local configuration information based on the configuration update in the update message.
  • the configuration management system also includes an application configuration interface that receives update operations for the configuration information of each application system, and generates update instructions correspondingly; the central cluster receives the configuration information for the application system
  • the update instruction includes: the central cluster receives an update instruction for the configuration information of the application system from the application configuration interface.
  • the central cluster or the edge cluster obtains corresponding configuration information locally based on the obtaining request, and sends it to the application host.
  • the central cluster and the edge cluster send configuration information to the application host, they also issue a read-only certificate to the application host; the certificate is used by the application host to obtain the required configuration information .
  • the central cluster and the edge cluster periodically send heartbeat messages, and the application host determines the communication status of the central cluster or the edge cluster connected to them by monitoring the heartbeat messages.
  • an embodiment of the present application provides an application host, including: a monitoring module, configured to monitor the main configuration cluster in real time to obtain configuration updates, and modify local configuration information based on the configuration updates; a determining module for If it is determined that the main configuration cluster cannot communicate normally, the monitoring of the main configuration cluster is stopped, and the main configuration cluster is re-determined from the available configuration clusters, and the monitoring module is instructed to perform the real-time monitoring.
  • a monitoring module configured to monitor the main configuration cluster in real time to obtain configuration updates, and modify local configuration information based on the configuration updates
  • a determining module for If it is determined that the main configuration cluster cannot communicate normally, the monitoring of the main configuration cluster is stopped, and the main configuration cluster is re-determined from the available configuration clusters, and the monitoring module is instructed to perform the real-time monitoring.
  • the monitoring module is specifically configured to: monitor the update messages issued by the master configuration cluster in real time, and obtain configuration updates from the received update messages; the update message determines the configuration managed by the master configuration cluster. Issued when the information is updated.
  • the monitoring module is further configured to: before the monitoring, establish a connection with the main configuration cluster, and obtain all configuration information required by the application host from the main configuration cluster, and save it locally.
  • the determining module is further configured to: in the step of stopping the monitoring of the main configuration cluster, set the main configuration cluster as an unavailable configuration cluster, and monitor it, and if it is determined that normal communication is possible, then Set it as an available configuration cluster.
  • the determining module is further configured to: determine whether it normally communicates with the main configuration cluster in the following manner: monitor and receive heartbeat messages periodically sent by the main configuration cluster; if the receiving cycle is abnormal, or the heartbeat cannot be received Message, it is determined that normal communication with the main configuration cluster is not possible.
  • the determining module is configured to: the application host re-determines the main configuration cluster from the available configuration clusters according to a set strategy; the set strategy includes at least one or a combination of the following: The re-determined configuration cluster and the application host are located in the same local area network; the communication rate between the re-determined configuration cluster and the application host meets a set condition.
  • each of the configuration clusters stores the configuration information of the application host in a key-value pair; the monitoring module is used to modify the local configuration information in a key-value pair.
  • the monitoring module is further configured to obtain an authority certificate corresponding to the main configuration cluster, and establish a connection with the main configuration cluster based on the authority certificate.
  • an embodiment of the present application provides a computer device, including a program or instruction.
  • the program or instruction When the program or instruction is executed, it is used to execute each of the above-mentioned first aspect and first aspect embodiments or the second and second aspects. Aspects of the methods of various embodiments.
  • an embodiment of the present application provides a configuration management system, the system includes: a central cluster, at least one edge cluster; the central cluster receives an update instruction for the configuration information of the application system; the central cluster passes The update instruction is executed to update the locally stored configuration information of the application system; the central cluster synchronizes the updated configuration information of the application system to the at least one edge cluster; the central cluster and The edge cluster sends an update message for the configuration information of the application system, so that the application host deployed with the application system can receive the update message by listening to the central cluster or the edge cluster, and based on the The configuration update in the update message is used to modify the local configuration information.
  • FIG. 1 is a schematic diagram of the architecture of a configuration management system provided by an embodiment of the application
  • FIG. 2 is a schematic flowchart of the steps of a configuration information management method provided by an embodiment of the application
  • FIG. 3 is a schematic flow chart of the steps of a configuration information management method provided by an embodiment of the application
  • Fig. 4 is a schematic structural diagram of a configuration information management device provided by an embodiment of the application.
  • FIG. 1 it is a schematic structural diagram of a configuration management system provided by an embodiment of this application.
  • the architecture shown in Figure 1 includes: application configuration interface, central cluster, edge cluster, and application host. This architecture can be used to uniformly manage the configuration information of each application system in a distributed application system. It should be noted that the architecture shown in Figure 1 is only an example, and the architecture shown in Figure 1 can also be modified in many ways. For example, the number of edge clusters is not limited, and the number of nodes in each cluster is not limited. , The number of application hosts is not limited. The configuration management system provided in this embodiment can be used to uniformly manage the configuration information corresponding to each application system in the distributed application system.
  • Application configuration interface (ie the web application service in the figure): The only entry for modifying configuration information, providing configuration information operation interface, used to receive the upstream application system (that is, the server of the distributed application system) to the new configuration information, Modify and delete operations, and generate configuration information update instructions accordingly. That is to say, each application system can only operate through the application configuration interface to update the configuration information, which ensures the unity of the configuration information modification entry.
  • the operation interface provided by the application configuration interface can be implemented based on a web browser and an HTML5 page.
  • Central cluster used to obtain the configuration information update instructions generated by the application configuration interface, and is the only cluster that can execute the update instructions, so as to modify the configuration information and ensure the uniqueness of the execution of the configuration information modification.
  • the configuration management system initializes all configuration information to the central cluster.
  • the central cluster ensures that the configuration information stored by each node in the central cluster is consistent, and then the central cluster synchronizes the full configuration information to the central cluster.
  • Each edge cluster in the architecture includes configuration information of all application systems connected to the configuration management system, and the central cluster can be updated based on the full configuration information. Since the central cluster can contain multiple nodes, each node can be distributed on different machines and equipment, and the configuration information stored on each node is the same. Even if some nodes in the central cluster fail, other nodes can be used to replace the configuration information. The storage, modification and synchronization of the system can improve fault tolerance and availability.
  • the configuration information can be updated by executing the update instruction, which can specifically include the following configuration items.
  • the configuration item is added to the current configuration information on each central node.
  • Edge cluster The architecture of the configuration management system can contain multiple edge clusters, and the edge cluster can obtain configuration information synchronously from the central cluster.
  • each edge cluster can synchronously obtain the initial full configuration information from the central cluster, and ensure that the configuration information stored by each internal node is consistent.
  • the configuration information in the central cluster can be further synchronized in real time, and the synchronization between the edge cluster and the central cluster can be performed by means of copy mirroring (make-mirror). Similar to a central cluster, there are multiple nodes in an edge cluster. After a node fails, other nodes can also be used to store, modify, and synchronize configuration information, thereby improving fault tolerance and availability.
  • Application host runs a client program with an application system and is a user of configuration information.
  • the application host can specify the configuration cluster during the initialization phase, and select one of the configuration clusters as the main configuration cluster, and obtain the required configuration information from the main configuration cluster; and start the monitoring thread after initialization to monitor the main configuration cluster. Monitor in real time whether the required configuration information has changed. If there is any change, you can obtain the changed configuration information from the main configuration cluster.
  • the selection of the main configuration cluster can specifically include the following methods: if the communication status between the application host and the central cluster is good (for example, if the application host and the central cluster are in the same local area network, or the geographical location is close, the communication status can be considered good), then Directly use the central cluster as the main configuration cluster; if the communication status between the application host and the central cluster is poor (for example, if the application host and the central cluster are not in the same local area network, or the geographical location is far away, the communication status is considered poor), you can use Among the edge clusters designated as the configuration cluster, select an edge cluster with good communication status as the main configuration cluster. This method can minimize the impact of the communication status on the application host. At the same time, the central cluster and at least one application host can be designated The edge cluster that communicates normally serves as a secondary configuration cluster and serves as a backup primary configuration cluster.
  • the application host can specify one or more configuration clusters to obtain the required configuration information. However, you can only interact from the main configuration cluster at the same time to obtain the latest configuration information. When the main configuration cluster fails, the application host can reselect a cluster from the auxiliary configuration cluster as the main configuration cluster.
  • the application host can implement access to the configuration management system through an embedded software development kit (SDK) file.
  • SDK embedded software development kit
  • Programs are written through the SDK to provide interactive application program interfaces for the application host and the main configuration cluster.
  • the selection and monitoring of the main configuration cluster by the application host can also be realized through the SDK, as well as the automatic switching of the main configuration cluster and the reconnection mechanism.
  • the application host can support automatic switch configuration cluster and reconnection mechanism.
  • the SDK tool in this application can obtain the configuration information required by the application host from the main configuration cluster after the client of the application host is integrated, and load the required configuration information into the local memory.
  • the application host can directly use the configuration information in the local memory.
  • the use efficiency is significantly improved, and even if all configuration clusters cannot provide services, the client still has configuration information available, which is fully decoupled. This is very important for systems with high availability requirements.
  • the SDK can automatically detect the health status of the communication configuration cluster and switch automatically, which can effectively reduce the fault handling response time and manual maintenance costs.
  • the unified management of the configuration information of each application system is realized through the configuration information management system, so that the business system and configuration management in the application system are fully decoupled, and the coupling between configuration information management and business applications is effectively reduced. And through the central cluster and edge clusters to update and store the configuration information, the client of the application system can obtain the configuration information at any time.
  • the configuration information when the configuration information is stored in the central configuration cluster and edge cluster, it can be encrypted, and when the application host requests access, a certificate with read-only permission is issued to the application host, and the configuration information can only be written in the uppermost layer.
  • the unified entry is performed on the application configuration interface, so as to prevent any certificate from being leaked, resulting in highly sensitive configuration information leakage and random changes. Since the distributed certificate is a certificate with read-only permission, even if the certificate is leaked, only the encrypted data can be obtained, and the configuration data cannot be changed, which improves the security of the entire tool and meets the scenarios with high configuration information sensitivity.
  • the central cluster and each edge cluster can adopt a distributed key-value pair data storage system (etcd) cluster.
  • the etcd cluster is a highly available system to improve the availability of the entire tool and reduce the impact of configuration management system downtime on specific business systems.
  • the configuration management method is applied to the application host in the configuration management system provided in the foregoing embodiment.
  • Step 201 The application host monitors the main configuration cluster in real time to obtain configuration updates, and modifies local configuration information based on the configuration updates.
  • the application host accesses the configuration management system, it can specify the configuration cluster and select the main configuration cluster, obtain the required configuration information from the main configuration cluster, and obtain configuration updates by monitoring the main configuration cluster To ensure that the latest configuration information is stored locally.
  • the application host can directly obtain the latest configuration information from the main configuration cluster and replace the locally saved configuration information when it monitors that there is an update to the configuration information it needs on the main configuration cluster.
  • configuration updates can also be obtained from the main configuration cluster, and the local configuration information can be modified based on the configuration updates to obtain the latest configuration information.
  • the step of the application host monitoring the main configuration cluster in real time to obtain configuration updates may include: the application host monitoring the update messages issued by the main configuration cluster in real time, and obtaining configuration updates from the received update messages, wherein the The update message is issued when the main configuration cluster determines that the configuration information managed by itself is updated.
  • the update message is issued when the main configuration cluster determines that the configuration information managed by itself is updated.
  • the local configuration information is updated based on the configuration update, if not, it can be discarded directly.
  • Step 202 If the application host determines that it cannot communicate with the main configuration cluster normally, it stops monitoring the main configuration cluster, and at the same time re-determines the main configuration cluster from the available configuration clusters, and returns to the monitoring step.
  • the method for the application host to determine whether it normally communicates with the main configuration cluster may include: monitoring and receiving heartbeat messages periodically sent by the main configuration cluster. If the receiving cycle is abnormal or the heartbeat message cannot be received, it is determined that the main configuration cluster cannot be communicated with. Normal communication.
  • the application host can stop monitoring the main configuration cluster, and at the same time, set the main configuration cluster as an unavailable configuration cluster.
  • the communication status of the configuration cluster may be abnormal.
  • the configuration cluster can be set as unavailable.
  • the application host can monitor the unavailable configuration cluster to obtain the status of unavailability. With the communication status of the configuration cluster, if it is determined that the communication can be normal, the unavailable configuration cluster can be set as available again.
  • the application host determines that it cannot communicate with the main configuration cluster normally, it can re-designate the main configuration cluster from the available configuration clusters as the current main configuration cluster.
  • the SDK embedded in the application host is configured with three configuration clusters: central cluster, edge cluster 1 and edge cluster 2.
  • edge cluster 1 is designated as the main configuration cluster, central cluster and edge cluster based on preset rules.
  • Cluster 2 is a secondary configuration cluster and performs data interaction with edge cluster 1.
  • edge cluster 2 can be re-designated as the main configuration cluster, which can be performed in accordance with the cycle and the main configuration cluster.
  • Heartbeat test if the heartbeat message from the main configuration cluster is not received within a set period of time, it can be determined that normal communication with the main configuration cluster cannot be performed, and the main configuration cluster can be re-determined from the central cluster and edge cluster 2. And monitor it.
  • the specific implementation manner of re-determining the main configuration cluster from the available configuration clusters of the application host may include: the application host re-determines the main configuration cluster from the available configuration clusters according to a set policy;
  • the predetermined strategy includes at least one or a combination of the following: the re-determined main configuration cluster and the application host are located in the same local area network; the re-determined main configuration cluster and the application host communication rate Meet the set conditions.
  • a secondary configuration cluster whose communication rate with the application host is greater than a preset rate threshold is used as the re-determined primary configuration cluster.
  • the network status of each cluster can be detected separately, including the judgment of whether they are located in the same local area network, and the determination of the communication rate, and sort based on the detection results, and filter out the matching
  • the cluster with preset rules is used as the designated configuration cluster, and the best configuration is designated as the primary configuration cluster, and the others are secondary configuration clusters.
  • the order of each secondary configuration cluster is saved. In this way, the new configuration cluster is specified in the secondary configuration cluster.
  • the main configuration cluster is selected, the auxiliary configuration cluster with the best conditions can be quickly selected based on the saved sequence.
  • each cluster of the configuration management system stores the configuration information of each application system in the form of key-value pairs; updating the configuration information stored in the application host may include: the application host updates the application in the form of key-value pairs Configuration information stored in the host. Storing the configuration information in the key-value pair method facilitates the application host to quickly obtain the configuration information, and at the same time, it is convenient to update the configuration information stored in the application host, which improves the efficiency of updating and obtaining the configuration information.
  • the application host when the application host accesses the configuration management system for the first time, it can obtain an authority certificate corresponding to the required configuration information, and establish a connection with the main configuration cluster based on the authority certificate.
  • the system issues a certificate with read-only permission to the application host.
  • the application host cannot modify the configuration information without authorization, and the application host can monitor the configuration information of the application host in the main configuration cluster according to the certificate, thereby improving the configuration information Security of access.
  • the application host monitors the main configuration cluster in real time to obtain configuration updates, and modifies the local configuration information based on the configuration updates, so that the local configuration information can be modified in real time.
  • the monitoring of the main configuration cluster is stopped, and the main configuration cluster is re-determined from the available configuration clusters, and returns to the monitoring step, thereby improving the application host configuration information Modified fault tolerance.
  • Steps 201 to 202 are applications of the configuration information management method on the application host side, and correspondingly, there are applications on the cluster side.
  • the embodiment of the present application provides a configuration information management method, which is applied to the above-mentioned configuration management system, and the method includes the following steps.
  • Step 301 The central cluster receives an update instruction for the configuration information of the application system.
  • Step 302 The central cluster implements the update of the locally stored configuration information of the application system by executing the update instruction.
  • Step 303 The central cluster synchronizes the updated configuration information of the application system to the at least one edge cluster.
  • Step 304 The central cluster and the edge cluster send update messages for the configuration information of the application system, so that the application host deployed with the application system can receive the information by monitoring the central cluster or the edge cluster.
  • the update message is described, and the local configuration information is modified based on the configuration update in the update message.
  • the central cluster and the edge cluster may send the updated configuration message to the serviced application host after determining that the configuration information required by the application host designated as the main configuration cluster is updated.
  • the configuration management system also includes an application configuration interface that receives an update operation for the configuration information of each application system, and generates an update instruction correspondingly; the central cluster receives an update instruction for the configuration information of the application system , Specifically including: the central cluster receives an update instruction for the configuration information of the application system from the application configuration interface.
  • the central cluster and the edge cluster may perform the following steps: in response to a request for obtaining configuration information of the application host, the central cluster or the edge cluster obtains the corresponding locally based on the obtaining request. Configure information and send it to the application host.
  • the central cluster and the edge cluster may also execute the following method: the central cluster and the edge cluster, while sending configuration information to the application host, issue a certificate of read-only permission to the application host; The certificate is used for the application host to obtain the required configuration information.
  • the central cluster and the edge cluster may also use the following methods to enable the application host to determine the communication status of the central cluster or the edge cluster connected to the application host.
  • the central cluster and the edge cluster periodically send heartbeat messages, and the application host determines the communication status of the central cluster or the edge cluster connected to them by monitoring the heartbeat messages.
  • an embodiment of the present application provides an application host, including: a monitoring module 401, configured to monitor the main configuration cluster in real time to obtain configuration updates, and modify local configuration information based on the configuration updates; determining module 402. If it is determined that the main configuration cluster cannot be communicated normally, stop monitoring the main configuration cluster, and at the same time, re-determine the main configuration cluster from the available configuration clusters, and instruct the monitoring module to perform the Real-time monitoring.
  • a monitoring module 401 configured to monitor the main configuration cluster in real time to obtain configuration updates, and modify local configuration information based on the configuration updates
  • determining module 402. If it is determined that the main configuration cluster cannot be communicated normally, stop monitoring the main configuration cluster, and at the same time, re-determine the main configuration cluster from the available configuration clusters, and instruct the monitoring module to perform the Real-time monitoring.
  • the monitoring module 401 is specifically configured to: monitor in real time update messages issued by the main configuration cluster, and obtain configuration updates from the received update messages; the update message determines the configuration managed by the main configuration cluster. Issued when the information is updated.
  • the monitoring module 401 is further configured to: before the monitoring, establish a connection with the main configuration cluster, and obtain all configuration information required by the application host from the main configuration cluster, and save it locally.
  • the determining module 402 is further configured to: in the step of stopping the monitoring of the main configuration cluster, set the main configuration cluster as an unavailable configuration cluster, and monitor it, and if it is determined that normal communication is possible, Set it as an available configuration cluster.
  • the determining module 402 is further configured to determine whether to communicate with the main configuration cluster normally in the following manner: monitor and receive the heartbeat messages periodically sent by the main configuration cluster; if the receiving cycle is abnormal, or cannot receive the Heartbeat message, it is determined that normal communication with the main configuration cluster is not possible.
  • the determining module 402 is specifically configured to: the application host re-determines the main configuration cluster from the available configuration clusters according to a set strategy; the set strategy includes at least one or a combination of the following: The re-determined configuration cluster and the application host are located in the same local area network; the communication rate between the re-determined configuration cluster and the application host meets a set condition.
  • each of the configuration clusters stores the configuration information of the application host in the form of key-value pairs; the monitoring module 401 is specifically configured to: modify the local configuration information in the form of key-value pairs.
  • the monitoring module 401 is further configured to obtain an authority certificate corresponding to the main configuration cluster, and establish a connection with the main configuration cluster based on the authority certificate.
  • the embodiment of the present application provides a computer device including a program or instruction, and when the program or instruction is executed, it is used to execute any one of the configuration information management methods provided in the foregoing method embodiments.
  • An embodiment of the present application provides a configuration management system, the system includes: a central cluster and at least one edge cluster; the central cluster receives an update instruction for the configuration information of an application system; the central cluster executes the update Instructions to update the locally stored configuration information of the application system; the central cluster synchronizes the updated configuration information of the application system to the at least one edge cluster; the central cluster and the edge cluster Send an update message for the configuration information of the application system, so that the application host deployed with the application system can receive the update message by monitoring the central cluster or the edge cluster, and based on the information in the update message Configuration update to modify local configuration information.
  • this application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program codes.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Debugging And Monitoring (AREA)

Abstract

Disclosed are a method and device for managing configuration information. The method comprises: an application host monitoring a primary configuration cluster in real time to obtain a configuration update, and modifying local configuration information on the basis of the configuration update (201); and if it is determined that the application host is unable to communicate normally with the primary configuration cluster, stopping monitoring the primary configuration cluster, re-determining a primary configuration cluster from available configuration clusters, and returning to the monitoring step (202).

Description

一种配置信息管理方法及装置Configuration information management method and device
交叉引用cross reference
本申请引用于2019年10月17日递交的名称为“一种配置信息管理方法及装置”的第201910989465.7号中国专利申请,其通过引用被全部并入本申请This application refers to the Chinese Patent Application No. 201910989465.7 entitled "A Configuration Information Management Method and Device" filed on October 17, 2019, which is fully incorporated into this application by reference
技术领域Technical field
本申请涉及配置信息管理领域,尤其涉及一种配置信息管理方法及装置。This application relates to the field of configuration information management, and in particular to a method and device for configuration information management.
背景技术Background technique
随着互联网的高速发展,单机单应用的架构已经无法满足***性增长的用户数量和用户需求。在此背景下,分布式应用***也就随之产生。在分布式应用***架构中,各应用***都分别包含实现业务功能的业务***和用于管理配置信息的配置管理***。With the rapid development of the Internet, the single-machine single-application architecture has been unable to meet the explosive increase in the number of users and user needs. In this context, distributed application systems have also emerged. In the distributed application system architecture, each application system includes a business system for realizing business functions and a configuration management system for managing configuration information.
由于各应用***的配置信息存在共用的内容,对于基于同一个分布式架构实现的各应用***来说,分别单独部署和维护一套配置管理***的情况,可能会带来以下问题:耦合度高、可用性差、信息不统一等,并且如果配置管理***的健壮性不够,还将导致对应的业务***受到直接的影响。因此,上述问题亟待解决。Since the configuration information of each application system has shared content, for each application system based on the same distributed architecture, the situation of separately deploying and maintaining a set of configuration management systems may bring about the following problems: high coupling , Poor availability, inconsistent information, etc., and if the robustness of the configuration management system is not enough, it will also cause the corresponding business system to be directly affected. Therefore, the above-mentioned problems need to be solved urgently.
发明内容Summary of the invention
本申请实施例提供一种配置信息管理方法及装置,解决了现有技术中应用主机的配置信息修改容错性较低的问题。The embodiments of the present application provide a configuration information management method and device, which solves the problem of low fault tolerance in modification of configuration information of an application host in the prior art.
第一方面,本申请实施例提供一种配置信息管理方法,包括:所述应用 主机实时监听主配置集群以获取配置更新,并基于所述配置更新对本地的配置信息进行修改;所述应用主机若确定无法与所述主配置集群正常通信,则停止对所述主配置集群的监听,同时从可用的配置集群中重新确定出主配置集群,并返回至所述监听步骤。In a first aspect, an embodiment of the present application provides a configuration information management method, including: the application host monitors the main configuration cluster in real time to obtain configuration updates, and modifies local configuration information based on the configuration updates; the application host If it is determined that the main configuration cluster cannot be communicated normally, the monitoring of the main configuration cluster is stopped, and the main configuration cluster is re-determined from the available configuration clusters, and returns to the monitoring step.
上述配置信息管理方法中,应用主机实时监听主配置集群以获取配置更新,并基于所述配置更新对本地的配置信息进行修改,从而可以实时修改本地的配置信息,当所述应用主机若确定无法与所述主配置集群正常通信时,则停止对所述主配置集群的监听,同时从可用的配置集群中重新确定出主配置集群,并返回至所述监听步骤,从而提高了应用主机配置信息修改的容错性。In the above configuration information management method, the application host monitors the main configuration cluster in real time to obtain configuration updates, and modifies the local configuration information based on the configuration updates, so that the local configuration information can be modified in real time. When communicating with the main configuration cluster normally, the monitoring of the main configuration cluster is stopped, and the main configuration cluster is re-determined from the available configuration clusters, and returns to the monitoring step, thereby improving the application host configuration information Modified fault tolerance.
另外,所述应用主机实时监听主配置集群以获取配置更新包括:所述应用主机实时监听所述主配置集群发布的更新消息,并从收到的更新消息中获取配置更新,其中,所述更新消息为所述主配置集群确定自身管理的配置信息发生更新时发布的。In addition, the application host monitoring the main configuration cluster in real time to obtain configuration updates includes: the application host monitoring in real time update messages issued by the main configuration cluster, and obtaining configuration updates from the received update messages, wherein the update The message is issued when the master configuration cluster determines that the configuration information managed by itself is updated.
另外,所述应用主机本地的配置信息的获取方法包含:在所述监听之前,与所述主配置集群建立连接,并从所述主配置集群上获取所述应用主机所需的全量配置信息,保存在本地。In addition, the method for obtaining the local configuration information of the application host includes: before the monitoring, establishing a connection with the main configuration cluster, and obtaining the full amount of configuration information required by the application host from the main configuration cluster, Save it locally.
另外,所述停止对所述主配置集群的监听步骤中包含,将所述主配置集群设定为不可用配置集群,并对其进行监测,若确定可正常通信,则设定其为可用配置集群。In addition, the step of stopping the monitoring of the main configuration cluster includes setting the main configuration cluster as an unavailable configuration cluster, and monitoring it, and setting it as an available configuration if it is determined that normal communication is possible Cluster.
另外,所述应用主机确定是否与所述主配置集群正常通信的方法包括:监听接收所述主配置集群周期性发送的心跳消息;若接收周期异常,或无法接收到所述心跳消息,则确定与所述主配置集群无法正常通信。In addition, the method for the application host to determine whether it normally communicates with the main configuration cluster includes: monitoring and receiving heartbeat messages periodically sent by the main configuration cluster; if the receiving cycle is abnormal, or the heartbeat message cannot be received, determining Cannot communicate with the main configuration cluster normally.
另外,所述从所述应用主机的可用的配置集群中重新确定出主配置集群,包括:所述应用主机按照设定策略从所述可用的配置集群中重新确定出主配置集群;所述设定策略包括以下至少一项或多项的组合:所述重新确定出的配置集群与所述应用主机位于同一局域网;所述重新确定出的配置集群与所述应用 主机之间的通信速率符合设定条件。In addition, the re-determining the main configuration cluster from the available configuration clusters of the application host includes: the application host re-determining the main configuration cluster from the available configuration clusters according to a set policy; The determination strategy includes at least one or a combination of the following: the re-determined configuration cluster and the application host are located in the same local area network; the communication rate between the re-determined configuration cluster and the application host conforms to the design Set conditions.
另外,各所述配置集群以键值对方式存储所述应用主机的配置信息;所述应用主机对本地的配置信息进行修改,包括:所述应用主机以键值对的方式对本地的配置信息进行修改。In addition, each of the configuration clusters stores the configuration information of the application host in a key-value pair; the application host modifies the local configuration information, including: the application host performs a key-value pair on the local configuration information to modify.
另外,所述应用主机实时监听主配置集群之前,所述方法还包括:所述应用主机获取与所述主配置集群对应的权限证书,并基于所述权限证书与所述主配置集群建立连接。In addition, before the application host monitors the main configuration cluster in real time, the method further includes: the application host obtains an authority certificate corresponding to the main configuration cluster, and establishes a connection with the main configuration cluster based on the authority certificate.
第二方面,本申请实施例提供一种配置信息管理方法,应用于配置管理***,所述配置管理***包括一个中心集群、至少一个边缘集群,所述方法包括:所述中心集群接收到针对应用***的配置信息的更新指令;所述中心集群通过执行所述更新指令,来实现本地存储的所述应用***的配置信息的更新;所述中心集群将更新后的所述应用***的配置信息同步至所述至少一个边缘集群;所述中心集群和所述边缘集群发送针对所述应用***的配置信息的更新消息,使得部署有所述应用***的应用主机可通过监听所述中心集群或所述边缘集群来接收所述更新消息,并基于所述更新消息中的配置更新来对本地配置信息进行修改。In a second aspect, an embodiment of the present application provides a configuration information management method, which is applied to a configuration management system. The configuration management system includes a central cluster and at least one edge cluster. The method includes: Update instructions for the configuration information of the system; the central cluster implements the update instructions to update the locally stored configuration information of the application system; the central cluster synchronizes the updated configuration information of the application system To the at least one edge cluster; the central cluster and the edge cluster send update messages for the configuration information of the application system, so that the application host deployed with the application system can monitor the central cluster or the The edge cluster receives the update message, and modifies the local configuration information based on the configuration update in the update message.
另外,所述配置管理***还包含一应用配置接口,所述应用配置接口接收针对各应用***的配置信息的更新操作,并对应生成更新指令;所述中心集群接收到针对应用***的配置信息的更新指令,包括:所述中心集群从所述应用配置接口接收到针对应用***的配置信息的更新指令。In addition, the configuration management system also includes an application configuration interface that receives update operations for the configuration information of each application system, and generates update instructions correspondingly; the central cluster receives the configuration information for the application system The update instruction includes: the central cluster receives an update instruction for the configuration information of the application system from the application configuration interface.
另外,响应于所述应用主机的配置信息获取请求,所述中心集群或所述边缘集群基于所述获取请求从本地获取对应的配置信息,并发送至所述应用主机。In addition, in response to the configuration information obtaining request of the application host, the central cluster or the edge cluster obtains corresponding configuration information locally based on the obtaining request, and sends it to the application host.
另外,所述中心集群和所述边缘集群在向所述应用主机发送配置信息的同时,向所述应用主机颁发只读权限的证书;所述证书用于所述应用主机获取所需的配置信息。In addition, when the central cluster and the edge cluster send configuration information to the application host, they also issue a read-only certificate to the application host; the certificate is used by the application host to obtain the required configuration information .
另外,所述中心集群和所述边缘集群周期性发送心跳消息,应用主机通过监听所述心跳消息,确定与其连接的中心集群或边缘集群的通信状态。In addition, the central cluster and the edge cluster periodically send heartbeat messages, and the application host determines the communication status of the central cluster or the edge cluster connected to them by monitoring the heartbeat messages.
第三方面,本申请实施例提供一种应用主机,包括:监听模块,用于实时监听主配置集群以获取配置更新,并基于所述配置更新对本地的配置信息进行修改;确定模块,用于若确定无法与所述主配置集群正常通信,则停止对所述主配置集群的监听,同时从可用的配置集群中重新确定出主配置集群,并指示所述监听模块进行所述实时监听。In a third aspect, an embodiment of the present application provides an application host, including: a monitoring module, configured to monitor the main configuration cluster in real time to obtain configuration updates, and modify local configuration information based on the configuration updates; a determining module for If it is determined that the main configuration cluster cannot communicate normally, the monitoring of the main configuration cluster is stopped, and the main configuration cluster is re-determined from the available configuration clusters, and the monitoring module is instructed to perform the real-time monitoring.
另外,所述监听模块聚具体用于:实时监听所述主配置集群发布的更新消息,并从收到的更新消息中获取配置更新;所述更新消息为所述主配置集群确定自身管理的配置信息发生更新时发布的。In addition, the monitoring module is specifically configured to: monitor the update messages issued by the master configuration cluster in real time, and obtain configuration updates from the received update messages; the update message determines the configuration managed by the master configuration cluster. Issued when the information is updated.
另外,所述监听模块还用于:在所述监听之前,与所述主配置集群建立连接,并从所述主配置集群上获取所述应用主机所需的全量配置信息,保存在本地。In addition, the monitoring module is further configured to: before the monitoring, establish a connection with the main configuration cluster, and obtain all configuration information required by the application host from the main configuration cluster, and save it locally.
另外,所述确定模块还用于:在停止对所述主配置集群的监听步骤中,将所述主配置集群设定为不可用配置集群,并对其进行监测,若确定可正常通信,则设定其为可用配置集群。In addition, the determining module is further configured to: in the step of stopping the monitoring of the main configuration cluster, set the main configuration cluster as an unavailable configuration cluster, and monitor it, and if it is determined that normal communication is possible, then Set it as an available configuration cluster.
另外,所述确定模块还用于:按照以下方式确定是否与所述主配置集群正常通信:监听接收所述主配置集群周期性发送的心跳消息;若接收周期异常,或无法接收到所述心跳消息,则确定与所述主配置集群无法正常通信。In addition, the determining module is further configured to: determine whether it normally communicates with the main configuration cluster in the following manner: monitor and receive heartbeat messages periodically sent by the main configuration cluster; if the receiving cycle is abnormal, or the heartbeat cannot be received Message, it is determined that normal communication with the main configuration cluster is not possible.
另外,所述确定模块用于:所述应用主机按照设定策略从所述可用的配置集群中重新确定出主配置集群;所述设定策略包括以下至少一项或多项的组合:所述重新确定出的配置集群与所述应用主机位于同一局域网;所述重新确定出的配置集群与所述应用主机之间的通信速率符合设定条件。In addition, the determining module is configured to: the application host re-determines the main configuration cluster from the available configuration clusters according to a set strategy; the set strategy includes at least one or a combination of the following: The re-determined configuration cluster and the application host are located in the same local area network; the communication rate between the re-determined configuration cluster and the application host meets a set condition.
另外,各所述配置集群以键值对方式存储所述应用主机的配置信息;所述监听模块用于:以键值对的方式对本地的配置信息进行修改。In addition, each of the configuration clusters stores the configuration information of the application host in a key-value pair; the monitoring module is used to modify the local configuration information in a key-value pair.
另外,所述监听模块还用于:获取与所述主配置集群对应的权限证书, 并基于所述权限证书与所述主配置集群建立连接。In addition, the monitoring module is further configured to obtain an authority certificate corresponding to the main configuration cluster, and establish a connection with the main configuration cluster based on the authority certificate.
第四方面,本申请实施例提供一种计算机设备,包括程序或指令,当所述程序或指令被执行时,用以执行上述第一方面及第一方面各个实施例或第二方面及第二方面各个实施例的方法。In a fourth aspect, an embodiment of the present application provides a computer device, including a program or instruction. When the program or instruction is executed, it is used to execute each of the above-mentioned first aspect and first aspect embodiments or the second and second aspects. Aspects of the methods of various embodiments.
第五方面,本申请实施例提供一种配置管理***,所述***包括:一个中心集群、至少一个边缘集群;所述中心集群接收到针对应用***的配置信息的更新指令;所述中心集群通过执行所述更新指令,来实现本地存储的所述应用***的配置信息的更新;所述中心集群将更新后的所述应用***的配置信息同步至所述至少一个边缘集群;所述中心集群和所述边缘集群发送针对所述应用***的配置信息的更新消息,使得部署有所述应用***的应用主机可通过监听所述中心集群或所述边缘集群来接收所述更新消息,并基于所述更新消息中的配置更新来对本地配置信息进行修改。In a fifth aspect, an embodiment of the present application provides a configuration management system, the system includes: a central cluster, at least one edge cluster; the central cluster receives an update instruction for the configuration information of the application system; the central cluster passes The update instruction is executed to update the locally stored configuration information of the application system; the central cluster synchronizes the updated configuration information of the application system to the at least one edge cluster; the central cluster and The edge cluster sends an update message for the configuration information of the application system, so that the application host deployed with the application system can receive the update message by listening to the central cluster or the edge cluster, and based on the The configuration update in the update message is used to modify the local configuration information.
附图说明Description of the drawings
图1为本申请实施例提供的一种配置管理***架构示意图;FIG. 1 is a schematic diagram of the architecture of a configuration management system provided by an embodiment of the application;
图2为本申请实施例提供的一种配置信息管理方法的步骤流程示意图;FIG. 2 is a schematic flowchart of the steps of a configuration information management method provided by an embodiment of the application;
图3为本申请实施例提供的一种配置信息管理方法的步骤流程示意图;FIG. 3 is a schematic flow chart of the steps of a configuration information management method provided by an embodiment of the application;
图4为本申请实施例提供的一种配置信息管理装置的结构示意图。Fig. 4 is a schematic structural diagram of a configuration information management device provided by an embodiment of the application.
具体实施方式Detailed ways
为了更好的理解上述技术方案,下面将结合说明书附图及具体的实施方式对上述技术方案进行详细的说明,应当理解本申请实施例以及实施例中的具体特征是对本申请技术方案的详细的说明,而不是对本申请技术方案的限定,在不冲突的情况下,本申请实施例以及实施例中的技术特征可以相互结合。In order to better understand the above technical solutions, the above technical solutions will be described in detail below with reference to the drawings and specific implementations of the specification. It should be understood that the embodiments of the application and the specific features in the embodiments are detailed to the technical solutions of the application. Note, rather than limiting the technical solution of the present application, the embodiments of the present application and the technical features in the embodiments can be combined with each other if there is no conflict.
如图1所示,为本申请实施例提供的一种配置管理***的架构示意图。As shown in FIG. 1, it is a schematic structural diagram of a configuration management system provided by an embodiment of this application.
图1示出的架构包括:应用配置接口、中心集群、边缘集群和应用主机。 该架构可用于统一管理分布式应用***中的各应用***的配置信息。需要说明的是,图1示出的架构仅作为一个示例,图1示出的架构还可以做多种变形,举例来说,边缘集群的数量不做限定,各集群中节点的数量不做限定,应用主机的数量不做限定等。本实施例所提供的配置管理***可用于对分布式应用***中的各应用***对应的配置信息进行统一管理。The architecture shown in Figure 1 includes: application configuration interface, central cluster, edge cluster, and application host. This architecture can be used to uniformly manage the configuration information of each application system in a distributed application system. It should be noted that the architecture shown in Figure 1 is only an example, and the architecture shown in Figure 1 can also be modified in many ways. For example, the number of edge clusters is not limited, and the number of nodes in each cluster is not limited. , The number of application hosts is not limited. The configuration management system provided in this embodiment can be used to uniformly manage the configuration information corresponding to each application system in the distributed application system.
应用配置接口(即图示中的web应用服务):修改配置信息的唯一入口,提供配置信息操作界面,用于接收上游应用***(即分布式应用***的服务端)对配置信息的新增、修改及删除等操作,并对应生成配置信息更新指令。也就是说,各应用***对配置信息的更新,只能通过应用配置接口进行操作,保证了配置信息修改入口的统一性。其中,应用配置接口所提供的操作界面可基于web浏览器、HTML5页面来实现。Application configuration interface (ie the web application service in the figure): The only entry for modifying configuration information, providing configuration information operation interface, used to receive the upstream application system (that is, the server of the distributed application system) to the new configuration information, Modify and delete operations, and generate configuration information update instructions accordingly. That is to say, each application system can only operate through the application configuration interface to update the configuration information, which ensures the unity of the configuration information modification entry. Among them, the operation interface provided by the application configuration interface can be implemented based on a web browser and an HTML5 page.
中心集群:用于获取应用配置接口生成的配置信息更新指令,并且是可执行所述更新指令的唯一集群,以实现对配置信息修改,保证了配置信息修改执行的唯一性。Central cluster: used to obtain the configuration information update instructions generated by the application configuration interface, and is the only cluster that can execute the update instructions, so as to modify the configuration information and ensure the uniqueness of the execution of the configuration information modification.
在初始化阶段,中心集群启动后,配置管理***将全量配置信息初始化到中心集群中,由中心集群内部保证中心集群中的各个节点存储的配置信息保持一致,再由中心集群将全量配置信息同步至该架构中的各边缘集群。需要说明的是,全量配置信息包含接入配置管理***的所有应用***的配置信息,中心集群可基于该全量配置信息的进行更新。由于中心集群可包含多个节点,各节点可分布在不同机器设备上,各节点上存储的配置信息是相同的,即便中心集群中有部分节点发生故障,也可以通过其他节点来接替进行配置信息的存储、修改和同步,从而提高容错性、可用性。In the initialization phase, after the central cluster is started, the configuration management system initializes all configuration information to the central cluster. The central cluster ensures that the configuration information stored by each node in the central cluster is consistent, and then the central cluster synchronizes the full configuration information to the central cluster. Each edge cluster in the architecture. It should be noted that the full configuration information includes configuration information of all application systems connected to the configuration management system, and the central cluster can be updated based on the full configuration information. Since the central cluster can contain multiple nodes, each node can be distributed on different machines and equipment, and the configuration information stored on each node is the same. Even if some nodes in the central cluster fail, other nodes can be used to replace the configuration information. The storage, modification and synchronization of the system can improve fault tolerance and availability.
中心集群完成初始化后具体可以通过执行所述更新指令来实现配置信息的更新,具体可包含以下配置项。After the central cluster is initialized, the configuration information can be updated by executing the update instruction, which can specifically include the following configuration items.
(1)新增配置项,则在各中心节点上的当前配置信息中新增该配置项。(1) When a new configuration item is added, the configuration item is added to the current configuration information on each central node.
(2)修改配置项,则在各中心节点上的当前配置信息中找到该配置项,修 改其值。(2) Modify a configuration item, find the configuration item in the current configuration information on each central node, and modify its value.
(3)删除配置项,则在各中心节点上的当前配置信息中找到该配置项,并删除。(3) To delete a configuration item, find the configuration item in the current configuration information on each central node and delete it.
边缘集群:配置管理***的架构中可包含多个边缘集群,边缘集群可从中心集群同步获取配置信息。在初始化阶段,各边缘集群可从中心集群同步获取初始化全量配置信息,并保证内部各个节点存储的配置信息保持一致。在初始化后,可进一步实时同步中心集群中的配置信息,边缘集群与中心集群的同步可以通过复制镜像(make-mirror)的方式进行。与中心集群类似,边缘集群中也有多个节点,一个节点发生故障后,同样可以通过其他节点来接替进行配置信息的存储、修改和同步,从而提高容错性、可用性。Edge cluster: The architecture of the configuration management system can contain multiple edge clusters, and the edge cluster can obtain configuration information synchronously from the central cluster. In the initialization phase, each edge cluster can synchronously obtain the initial full configuration information from the central cluster, and ensure that the configuration information stored by each internal node is consistent. After initialization, the configuration information in the central cluster can be further synchronized in real time, and the synchronization between the edge cluster and the central cluster can be performed by means of copy mirroring (make-mirror). Similar to a central cluster, there are multiple nodes in an edge cluster. After a node fails, other nodes can also be used to store, modify, and synchronize configuration information, thereby improving fault tolerance and availability.
应用主机:应用主机运行有应用***的客户端程序,是配置信息的使用者。应用主机可在初始化阶段指定配置集群,并从配置集群中选取一个作为主配置集群,并从主配置集群上获取所需的配置信息;并在初始化后开启监听线程,对主配置集群进行监听,实时监听所需要配置信息是否发生变更,如有变更,则可从主配置集群获取变更后的配置信息。Application host: The application host runs a client program with an application system and is a user of configuration information. The application host can specify the configuration cluster during the initialization phase, and select one of the configuration clusters as the main configuration cluster, and obtain the required configuration information from the main configuration cluster; and start the monitoring thread after initialization to monitor the main configuration cluster. Monitor in real time whether the required configuration information has changed. If there is any change, you can obtain the changed configuration information from the main configuration cluster.
其中主配置集群的选择,具体可以包含以下方式:若应用主机与中心集群通讯状态良好(举例来说,应用主机与中心集群在同一局域网,或地理位置较近,可认为通讯状态良好),则直接将中心集群作为主配置集群;若应用主机与中心集群通讯状态不佳(举例来说,应用主机与中心集群不在同一局域网,或地理位置较远,则认为通讯状态不佳),则可以从被指定为配置集群的边缘集群中,选择一与其通讯状态良好的边缘集群作为主配置集群这种方式可以最大化降低通信状态对应用主机的影响,同时可指定中心集群及至少一可与应用主机正常通信的边缘集群作为辅配置集群,以作为备用的主配置集群。The selection of the main configuration cluster can specifically include the following methods: if the communication status between the application host and the central cluster is good (for example, if the application host and the central cluster are in the same local area network, or the geographical location is close, the communication status can be considered good), then Directly use the central cluster as the main configuration cluster; if the communication status between the application host and the central cluster is poor (for example, if the application host and the central cluster are not in the same local area network, or the geographical location is far away, the communication status is considered poor), you can use Among the edge clusters designated as the configuration cluster, select an edge cluster with good communication status as the main configuration cluster. This method can minimize the impact of the communication status on the application host. At the same time, the central cluster and at least one application host can be designated The edge cluster that communicates normally serves as a secondary configuration cluster and serves as a backup primary configuration cluster.
应用主机可以指定一个或多个配置集群,用于获取所需的配置信息。但是,同一时刻只能从主配置集群进行交互,用于对获取最新的配置信息,当主配置集群发生故障后,应用主机可以从辅配置集群中重新选择一个集群,作为 主配置集群。The application host can specify one or more configuration clusters to obtain the required configuration information. However, you can only interact from the main configuration cluster at the same time to obtain the latest configuration information. When the main configuration cluster fails, the application host can reselect a cluster from the auxiliary configuration cluster as the main configuration cluster.
具体的,应用主机可通过嵌入的软件开发工具包(Software development kit,SDK)文件来实现接入配置管理***。通过SDK编写程序,为应用主机和主配置集群提供交互的应用程序接口,还可以通过SDK实现应用主机对主配置集群的选择和监听,以及自动切换主配置集群和重连机制的功能写入,从而应用主机可支持自动切换配置集群和重连机制。Specifically, the application host can implement access to the configuration management system through an embedded software development kit (SDK) file. Programs are written through the SDK to provide interactive application program interfaces for the application host and the main configuration cluster. The selection and monitoring of the main configuration cluster by the application host can also be realized through the SDK, as well as the automatic switching of the main configuration cluster and the reconnection mechanism. Thus, the application host can support automatic switch configuration cluster and reconnection mechanism.
更具体的,本申请中的sdk工具,可以在应用主机的客户端集成后,从主配置集群获取应用主机所需的配置信息,并把所需配置信息加载到本地内存中,如此一来,应用主机可直接使用本地内存中的配置信息,对存在高并发请求的***,使用效率有显著的提高,而且即使所有的配置集群都无法提供服务,客户端仍然有配置信息可用,充分解耦,这对有高可用要求的***来说,至关重要,sdk可实现内部自动检测通讯配置集群的健康状态,并自动切换,可以有效降低故障处理响应时间和人工维护成本。More specifically, the SDK tool in this application can obtain the configuration information required by the application host from the main configuration cluster after the client of the application host is integrated, and load the required configuration information into the local memory. In this way, The application host can directly use the configuration information in the local memory. For systems with high concurrent requests, the use efficiency is significantly improved, and even if all configuration clusters cannot provide services, the client still has configuration information available, which is fully decoupled. This is very important for systems with high availability requirements. The SDK can automatically detect the health status of the communication configuration cluster and switch automatically, which can effectively reduce the fault handling response time and manual maintenance costs.
该架构中,通过配置信息管理***实现对各应用***的配置信息的统一管理,使得应用***中的业务***和配置管理充分解耦,有效地降低了配置信息管理与业务应用程序的耦合度,并通过中心集群和边缘集群对配置信息进行更新和存储,可使得应用***的客户端随时获取配置信息。In this architecture, the unified management of the configuration information of each application system is realized through the configuration information management system, so that the business system and configuration management in the application system are fully decoupled, and the coupling between configuration information management and business applications is effectively reduced. And through the central cluster and edge clusters to update and store the configuration information, the client of the application system can obtain the configuration information at any time.
该架构中,配置信息存入中心配置集群和边缘集群时,可以进行加密,并且在应用主机请求接入时,颁发只读权限的证书给应用主机,配置信息的写操作只能在最上层的统一入口即应用配置接口上进行,以此防止任一证书泄漏后,导致高敏感度的配置信息泄漏和被随意变更。由于分发的证书是只有只读权限的证书,即使证书泄漏,也只能获取到加密后的数据,并且无法更改配置数据,提高整个工具的安全性,以此满足配置信息敏感度高的场景。In this architecture, when the configuration information is stored in the central configuration cluster and edge cluster, it can be encrypted, and when the application host requests access, a certificate with read-only permission is issued to the application host, and the configuration information can only be written in the uppermost layer. The unified entry is performed on the application configuration interface, so as to prevent any certificate from being leaked, resulting in highly sensitive configuration information leakage and random changes. Since the distributed certificate is a certificate with read-only permission, even if the certificate is leaked, only the encrypted data can be obtained, and the configuration data cannot be changed, which improves the security of the entire tool and meets the scenarios with high configuration information sensitivity.
需要说明的是,中心集群和各边缘集群可采用分布式的键值对数据存储***(etcd)集群。etcd集群是高可用***,用以提高整个工具的可用性,降低配置管理***的宕机对具体业务***造成的影响。It should be noted that the central cluster and each edge cluster can adopt a distributed key-value pair data storage system (etcd) cluster. The etcd cluster is a highly available system to improve the availability of the entire tool and reduce the impact of configuration management system downtime on specific business systems.
下面结合图2,详细介绍本申请实施例提供的一种配置信息管理方法的步骤流程示意图,所述配置管理方法应用于上述实施例所提供的配置管理***中的应用主机。The following describes in detail a schematic diagram of the flow of steps of a configuration information management method provided by an embodiment of the present application with reference to FIG. 2. The configuration management method is applied to the application host in the configuration management system provided in the foregoing embodiment.
步骤201:应用主机实时监听主配置集群以获取配置更新,并基于所述配置更新对本地的配置信息进行修改。Step 201: The application host monitors the main configuration cluster in real time to obtain configuration updates, and modifies local configuration information based on the configuration updates.
如上文所述,应用主机在接入配置管理***时,可指定配置集群,并选择主配置集群,从主配置集群中获取所需的配置信息,并通过对主配置集群的监听来获取配置更新,以保证本地存有最新的配置信息。As mentioned above, when the application host accesses the configuration management system, it can specify the configuration cluster and select the main configuration cluster, obtain the required configuration information from the main configuration cluster, and obtain configuration updates by monitoring the main configuration cluster To ensure that the latest configuration information is stored locally.
具体而言,应用主机可在监听到主配置集群上有对其所需的配置信息进行更新时,直接从主配置集群上获取最新的配置信息,并替换本地已保存的配置信息。为了减少应用主机与集群间的数据传输量,也可从主配置集群上获取配置更新,并基于配置更新对本地配置信息进行修改,以得到最新的配置信息。Specifically, the application host can directly obtain the latest configuration information from the main configuration cluster and replace the locally saved configuration information when it monitors that there is an update to the configuration information it needs on the main configuration cluster. In order to reduce the amount of data transmission between the application host and the cluster, configuration updates can also be obtained from the main configuration cluster, and the local configuration information can be modified based on the configuration updates to obtain the latest configuration information.
例如,应用主机实时监听主配置集群以获取配置更新的步骤可以包含:所述应用主机实时监听所述主配置集群发布的更新消息,并从收到的更新消息中获取配置更新,其中,所述更新消息为所述主配置集群确定自身管理的配置信息发生更新时发布的,如此一来,应用主机在获取到配置更新时,还需确认该配置更新是否针对本机所需的配置信息,若是,则基于该配置更新进行本地配置信息的更新,若否,则可直接丢弃。For example, the step of the application host monitoring the main configuration cluster in real time to obtain configuration updates may include: the application host monitoring the update messages issued by the main configuration cluster in real time, and obtaining configuration updates from the received update messages, wherein the The update message is issued when the main configuration cluster determines that the configuration information managed by itself is updated. In this way, when the application host obtains the configuration update, it also needs to confirm whether the configuration update is for the configuration information required by the machine. , The local configuration information is updated based on the configuration update, if not, it can be discarded directly.
步骤202:应用主机若确定无法与所述主配置集群正常通信,则停止对所述主配置集群的监听,同时从可用的配置集群中重新确定出主配置集群,并返回至所述监听步骤。Step 202: If the application host determines that it cannot communicate with the main configuration cluster normally, it stops monitoring the main configuration cluster, and at the same time re-determines the main configuration cluster from the available configuration clusters, and returns to the monitoring step.
具体而言,应用主机确定是否与主配置集群正常通信的方法可包含:监听接收主配置集群周期性发送的心跳消息,若接收周期异常,或无法接收到心跳消息,则确定与主配置集群无法正常通信。Specifically, the method for the application host to determine whether it normally communicates with the main configuration cluster may include: monitoring and receiving heartbeat messages periodically sent by the main configuration cluster. If the receiving cycle is abnormal or the heartbeat message cannot be received, it is determined that the main configuration cluster cannot be communicated with. Normal communication.
当应用主机若确定无法与主配置集群正常通信时,应用主机可停止对主配置集群的监听,同时,将该主配置集群设定为不可用配置集群,可以理解的 是,各应用主机与各配置集群的通信状态可能会发生异常,当应用主机发现与配置集群无法正常通信时,可将该配置集群置为不可用,同时应用主机可对对不可用配置集群其进行监测,以获取与不可用配置集群的通信状态,若确定可正常通信,则可重新将不可用配置集群设定其为可用。When the application host determines that it cannot communicate with the main configuration cluster normally, the application host can stop monitoring the main configuration cluster, and at the same time, set the main configuration cluster as an unavailable configuration cluster. The communication status of the configuration cluster may be abnormal. When the application host finds that it cannot communicate with the configuration cluster normally, the configuration cluster can be set as unavailable. At the same time, the application host can monitor the unavailable configuration cluster to obtain the status of unavailability. With the communication status of the configuration cluster, if it is determined that the communication can be normal, the unavailable configuration cluster can be set as available again.
当应用主机确定无法与主配置集群正常通信时,可从可用的配置集群中重新指定主配置集群,作为当前主配置集群。When the application host determines that it cannot communicate with the main configuration cluster normally, it can re-designate the main configuration cluster from the available configuration clusters as the current main configuration cluster.
举例来说,应用主机嵌入的SDK中配置了中心集群、边缘集群1和边缘集群2三个配置集群,其中,在初始阶段,基于预设规则指定边缘集群1为主配置集群,中心集群和边缘集群2为辅配置集群,并与边缘集群1进行数据交互;当应用主机确定边缘集群1的所有节点都不可用时,可重新指定边缘集群2作为主配置集群,具体可以按照周期与主配置集群进行心跳测试,如果在一段设定时间段内没收到来自主配置集群的心跳消息,则可确定无法与主配置集群进行正常通信,并可重新从中心集群和边缘集群2中重新确定出主配置集群,并进行监听。For example, the SDK embedded in the application host is configured with three configuration clusters: central cluster, edge cluster 1 and edge cluster 2. In the initial stage, edge cluster 1 is designated as the main configuration cluster, central cluster and edge cluster based on preset rules. Cluster 2 is a secondary configuration cluster and performs data interaction with edge cluster 1. When the application host determines that all nodes of edge cluster 1 are unavailable, edge cluster 2 can be re-designated as the main configuration cluster, which can be performed in accordance with the cycle and the main configuration cluster. Heartbeat test, if the heartbeat message from the main configuration cluster is not received within a set period of time, it can be determined that normal communication with the main configuration cluster cannot be performed, and the main configuration cluster can be re-determined from the central cluster and edge cluster 2. And monitor it.
从所述应用主机的可用的配置集群中重新确定出主配置集群的具体实施方式可包含:所述应用主机按照设定策略从所述可用的配置集群中重新确定出主配置集群;所述设定策略包括以下至少一项或多项的组合:所述重新确定出的主配置集群与所述应用主机位于同一局域网;所述重新确定出的主配置集群与所述应用主机之间的通信速率符合设定条件。The specific implementation manner of re-determining the main configuration cluster from the available configuration clusters of the application host may include: the application host re-determines the main configuration cluster from the available configuration clusters according to a set policy; The predetermined strategy includes at least one or a combination of the following: the re-determined main configuration cluster and the application host are located in the same local area network; the re-determined main configuration cluster and the application host communication rate Meet the set conditions.
举例来说,当将与所述应用主机之间的通信速率大于预设速率阈值的辅配置集群,作为重新确定出的主配置集群。For example, when a secondary configuration cluster whose communication rate with the application host is greater than a preset rate threshold is used as the re-determined primary configuration cluster.
在一实施中,在应用主机指定配置集群时,可先分别对各集群的网络状态进行探测,包括是否位于同一局域网的判断,以及通信速率的确定,并基于探测结果进行排序,并筛选出符合预设规则的集群作为指定的配置集群,并指定条件最优的为主配置集群,其他的为辅配置集群,并保存各辅配置集群的顺序,这样一来,在从辅配置集群中指定新的主配置集群时,可直接基于保存的 顺序快速选择出条件最优的辅配置集群。In one implementation, when the application host specifies the configuration of the cluster, the network status of each cluster can be detected separately, including the judgment of whether they are located in the same local area network, and the determination of the communication rate, and sort based on the detection results, and filter out the matching The cluster with preset rules is used as the designated configuration cluster, and the best configuration is designated as the primary configuration cluster, and the others are secondary configuration clusters. The order of each secondary configuration cluster is saved. In this way, the new configuration cluster is specified in the secondary configuration cluster. When the main configuration cluster is selected, the auxiliary configuration cluster with the best conditions can be quickly selected based on the saved sequence.
例如,所述配置管理***的各集群以键值对方式存储各应用***的配置信息;更新所述应用主机中存储的配置信息可以包含:所述应用主机以键值对的方式更新所述应用主机中存储的配置信息。通过键值对方式存储配置信息便于应用主机快速获取配置信息,同时也便于更新应用主机中存储的配置信息,提升了配置信息更新和获取的效率。For example, each cluster of the configuration management system stores the configuration information of each application system in the form of key-value pairs; updating the configuration information stored in the application host may include: the application host updates the application in the form of key-value pairs Configuration information stored in the host. Storing the configuration information in the key-value pair method facilitates the application host to quickly obtain the configuration information, and at the same time, it is convenient to update the configuration information stored in the application host, which improves the efficiency of updating and obtaining the configuration information.
例如:所述应用主机在初次接入配置管理***时,可获取与所需配置信息对应的权限证书,并基于所述权限证书与所述主配置集群建立连接。***颁发给应用主机的是只读权限的证书,应用主机不能擅自对配置信息修改,而且应用主机根据所述证书才能监听所述主配置集群中所述应用主机的配置信息,从而提升了配置信息获取的安全性。For example, when the application host accesses the configuration management system for the first time, it can obtain an authority certificate corresponding to the required configuration information, and establish a connection with the main configuration cluster based on the authority certificate. The system issues a certificate with read-only permission to the application host. The application host cannot modify the configuration information without authorization, and the application host can monitor the configuration information of the application host in the main configuration cluster according to the certificate, thereby improving the configuration information Security of access.
上述配置信息管理方法中,应用主机实时监听主配置集群以获取配置更新,并基于所述配置更新对本地的配置信息进行修改,从而可以实时修改本地的配置信息,当所述应用主机若确定无法与所述主配置集群正常通信时,则停止对所述主配置集群的监听,同时从可用的配置集群中重新确定出主配置集群,并返回至所述监听步骤,从而提高了应用主机配置信息修改的容错性。In the above configuration information management method, the application host monitors the main configuration cluster in real time to obtain configuration updates, and modifies the local configuration information based on the configuration updates, so that the local configuration information can be modified in real time. When communicating with the main configuration cluster normally, the monitoring of the main configuration cluster is stopped, and the main configuration cluster is re-determined from the available configuration clusters, and returns to the monitoring step, thereby improving the application host configuration information Modified fault tolerance.
步骤201~步骤202为配置信息管理方法在应用主机侧的应用,相对应的,还有在集群侧的应用。 Steps 201 to 202 are applications of the configuration information management method on the application host side, and correspondingly, there are applications on the cluster side.
本申请实施例提供一种配置信息管理方法,应用于上述配置管理***,所述方法包括以下步骤。The embodiment of the present application provides a configuration information management method, which is applied to the above-mentioned configuration management system, and the method includes the following steps.
步骤301:所述中心集群接收到针对应用***的配置信息的更新指令。Step 301: The central cluster receives an update instruction for the configuration information of the application system.
步骤302:所述中心集群通过执行所述更新指令,来实现本地存储的所述应用***的配置信息的更新。Step 302: The central cluster implements the update of the locally stored configuration information of the application system by executing the update instruction.
步骤303:所述中心集群将更新后的所述应用***的配置信息同步至所述至少一个边缘集群。Step 303: The central cluster synchronizes the updated configuration information of the application system to the at least one edge cluster.
步骤304:所述中心集群和所述边缘集群发送针对所述应用***的配置 信息的更新消息,使得部署有所述应用***的应用主机可通过监听所述中心集群或所述边缘集群来接收所述更新消息,并基于所述更新消息中的配置更新来对本地配置信息进行修改。Step 304: The central cluster and the edge cluster send update messages for the configuration information of the application system, so that the application host deployed with the application system can receive the information by monitoring the central cluster or the edge cluster. The update message is described, and the local configuration information is modified based on the configuration update in the update message.
步骤301~步骤304中,中心集群和边缘集群可在确定指定其为主配置集群的应用主机所需的配置信息更新后,向所服务的应用主机发送更新的配置消息。In step 301 to step 304, the central cluster and the edge cluster may send the updated configuration message to the serviced application host after determining that the configuration information required by the application host designated as the main configuration cluster is updated.
所述配置管理***还包含一应用配置接口,所述应用配置接口接收针对各应用***的配置信息的更新操作,并对应生成更新指令;所述中心集群接收到针对应用***的配置信息的更新指令,具体包括:所述中心集群从所述应用配置接口接收到针对应用***的配置信息的更新指令。The configuration management system also includes an application configuration interface that receives an update operation for the configuration information of each application system, and generates an update instruction correspondingly; the central cluster receives an update instruction for the configuration information of the application system , Specifically including: the central cluster receives an update instruction for the configuration information of the application system from the application configuration interface.
上述实施例中,所述中心集群和所述边缘集群可以执行以下步骤:响应于所述应用主机的配置信息获取请求,所述中心集群或所述边缘集群基于所述获取请求从本地获取对应的配置信息,并发送至所述应用主机。In the foregoing embodiment, the central cluster and the edge cluster may perform the following steps: in response to a request for obtaining configuration information of the application host, the central cluster or the edge cluster obtains the corresponding locally based on the obtaining request. Configure information and send it to the application host.
所述中心集群和所述边缘集群还可以执行以下方法:所述中心集群和所述边缘集群在向所述应用主机发送配置信息的同时,向所述应用主机颁发只读权限的证书;所述证书用于所述应用主机获取所需的配置信息。The central cluster and the edge cluster may also execute the following method: the central cluster and the edge cluster, while sending configuration information to the application host, issue a certificate of read-only permission to the application host; The certificate is used for the application host to obtain the required configuration information.
所述中心集群和所述边缘集群还可以通过以下方式,使得应用主机确定与其连接的中心集群或边缘集群的通信状态。The central cluster and the edge cluster may also use the following methods to enable the application host to determine the communication status of the central cluster or the edge cluster connected to the application host.
所述中心集群和所述边缘集群周期性发送心跳消息,应用主机通过监听所述心跳消息,确定与其连接的中心集群或边缘集群的通信状态。The central cluster and the edge cluster periodically send heartbeat messages, and the application host determines the communication status of the central cluster or the edge cluster connected to them by monitoring the heartbeat messages.
如图4所示,本申请实施例提供一种应用主机,包括:监听模块401,用于实时监听主配置集群以获取配置更新,并基于所述配置更新对本地的配置信息进行修改;确定模块402,用于若确定无法与所述主配置集群正常通信,则停止对所述主配置集群的监听,同时从可用的配置集群中重新确定出主配置集群,并指示所述监听模块进行所述实时监听。As shown in FIG. 4, an embodiment of the present application provides an application host, including: a monitoring module 401, configured to monitor the main configuration cluster in real time to obtain configuration updates, and modify local configuration information based on the configuration updates; determining module 402. If it is determined that the main configuration cluster cannot be communicated normally, stop monitoring the main configuration cluster, and at the same time, re-determine the main configuration cluster from the available configuration clusters, and instruct the monitoring module to perform the Real-time monitoring.
另外,所述监听模块401具体用于:实时监听所述主配置集群发布的更 新消息,并从收到的更新消息中获取配置更新;所述更新消息为所述主配置集群确定自身管理的配置信息发生更新时发布的。In addition, the monitoring module 401 is specifically configured to: monitor in real time update messages issued by the main configuration cluster, and obtain configuration updates from the received update messages; the update message determines the configuration managed by the main configuration cluster. Issued when the information is updated.
另外,所述监听模块401还用于:在所述监听之前,与所述主配置集群建立连接,并从所述主配置集群上获取所述应用主机所需的全量配置信息,保存在本地。In addition, the monitoring module 401 is further configured to: before the monitoring, establish a connection with the main configuration cluster, and obtain all configuration information required by the application host from the main configuration cluster, and save it locally.
另外,所述确定模块402还用于:在停止对所述主配置集群的监听步骤中,将所述主配置集群设定为不可用配置集群,并对其进行监测,若确定可正常通信,则设定其为可用配置集群。In addition, the determining module 402 is further configured to: in the step of stopping the monitoring of the main configuration cluster, set the main configuration cluster as an unavailable configuration cluster, and monitor it, and if it is determined that normal communication is possible, Set it as an available configuration cluster.
另外,所述确定模块402还用于:按照以下方式确定是否与所述主配置集群正常通信:监听接收所述主配置集群周期性发送的心跳消息;若接收周期异常,或无法接收到所述心跳消息,则确定与所述主配置集群无法正常通信。In addition, the determining module 402 is further configured to determine whether to communicate with the main configuration cluster normally in the following manner: monitor and receive the heartbeat messages periodically sent by the main configuration cluster; if the receiving cycle is abnormal, or cannot receive the Heartbeat message, it is determined that normal communication with the main configuration cluster is not possible.
另外,所述确定模块402具体用于:所述应用主机按照设定策略从所述可用的配置集群中重新确定出主配置集群;所述设定策略包括以下至少一项或多项的组合:所述重新确定出的配置集群与所述应用主机位于同一局域网;所述重新确定出的配置集群与所述应用主机之间的通信速率符合设定条件。In addition, the determining module 402 is specifically configured to: the application host re-determines the main configuration cluster from the available configuration clusters according to a set strategy; the set strategy includes at least one or a combination of the following: The re-determined configuration cluster and the application host are located in the same local area network; the communication rate between the re-determined configuration cluster and the application host meets a set condition.
另外,各所述配置集群以键值对方式存储所述应用主机的配置信息;所述监听模块401具体用于:以键值对的方式对本地的配置信息进行修改。In addition, each of the configuration clusters stores the configuration information of the application host in the form of key-value pairs; the monitoring module 401 is specifically configured to: modify the local configuration information in the form of key-value pairs.
另外,所述监听模块401还用于:获取与所述主配置集群对应的权限证书,并基于所述权限证书与所述主配置集群建立连接。In addition, the monitoring module 401 is further configured to obtain an authority certificate corresponding to the main configuration cluster, and establish a connection with the main configuration cluster based on the authority certificate.
本申请实施例提供一种计算机设备,包括程序或指令,当所述程序或指令被执行时,用以执行上述方法实施例所提供的配置信息管理方法中的任一种。The embodiment of the present application provides a computer device including a program or instruction, and when the program or instruction is executed, it is used to execute any one of the configuration information management methods provided in the foregoing method embodiments.
本申请实施例提供一种配置管理***,所述***包括:一个中心集群、至少一个边缘集群;所述中心集群接收到针对应用***的配置信息的更新指令;所述中心集群通过执行所述更新指令,来实现本地存储的所述应用***的配置信息的更新;所述中心集群将更新后的所述应用***的配置信息同步至所述至少一个边缘集群;所述中心集群和所述边缘集群发送针对所述应用***的配置 信息的更新消息,使得部署有所述应用***的应用主机可通过监听所述中心集群或所述边缘集群来接收所述更新消息,并基于所述更新消息中的配置更新来对本地配置信息进行修改。An embodiment of the present application provides a configuration management system, the system includes: a central cluster and at least one edge cluster; the central cluster receives an update instruction for the configuration information of an application system; the central cluster executes the update Instructions to update the locally stored configuration information of the application system; the central cluster synchronizes the updated configuration information of the application system to the at least one edge cluster; the central cluster and the edge cluster Send an update message for the configuration information of the application system, so that the application host deployed with the application system can receive the update message by monitoring the central cluster or the edge cluster, and based on the information in the update message Configuration update to modify local configuration information.
最后应说明的是:本领域内的技术人员应明白,本申请的实施例可提供为方法、***、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、光学存储器等)上实施的计算机程序产品的形式。Finally, it should be noted that those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program codes.
本申请是参照根据本申请的方法、设备(***)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。This application is described with reference to the flowcharts and/or block diagrams of the methods, equipment (systems), and computer program products according to the application. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the application without departing from the scope of the application. In this way, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.

Claims (17)

  1. 一种配置信息管理方法,所述方法应用于应用主机,包括:A configuration information management method, which is applied to an application host, includes:
    所述应用主机实时监听主配置集群以获取配置更新,并基于所述配置更新对本地的配置信息进行修改;The application host monitors the main configuration cluster in real time to obtain configuration updates, and modifies local configuration information based on the configuration updates;
    所述应用主机若确定无法与所述主配置集群正常通信,则停止对所述主配置集群的监听,同时从可用的配置集群中重新确定出主配置集群,并返回至所述监听步骤。If the application host determines that it cannot communicate with the main configuration cluster normally, it stops monitoring the main configuration cluster, and at the same time re-determines the main configuration cluster from the available configuration clusters, and returns to the monitoring step.
  2. 如权利要求1所述的方法,其中,所述应用主机实时监听主配置集群以获取配置更新包括:The method of claim 1, wherein the application host monitoring the main configuration cluster in real time to obtain configuration updates comprises:
    所述应用主机实时监听所述主配置集群发布的更新消息,并从收到的更新消息中获取配置更新,其中,所述更新消息为所述主配置集群确定自身管理的配置信息发生更新时发布的。The application host monitors the update message issued by the main configuration cluster in real time, and obtains configuration update from the received update message, where the update message is issued when the main configuration cluster determines that the configuration information managed by itself is updated of.
  3. 如权利要求1所述的方法,其中,所述应用主机本地的配置信息的获取方法包含:The method according to claim 1, wherein the method for obtaining local configuration information of the application host comprises:
    在所述监听之前,与所述主配置集群建立连接,并从所述主配置集群上获取所述应用主机所需的全量配置信息,保存在本地。Before the monitoring, establish a connection with the main configuration cluster, and obtain all configuration information required by the application host from the main configuration cluster, and save it locally.
  4. 如权利要求1所述的方法,其中,所述停止对所述主配置集群的监听步骤中包含,将所述主配置集群设定为不可用配置集群,并对其进行监测,若确定可正常通信,则设定其为可用配置集群。The method according to claim 1, wherein the step of stopping the monitoring of the main configuration cluster comprises setting the main configuration cluster as an unavailable configuration cluster, and monitoring it, if it is determined that it is normal Communication, set it as an available configuration cluster.
  5. 如权利要求1所述的方法,其中,所述应用主机确定是否与所述主配置集群正常通信的方法包括:The method according to claim 1, wherein the method for the application host to determine whether it normally communicates with the main configuration cluster comprises:
    监听接收所述主配置集群周期性发送的心跳消息;Monitor and receive heartbeat messages periodically sent by the main configuration cluster;
    若接收周期异常,或无法接收到所述心跳消息,则确定与所述主配置集群无法正常通信。If the receiving cycle is abnormal, or the heartbeat message cannot be received, it is determined that normal communication with the main configuration cluster is not possible.
  6. 如权利要求1所述的方法,其中,所述从所述应用主机的可用的配置集群中重新确定出主配置集群,包括:The method according to claim 1, wherein the re-determining the main configuration cluster from the available configuration clusters of the application host comprises:
    所述应用主机按照设定策略从所述可用的配置集群中重新确定出主配置集群;所述设定策略包括以下至少一项或多项的组合:The application host re-determines the main configuration cluster from the available configuration clusters according to a set strategy; the set strategy includes at least one or a combination of the following:
    所述重新确定出的主配置集群与所述应用主机位于同一局域网;The re-determined main configuration cluster and the application host are located in the same local area network;
    所述重新确定出的主配置集群与所述应用主机之间的通信速率符合设定条件。The newly determined communication rate between the main configuration cluster and the application host meets a set condition.
  7. 如权利要求1-6任一所述的方法,其中,各所述配置集群以键值对方式存储所述应用主机的配置信息;8. The method according to any one of claims 1 to 6, wherein each of the configuration clusters stores the configuration information of the application host in a key-value pair;
    所述应用主机对本地的配置信息进行修改,包括:The application host modifies local configuration information, including:
    所述应用主机以键值对的方式对本地的配置信息进行修改。The application host modifies the local configuration information in the form of key-value pairs.
  8. 如权利要求1或2所述的方法,其中,所述应用主机实时监听主配置集群之前,所述方法还包括:The method according to claim 1 or 2, wherein before the application host monitors the main configuration cluster in real time, the method further comprises:
    所述应用主机获取与所述主配置集群对应的权限证书,并基于所述权限证书与所述主配置集群建立连接。The application host obtains an authority certificate corresponding to the main configuration cluster, and establishes a connection with the main configuration cluster based on the authority certificate.
  9. 一种配置信息管理方法,应用于配置管理***,所述方法包括:A configuration information management method, applied to a configuration management system, the method including:
    所述中心集群接收到针对应用***的配置信息的更新指令;The central cluster receives an update instruction for the configuration information of the application system;
    所述中心集群通过执行所述更新指令,来实现本地存储的所述应用***的配置信息的更新;The central cluster implements the update of the locally stored configuration information of the application system by executing the update instruction;
    所述中心集群将更新后的所述应用***的配置信息同步至所述至少一个边缘集群;The central cluster synchronizes the updated configuration information of the application system to the at least one edge cluster;
    所述中心集群和所述边缘集群发送针对所述应用***的配置信息的更新消息,使得部署有所述应用***的应用主机可通过监听所述中心集群或所述边缘集群来接收所述更新消息,并基于所述更新消息中的配置更新来对本地配置信息进行修改。The central cluster and the edge cluster send update messages for the configuration information of the application system, so that the application host deployed with the application system can receive the update message by monitoring the central cluster or the edge cluster , And modify the local configuration information based on the configuration update in the update message.
  10. 如权利要求9所述的方法,其中,所述配置管理***还包含一应用配置接口,所述应用配置接口接收针对各应用***的配置信息的更新操作,并对应生成更新指令;所述中心集群接收到针对应用***的配置信息的更新指令, 包括:The method according to claim 9, wherein the configuration management system further comprises an application configuration interface, the application configuration interface receives an update operation for the configuration information of each application system, and correspondingly generates an update instruction; the central cluster The update instruction for the configuration information of the application system is received, including:
    所述中心集群从所述应用配置接口接收到针对应用***的配置信息的更新指令。The central cluster receives an update instruction for the configuration information of the application system from the application configuration interface.
  11. 如权利要求9所述的方法,其中,响应于所述应用主机的配置信息获取请求,所述中心集群或所述边缘集群基于所述获取请求从本地获取对应的配置信息,并发送至所述应用主机。The method according to claim 9, wherein, in response to the configuration information obtaining request of the application host, the central cluster or the edge cluster obtains corresponding configuration information locally based on the obtaining request, and sends it to the Application host.
  12. 如权利要求11所述的方法,其中,所述中心集群和所述边缘集群在向所述应用主机发送配置信息的同时,向所述应用主机颁发只读权限的证书;所述证书用于所述应用主机获取所需的配置信息。The method according to claim 11, wherein the central cluster and the edge clusters, while sending configuration information to the application host, issue a read-only certificate to the application host; the certificate is used for all The application host obtains the required configuration information.
  13. 如权利要求9所述的方法,其中,所述中心集群和所述边缘集群周期性发送心跳消息,应用主机通过监听所述心跳消息,确定与其连接的中心集群或边缘集群的通信状态。The method according to claim 9, wherein the central cluster and the edge cluster periodically send heartbeat messages, and the application host determines the communication status of the central cluster or the edge cluster connected to the central cluster and the edge cluster by monitoring the heartbeat message.
  14. 一种应用主机,包括:An application host including:
    监听模块,用于实时监听主配置集群以获取配置更新,并基于所述配置更新对本地的配置信息进行修改;The monitoring module is used to monitor the main configuration cluster in real time to obtain configuration updates, and modify local configuration information based on the configuration updates;
    确定模块,用于若确定无法与所述主配置集群正常通信,则停止对所述主配置集群的监听,同时从可用的配置集群中重新确定出主配置集群,并指示所述监听模块进行所述实时监听。The determining module is used to stop monitoring the main configuration cluster if it is determined that the main configuration cluster cannot be communicated normally, and at the same time re-determine the main configuration cluster from the available configuration clusters, and instruct the monitoring module to perform all Describes real-time monitoring.
  15. 如权利要求14所述的主机,其中,所述监听模块用于:The host according to claim 14, wherein the monitoring module is used for:
    实时监听所述主配置集群发布的更新消息,并从收到的更新消息中获取配置更新;所述更新消息为所述主配置集群确定自身管理的配置信息发生更新时发布的。Monitor the update message issued by the main configuration cluster in real time, and obtain configuration update from the received update message; the update message is issued when the main configuration cluster determines that the configuration information managed by itself is updated.
  16. 一种计算机设备,包括程序或指令,当所述程序或指令被执行时,如权利要求1至8或9至13中任意一项所述的方法被执行。A computer device comprising a program or instruction. When the program or instruction is executed, the method according to any one of claims 1 to 8 or 9 to 13 is executed.
  17. 一种配置管理***,所述***包括:一个中心集群、至少一个边缘集群;A configuration management system, the system comprising: a central cluster and at least one edge cluster;
    所述中心集群接收针对应用***的配置信息的更新指令,通过执行所述更新指令,来实现本地存储的所述应用***的配置信息的更新;并将更新后的所述应用***的配置信息同步至所述至少一个边缘集群;The central cluster receives an update instruction for the configuration information of the application system, and implements the update instruction to update the locally stored configuration information of the application system; and synchronizes the updated configuration information of the application system To the at least one edge cluster;
    所述中心集群和所述边缘集群发送针对所述应用***的配置信息的更新消息,使得部署有所述应用***的应用主机可通过监听所述中心集群或所述边缘集群来接收所述更新消息,并基于所述更新消息中的配置更新来对本地配置信息进行修改。The central cluster and the edge cluster send update messages for the configuration information of the application system, so that the application host deployed with the application system can receive the update message by monitoring the central cluster or the edge cluster , And modify the local configuration information based on the configuration update in the update message.
PCT/CN2019/126437 2019-10-17 2019-12-18 Method and device for managing configuration information WO2021072967A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910989465.7A CN110635953A (en) 2019-10-17 2019-10-17 Configuration information management method and device
CN201910989465.7 2019-10-17

Publications (1)

Publication Number Publication Date
WO2021072967A1 true WO2021072967A1 (en) 2021-04-22

Family

ID=68975306

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/126437 WO2021072967A1 (en) 2019-10-17 2019-12-18 Method and device for managing configuration information

Country Status (2)

Country Link
CN (1) CN110635953A (en)
WO (1) WO2021072967A1 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1874267A (en) * 2006-03-21 2006-12-06 华为技术有限公司 Method for ensuring accordant configuration information in cluster system
CN104092718A (en) * 2013-12-12 2014-10-08 腾讯数码(天津)有限公司 Distributed system and configuration information updating method in distributed system
CN104516966A (en) * 2014-12-24 2015-04-15 北京奇虎科技有限公司 High-availability solving method and device of database cluster
US20160352559A1 (en) * 2014-12-29 2016-12-01 Telefonaktiebolaget L M Ericsson (Publ) Method and Apparatus For Configuring a Communication System
CN106570007A (en) * 2015-10-09 2017-04-19 阿里巴巴集团控股有限公司 Method and equipment for data synchronization of distributed caching system
CN107404509A (en) * 2016-05-20 2017-11-28 北京融聚世界网络科技有限公司 Distributed Services configure system and approaches to IM
CN107769970A (en) * 2017-10-20 2018-03-06 北京集奥聚合科技有限公司 The processing method and system of configuration information in a kind of distributed system
CN109245908A (en) * 2017-07-10 2019-01-18 北京京东尚科信息技术有限公司 A kind of method and apparatus of principal and subordinate's cluster switching

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402441B (en) * 2010-09-16 2014-08-20 腾讯科技(深圳)有限公司 System and method for configuring multiple computers
CN103516538A (en) * 2012-06-28 2014-01-15 中兴通讯股份有限公司 Method and device for uniform configuration of carrier-class clustered applications
CN106357447A (en) * 2016-09-21 2017-01-25 努比亚技术有限公司 Synchronizing method and device for configuration data
US10666512B2 (en) * 2017-03-09 2020-05-26 Aerohive Networks, Inc. Current configuration state specific device configuration

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1874267A (en) * 2006-03-21 2006-12-06 华为技术有限公司 Method for ensuring accordant configuration information in cluster system
CN104092718A (en) * 2013-12-12 2014-10-08 腾讯数码(天津)有限公司 Distributed system and configuration information updating method in distributed system
CN104516966A (en) * 2014-12-24 2015-04-15 北京奇虎科技有限公司 High-availability solving method and device of database cluster
US20160352559A1 (en) * 2014-12-29 2016-12-01 Telefonaktiebolaget L M Ericsson (Publ) Method and Apparatus For Configuring a Communication System
CN106570007A (en) * 2015-10-09 2017-04-19 阿里巴巴集团控股有限公司 Method and equipment for data synchronization of distributed caching system
CN107404509A (en) * 2016-05-20 2017-11-28 北京融聚世界网络科技有限公司 Distributed Services configure system and approaches to IM
CN109245908A (en) * 2017-07-10 2019-01-18 北京京东尚科信息技术有限公司 A kind of method and apparatus of principal and subordinate's cluster switching
CN107769970A (en) * 2017-10-20 2018-03-06 北京集奥聚合科技有限公司 The processing method and system of configuration information in a kind of distributed system

Also Published As

Publication number Publication date
CN110635953A (en) 2019-12-31

Similar Documents

Publication Publication Date Title
CN112099918B (en) Live migration of clusters in a containerized environment
US11740975B2 (en) System and method for managing blockchain nodes
US11880679B2 (en) System and method for supporting patching in a multitenant application server environment
US11940965B2 (en) Data migration method and apparatus
US9817721B1 (en) High availability management techniques for cluster resources
CN108632067B (en) Disaster recovery deployment method, device and system
US20160283335A1 (en) Method and system for achieving a high availability and high performance database cluster
US10038593B2 (en) Method and system for recovering virtual network
US10430217B2 (en) High availability using dynamic quorum-based arbitration
WO2022037359A1 (en) Configuration data access method, apparatus, and device, configuration center, and storage medium
US10191958B1 (en) Storage provisioning in a data storage environment
CN108023939B (en) Method and system for processing lock server fault in distributed system
US11995100B2 (en) System and method for highly available database service
WO2023197874A1 (en) Application access method and apparatus, and device and medium
US20220326940A1 (en) Service Upgrade Method, Apparatus, and System
CN111158949A (en) Configuration method, switching method and device of disaster recovery architecture, equipment and storage medium
CN112000444B (en) Database transaction processing method and device, storage medium and electronic equipment
WO2021121067A1 (en) Task execution method and apparatus
WO2021072967A1 (en) Method and device for managing configuration information
US10001939B1 (en) Method and apparatus for highly available storage management using storage providers
CN113961398A (en) Business processing method, device, system, equipment, storage medium and product
KR102033489B1 (en) Method and server for managing server cluster
CN107783855B (en) Fault self-healing control device and method for virtual network element
US20080222374A1 (en) Computer system, management computer, storage system and volume management method
WO2023202049A1 (en) Disaster tolerance management method and disaster tolerance management device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19949196

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2019949196

Country of ref document: EP

Effective date: 20220323

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19949196

Country of ref document: EP

Kind code of ref document: A1