CN112118298A - Configuration management method and device for distributed service - Google Patents

Configuration management method and device for distributed service Download PDF

Info

Publication number
CN112118298A
CN112118298A CN202010918471.6A CN202010918471A CN112118298A CN 112118298 A CN112118298 A CN 112118298A CN 202010918471 A CN202010918471 A CN 202010918471A CN 112118298 A CN112118298 A CN 112118298A
Authority
CN
China
Prior art keywords
configuration
service
item
configuration item
items
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010918471.6A
Other languages
Chinese (zh)
Inventor
韩少凡
卢始亮
张坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202010918471.6A priority Critical patent/CN112118298A/en
Publication of CN112118298A publication Critical patent/CN112118298A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a configuration management method facing distributed services, which comprises the following steps: pulling all configuration items corresponding to the service components from the database; dividing all the configuration items into a plurality of configuration item sets according to a configuration space; and loading a plurality of configuration item sets to the corresponding service components. The invention also provides a configuration management device facing the distributed service, which comprises: the database is used for storing configuration items of all service components; the configuration item pulling module is in communication connection with the database; the configuration item pulling module is used for responding to an instruction of the service component for pulling the configuration items to pull the corresponding configuration items from the database, and dividing the configuration items into a plurality of configuration item sets according to the configuration space; the configuration item loading module is in communication connection with the configuration item pulling module; the configuration item loading module is used for loading a plurality of configuration item sets to the corresponding service components. The invention can reduce the dependency relationship among the service components and is convenient for the unified management of the distributed service.

Description

Configuration management method and device for distributed service
Technical Field
The present invention relates to the field of distributed service configuration management technologies, and in particular, to a configuration management method and apparatus for distributed services.
Background
Most components in a large data platform are distributed, updating and maintenance of configuration are extremely tedious and error-prone, configuration is carried out in the current mode of configuration files, each service component is provided with one configuration file, configuration dependence can be formed in the configuration mode, upper-layer components can depend on configuration of lower-layer components, the dependence mode comprises two modes of directly copying the configuration files and injecting configuration information into configuration files of the upper-layer components, and once the dependence relationship among the components is complex, slight change of configuration of the lower-layer components brings global change.
Disclosure of Invention
In view of the above problems, the configuration management method and apparatus for distributed services according to the present invention can reduce the dependency between service component configurations.
In a first aspect, the present invention provides a configuration management method for distributed services, including:
storing the configuration items in a database of a configuration center to form structured data;
pulling all configuration items corresponding to the service components from the database;
dividing all the configuration items into a plurality of configuration item sets according to a configuration space;
and loading the configuration item sets into the memory of the corresponding service component according to the service mapping.
Optionally, further comprising: and detecting the maintenance state of the configuration item, and when the maintenance state of the current configuration item is updated, reloading the updated configuration item to the service component according to the service component to which the configuration item belongs and the configuration space information.
Optionally, before loading the sets of configuration items to the corresponding service components, the method further includes:
loading a configuration template from a service template library according to the configuration space of the plurality of configuration item sets;
and filling the plurality of configuration item sets into the corresponding configuration templates to form configuration streams, wherein the configuration streams are stored in a memory so as to load the configuration item sets to the corresponding service components in a configuration stream form.
Optionally, the maintenance state of the configuration item is detected, when the maintenance state of the current configuration item is updated, the configuration flow needing to be updated is determined according to the service component information and the configuration space information to which the configuration item belongs, all the configuration items of the configuration flow needing to be updated are pulled, and the configuration flow is re-formed.
Optionally, the method further comprises: storing the configuration items in a database, and storing the configuration templates in a service template library in a configuration space information name mode.
Optionally, the maintenance state of the configuration item is detected, whether the configuration template is changed is determined according to the maintenance state of the configuration item, and when the configuration template is changed, the configuration item set corresponding to the configuration template is reloaded and the changed configuration item template is filled to form a configuration stream.
Optionally, the configuration item set is filled into the configuration template by a template engine to form a configuration stream.
Optionally, the method further comprises: when the starting server starts, all service components of the server are traversed, and all configuration items of each service component are output.
Optionally, the method further comprises: querying the global configuration according to the service ID and the role instance ID;
inquiring the configuration of the specified type according to the service ID and the type tag;
the localization configuration is queried according to the role instance ID.
In the configuration management method facing the distributed service, when the configuration information pulled by the service component is a configuration item, not a configuration file, each configuration item is a unique configuration item, when the service component needs to be started, all the configuration items of the service component are pulled, and the configuration items are injected into the service component for application. In the configuration mode, all the service components are directly applied to the configuration items, and the condition of mutual dependence among the service components can not occur when the configuration items are modified, so that the configuration of the large data platform components is thoroughly decoupled, the configuration change does not need to apply sensing actions, the robustness of capacity expansion and upgrading is enhanced, the temporary and malicious change is prevented, and all the change records can be continuously maintained. And the large data platform product configuration is managed in a unified way, and a more powerful and convenient access mode is provided.
In a second aspect, the present invention provides a configuration management apparatus for distributed services, including:
the configuration center database is used for storing configuration items of all the service components as structured data;
the configuration item pulling module is in communication connection with the database; the configuration item pulling module is used for responding to an instruction of pulling the configuration items of the service assembly so as to pull the corresponding configuration items from the database, and dividing the configuration items into a plurality of configuration item sets according to a configuration space;
the configuration item loading module is in communication connection with the configuration item pulling module; the configuration item loading module is used for loading the configuration item sets into the memory of the corresponding service component according to the service mapping.
Optionally, the method further comprises:
the service template library is used for storing configuration templates named by the configuration space;
and the template engine is in communication connection with the configuration template and is used for selecting the configuration template from the service template library according to the configuration space and filling the configuration template with the plurality of configuration item sets to form a configuration stream, and the configuration stream is stored in the memory.
Optionally, the system further comprises a configuration item updating module, which is in communication connection with the database, the configuration item pulling module and the configuration item loading module; the configuration item updating module is used for updating the configuration item, and when the configuration item is updated, the configuration item updating module pushes the updated configuration item to the configuration item loading module or pushes the maintenance state of the configuration item to the configuration item pulling module.
Optionally, the configuration system further includes a configuration template updating module, the configuration template updating module is in communication connection with the configuration item updating module, the configuration template updating module is configured to receive a maintenance state of a configuration item of the configuration item updating module and determine whether to change the configuration template according to the maintenance state of the configuration item, when the configuration template is changed, the updated configuration template is stored in the service template library, and the template engine is controlled to fill the configuration item set into the updated configuration template to form a configuration flow.
Optionally, the server further comprises a service component traversing module, configured to traverse all service components of the server when the server is started, and query configuration items required by each service component.
In the configuration management device for the distributed service, all configuration items are stored in a database instead of configuration files, each configuration item is a unique configuration item, when a service component needs to be started, all configuration items of the service component are pulled, and the configuration items are injected into the service component for application. In the configuration mode, all the service components are directly applied to the configuration items, and the condition of mutual dependence among the service components can not occur when the configuration items are modified, so that the configuration of the large data platform components is thoroughly decoupled, the configuration change does not need to apply sensing actions, the robustness of capacity expansion and upgrading is enhanced, the temporary and malicious change is prevented, and all the change records can be continuously maintained. And the large data platform product configuration is managed in a unified way, and a more powerful and convenient access mode is provided.
Drawings
Fig. 1 is a flowchart of a configuration management method for distributed services according to an embodiment of the present invention;
FIG. 2 is a relational block diagram of services, role instances, configuration items, configuration spaces, and configuration flows, according to an embodiment of the invention;
fig. 3 is a flowchart of a configuration management method for distributed services according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the present invention, the main terms involved are specifically explained as follows:
service: representing a process or group of processes in a software system that can independently provide a service.
Role instance: representing one of a group of service processes.
Configuration item (ConfigItem): representing one configuration parameter of the service. The composition fields are as follows:
Figure BDA0002665495430000051
configuration space: a certain set of configurations in which the configuration items are located. Embodied as a certain profile of a certain service
Configuration template (fileTemplate): and filling configuration items contained in the configuration space based on the floor file template corresponding to the configuration space, namely the format template of the service configuration file, into the configuration file.
Configuration stream (ConfigStream): the stream form of the configuration file is stored in the memory, and is convenient to be provided for JVM loading. The composition is as follows:
Figure BDA0002665495430000052
Figure BDA0002665495430000061
example 1
As shown in fig. 1, the present embodiment provides a configuration management method for distributed services, including:
after the installation of the service components is completed, the total number of the configuration items is limited, and taking 1 service corresponding to 50 configuration items and 20 services in the platform as an example, the total number of the configuration items is 1000, and the configuration items are stored in a table. All configuration items of all services in the platform are stored in the database, so that the services are prevented from being lost due to unexpected downtime, hackers or malicious tampering of viruses, and can only be modified through the configuration management services. The concrete configuration steps are as follows:
and S1, storing the configuration items in a database to form structured data. In the prior art, a mode of writing the configuration of each service into one configuration file is generally adopted, that is, how many services correspond to how many configuration files. In the step, the step of forming the structured data means that the configuration items of all the services are stored into the database in a structured manner, and a configuration file is not formed. As an optional implementation manner, the configuration template may also be stored in a service template library in a configuration space information name.
S2, pulling all configuration items corresponding to the service components from the database; as an optional manner of this embodiment, when the server is started, all service components of the server are traversed and all configuration items of each service component are output.
S3, dividing all the configuration items into a plurality of configuration item sets according to a configuration space; because the configuration templates are in one-to-one correspondence with the configuration spaces, the configuration item set is divided according to the configuration spaces, and the subsequent filling of the configuration item set into the configuration templates to form the stream files is facilitated.
S4, loading a configuration template from a service template library according to the configuration space of the configuration item sets;
s5, filling the configuration item sets into the corresponding configuration templates to form configuration streams, wherein the configuration streams are stored in a memory; as an optional implementation manner of this embodiment, the configuration item set is filled into the configuration template by a template engine, such as, for example, volume, FreeMarker, to form a configuration stream. The configuration flow is stored in a memory after the management service is started, and the storage form is as follows: map < String, List < ConfigStream > > (service ID with all configuration streams for the service)
S6, the service component loads the configuration flow; thus, the service component loads the configuration item sets to the corresponding service components in a configuration flow mode.
Taking fig. 2 as an example, the local configuration of the example 1, the local configuration of the example 2, the global configuration of the service 1, the global configuration of the service 2, and the global configuration of the service 3 are all configuration items, and are stored in the database, and the specific implementation process of this embodiment is as follows: and traversing the server, inquiring configuration items required to be applied by a certain service, finding out that the configuration items required to be applied by the service are instance 1 localization configuration, instance 2 localization configuration, service global configuration 1, service global configuration 2 and service global configuration 3, and at the moment, pulling all the configuration items. Upon query, the instance 1 local configuration, the service global configuration 1 and the service global configuration 2 belong to the configuration space 1, and the instance 2 local configuration and the service global configuration 3 belong to the configuration space 2, so that the configuration items are divided into two sets according to the configuration space. According to the information of the two configuration spaces, selecting a configuration template with a name corresponding to the two configuration spaces from a service template library, injecting the two configuration item sets into the corresponding configuration templates through a template engine respectively, forming a configuration stream 1 and a configuration stream 2, and storing the configuration streams in a memory. At this time, the configuration operation of the service can be completed by loading the configuration flow 1 and the configuration flow 2.
By adopting the steps, the configuration operation of the service components in the server can be completed. In the configuration management method for distributed services in this embodiment, when configuration information pulled by a service component is a configuration item, rather than a configuration file, each configuration item is a unique configuration item, and when the service component needs to be started, all configuration items of the service component are pulled, and the configuration items are injected into the service component for application. In the configuration mode, all the service components are directly applied to the configuration items, and the condition of mutual dependence among the service components can not occur when the configuration items are modified, so that the configuration of the large data platform components is thoroughly decoupled, the configuration change does not need to apply sensing actions, the robustness of capacity expansion and upgrading is enhanced, the temporary and malicious change is prevented, and all the change records can be continuously maintained. And the large data platform product configuration is managed in a unified way, and a more powerful and convenient access mode is provided.
The above section describes the procedure of initial configuration operation, and during the operation of the service component, the situation of needing to update the configuration is inevitably encountered, and the situation of updating the configuration is as follows:
as an optional implementation manner of this embodiment, the maintenance state of the configuration item is detected, when the maintenance state of the current configuration item is updated, the configuration flow that needs to be updated is determined according to the service component information and the configuration space information to which the configuration item belongs, and all configuration items of the configuration flow that needs to be updated are pulled and a configuration flow is newly formed.
The maintenance of the configuration items mainly comprises the following modes:
and (3) configuration query:
Figure BDA0002665495430000081
configuration updating:
Figure BDA0002665495430000082
addition and deletion:
Figure BDA0002665495430000083
Figure BDA0002665495430000091
in this embodiment, when a configuration item is updated, a configuration flow to which the configuration item belongs can be directly determined according to service component information and configuration space information, at this time, all configuration items of the configuration flow are queried, all configuration items corresponding to the configuration flow are pulled again and injected into a corresponding configuration template, so that a new configuration flow can be formed, and the service component reloads the new configuration flow, so that maintenance of the configuration item can be completed. Because the configuration item is unique and the configuration flow corresponding to the configuration item is also unique, errors cannot be generated due to dependency relationships when the configuration item is updated.
As an optional implementation manner of this embodiment, the maintenance state of the configuration item is detected, whether the configuration template is changed is determined according to the maintenance state of the configuration item, and when the configuration template is changed, the configuration item set corresponding to the configuration template is reloaded and the changed configuration item template is filled to form a configuration stream. When the configuration item is updated, because the format of the updated configuration item is different from that of the configuration item before updating, when the configuration item is updated, the problem of changing the configuration template should be concerned, when the format of the updated configuration item is the same as that of the configuration item before updating, the original configuration template can be adopted, when the format of the updated configuration item is different from that of the configuration item before updating, the configuration template needs to be updated, and a corresponding configuration item set is injected into the updated configuration template to form a configuration stream.
Example 2
As shown in fig. 3, this embodiment provides a configuration management method for distributed services, and the main difference from embodiment 1 is that configuration items in this embodiment do not need to fill an entry configuration template to form a stream file, but are directly loaded into a service component to complete configuration of the service component.
The embodiment comprises the following steps:
after the installation of the service components is completed, the total number of configuration items is limited, for example, 50 configuration items are served for 1 service, and 20 services in the platform are served, and the total number of configuration items is 1000, which are stored in a table. All configuration items of all services in the platform are stored in the database, so that the services are prevented from being lost due to unexpected downtime, hackers or malicious tampering of viruses, and can only be modified through the configuration management services. The method specifically comprises the following steps:
and S1, storing the configuration items in a database to form structured data. In the prior art, a mode of writing the configuration of each service into one configuration file is generally adopted, that is, how many services correspond to how many configuration files. In the step, the step of forming the structured data means that the configuration items of all the services are stored into the database in a structured manner, and a configuration file is not formed. As an optional implementation manner, the configuration template may also be stored in a service template library in a configuration space information name.
S2, pulling all configuration items corresponding to the service components from the database; as an optional implementation manner of this embodiment, when the server is started, all service components of the server may be traversed and all configuration items of each service component may be output.
S3, dividing all the configuration items into a plurality of configuration item sets according to a configuration space; because the configuration templates and the configuration spaces are in one-to-one correspondence, the configuration item set is divided according to the configuration spaces, and the configuration items are favorably loaded to the corresponding service components in the subsequent step.
S4, loading the configuration item sets into the memory of the corresponding service components according to the service mapping.
In embodiment 1, considering a situation that a current service component mainly completes a configuration operation by loading a configuration file, a configuration stream is generated as the configuration file, so as to ensure good operation under a current program writing habit, however, the configuration stream in embodiment 1 is essentially different from the configuration file in the prior art, and the difference is explained in embodiment 1, and is not described again here. In the embodiment, the process of forming the configuration flow is reduced, the loading time can be reduced, and the dependency relationship among the service components can be further reduced. Meanwhile, the embodiment also has the advantages of the technical scheme in the embodiment 1.
Of course, the configuration management method for distributed services in this embodiment also involves the problem of configuration item maintenance, and specifically, the following optional implementation may be adopted: and detecting the maintenance state of the configuration item, and reloading the updated configuration item to the service component according to the service component and the configuration space information to which the configuration item belongs. In this embodiment, since the service component directly loads the configuration item instead of the configuration stream, the maintenance of the configuration item is more convenient and faster than the maintenance of the configuration item in embodiment 1, and the service component can directly reload the changed configuration item without pulling the whole configuration item set again to form the configuration stream.
Example 3
The present embodiment provides a configuration management device for distributed services, and the configuration management device for distributed services in the present embodiment is mainly used to complete the configuration management method for distributed services in embodiment 1.
The embodiment comprises the following steps:
the configuration center database is used for storing configuration items of all the service components as structured data; in the prior art, a mode of writing the configuration of each service into one configuration file is generally adopted, that is, how many services correspond to how many configuration files. In the step, the step of forming the structured data means that the configuration items of all the services are stored into the database in a structured manner, and a configuration file is not formed. As an optional implementation manner, the configuration template may also be stored in a service template library in a configuration space information name. Still taking 1000 configuration items in embodiment 1 as an example, the database stores the above 1000 configuration items. As an optional implementation manner of this embodiment, the system further includes a service component traversing module, configured to traverse all service components of the server when the server is started, and query configuration items required by each service component. When the server is started, all service components of the server are traversed, and therefore the configuration item corresponding to each service is inquired out so as to be pulled.
The configuration item pulling module is in communication connection with the database; the configuration item pulling module is used for responding to an instruction of the service component for pulling the configuration items to pull the corresponding configuration items from the database, and dividing the configuration items into a plurality of configuration item sets according to a configuration space; and after the configuration item pulling module obtains all the configuration items needing to be pulled, starting to execute the operation of pulling the configuration items.
The configuration item loading module is in communication connection with the configuration item pulling module; the configuration item loading module is used for loading the configuration item sets into the memory of the corresponding service component according to the service mapping. After the configuration item pulling module pulls the configuration item, the configuration item loading module loads the configuration item to the corresponding service according to the information of the configuration space field, and at this time, the configuration operation of the service component can be completed.
As an optional implementation manner of this embodiment, the configuration item loading module may load the configuration item set to the service component in a configuration stream loading manner, and therefore, may further include:
the service template library is used for storing configuration templates named by the configuration space; the configuration template is mainly used for defining the format of the configuration stream file, and does not provide content, and the content of the configuration template is filled with the configuration items pulled by the configuration item pulling module.
And the template engine is in communication connection with the configuration template and is used for selecting the configuration template from the service template library according to the configuration space and filling the configuration template with the plurality of configuration item sets to form a configuration stream, and the configuration stream is stored in the memory. Since the configuration template only provides the format and not the content, the template engine is required to fill the configuration item content into the configuration template, and in this embodiment, the configuration item set can be filled into the corresponding configuration item template through the choice or Freemarker engine. As an alternative embodiment, the configuration template is named with configuration space information. In the above, the division of the configuration item set is divided according to the configuration space, so that the configuration template can be queried more simply and clearly by naming the configuration space information.
In the configuration management device for distributed services in this embodiment, all configuration items are stored in a database instead of a configuration file, the storage locations of the configuration items are not local but in the database, each configuration item is a unique configuration item, and when a service component needs to be started, all configuration items of the service component are pulled, and the configuration items are injected into the service component for application. In the configuration mode, all the service components are directly applied to the configuration items, and the condition of mutual dependence among the service components can not occur when the configuration items are modified, so that the configuration of the large data platform components is thoroughly decoupled, the configuration change does not need to apply sensing actions, the robustness of capacity expansion and upgrading is enhanced, the temporary and malicious change is prevented, and all the change records can be continuously maintained. And the large data platform product configuration is managed in a unified way, and a more powerful and convenient access mode is provided.
In the above configuration management device for distributed services, although the configuration process of the service component can be completed, the service component inevitably encounters a situation that the configuration item needs to be maintained in the use process, and therefore, a module capable of maintaining the configuration item is also needed:
as an optional implementation manner of this embodiment, the system further includes a configuration item updating module, which is in communication connection with the database, the configuration item pulling module, and the configuration item loading module; the configuration item updating module is used for updating the configuration item, and when the configuration item is updated, the configuration item updating module pushes the updated configuration item to the configuration item loading module or pushes the maintenance state of the configuration item to the configuration item pulling module. After the configuration item is updated, the configuration item updating module can directly push the maintenance state of the configuration item to the configuration item pulling module, the configuration item pulling module judges the configuration stream corresponding to the configuration item according to the service information and the configuration space information of the configuration item, pulls all the configuration item information corresponding to the configuration stream again, the template engine fills the configuration item information which is pulled again into the configuration template to form the configuration stream, and the configuration item loading module loads the configuration stream to the corresponding service; or the updated configuration items can be directly pushed to the configuration item loading module through the configuration item updating module, the configuration item loading module replaces the corresponding configuration items in the original configuration stream with the updated configuration items, the configuration engine refills the replaced configuration items and the configuration items which are not updated into the configuration template to form the configuration stream, and the configuration stream is loaded to the corresponding service component through the configuration item loading module.
When a configuration item is maintained, if the configuration item is changed to be in a different format from an original configuration item, the configuration template needs to be updated, and therefore, as an optional implementation manner of this embodiment, the configuration template updating module further includes a configuration template updating module, the configuration template updating module is in communication connection with the configuration item updating module, the configuration template updating module is configured to receive a maintenance state of the configuration item updating module and determine whether to change the configuration template according to the maintenance state of the configuration item, when the configuration template is changed, the updated configuration template is stored in the service template library, and the template engine is controlled to fill the configuration item set into the updated configuration template to form a configuration stream. By adopting the mode, if the format of the maintained configuration item is different from that of the original configuration item, the configuration flow is formed by using the new configuration template after the configuration template is replaced, and if the format of the maintained configuration item is the same as that of the original configuration item, the configuration flow can be formed by using the original configuration template.
Example 4
The present embodiment provides a configuration management device for distributed services, and the configuration management device for distributed services in the present embodiment is mainly used to complete the configuration management method for distributed services in embodiment 2.
The embodiment comprises the following steps:
the configuration center database is used for storing configuration items of all the service components as structured data; still taking 1000 configuration items in embodiment 1 as an example, the database stores the above 1000 configuration items. As an optional implementation manner of this embodiment, the system further includes a service component traversing module, configured to traverse all service components of the server when the server is started, and query configuration items required by each service component. When the server is started, all service components of the server are traversed, and therefore the configuration item corresponding to each service is inquired out so as to be pulled.
The configuration item pulling module is in communication connection with the database; the configuration item pulling module is used for responding to an instruction of the service component for pulling the configuration items to pull the corresponding configuration items from the database, and dividing the configuration items into a plurality of configuration item sets according to a configuration space; and after the configuration item pulling module obtains all the configuration items needing to be pulled, starting to execute the operation of pulling the configuration items.
The configuration item loading module is in communication connection with the configuration item pulling module; the configuration item loading module is used for loading the configuration item sets into the memory of the corresponding service component according to the service mapping. After the configuration item pulling module pulls the configuration item, the configuration item loading module loads the configuration item to the corresponding service according to the information of the configuration space field, and at this time, the configuration operation of the service component can be completed.
The difference between this embodiment and embodiment 3 is that this embodiment does not have a service template library and a template engine, and the configuration items in this embodiment are directly loaded into the service components without forming a configuration stream file. Embodiment 3 mainly considers that configuration processes in the prior art are all performed by loading a configuration file, and therefore, a manner of loading a configuration stream is used instead of a manner of loading a configuration file, but the configuration stream is a completely different file from a conventional configuration file, and specific differences thereof are described in detail in embodiment 1 and are not described herein again. The difference between this embodiment and embodiment 3 is mainly that the configuration of the service component is completed by directly loading the configuration items to the service component, and this loading manner is faster because configuration streams do not need to be generated, and in addition, because the configuration items are directly loaded in this embodiment, a single configuration item can be reloaded during the maintenance process without loading other configuration items, the maintenance process is simpler, and the degree of dependency between them is lower.
In the configuration management device for distributed services in this embodiment, all configuration items are stored in a database instead of a configuration file, the storage locations of the configuration items are not local but in the database, each configuration item is a unique configuration item, and when a service component needs to be started, all configuration items of the service component are pulled, and the configuration items are injected into the service component for application. In the configuration mode, all the service components are directly applied to the configuration items, and the condition of mutual dependence among the service components can not occur when the configuration items are modified, so that the configuration of the large data platform components is thoroughly decoupled, the configuration change does not need to apply sensing actions, the robustness of capacity expansion and upgrading is enhanced, the temporary and malicious change is prevented, and all the change records can be continuously maintained. And the large data platform product configuration is managed in a unified way, and a more powerful and convenient access mode is provided.
In the above configuration management device for distributed services, although the configuration process of the service component can be completed, the service component inevitably encounters a situation that the configuration item needs to be maintained in the use process, and therefore, a module capable of maintaining the configuration item is also needed:
as an optional implementation manner of this embodiment, the system further includes a configuration item updating module, which is in communication connection with the database, the configuration item pulling module, and the configuration item loading module; the configuration item updating module is used for updating the configuration item, and when the configuration item is updated, the configuration item updating module pushes the updated configuration item to the configuration item loading module or pushes the maintenance state of the configuration item to the configuration item pulling module. After the configuration item is updated, the configuration item updating module can directly push the maintenance state of the configuration item to the configuration item pulling module, the configuration item pulling module judges the service corresponding to the configuration item according to the service information and the configuration space information of the configuration item, pulls all the configuration item information corresponding to the configuration flow again, and the configuration item loading module loads the configuration item to the corresponding service; or the configuration item updating module can directly push the updated configuration item to the configuration item loading module, and the configuration item loading module directly reloads the updated configuration item.
It will be understood by those skilled in the art that all or part of the processes of the embodiments of the methods described above may be implemented by a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A configuration management method for a service cluster is characterized in that: the method comprises the following steps:
storing the configuration items in a database of a configuration center to form structured data;
pulling all configuration items corresponding to the service components from the database;
dividing all the configuration items into a plurality of configuration item sets according to a configuration space;
and loading the configuration item sets into the memory of the corresponding service component according to the service mapping.
2. The method for configuration management of a service cluster of claim 1, wherein: further comprising: and detecting the maintenance state of the configuration item, and when the maintenance state of the current configuration item is updated, reloading the updated configuration item to the service component according to the service component to which the configuration item belongs and the configuration space information.
3. The method for configuration management of a service cluster of claim 1, wherein: before loading the configuration item sets to the corresponding service components, the method further comprises the following steps:
loading a configuration template from a service template library according to the configuration space of the plurality of configuration item sets;
and filling the plurality of configuration item sets into the corresponding configuration templates to form configuration streams, wherein the configuration streams are stored in a memory so as to load the configuration item sets to the corresponding service components in a configuration stream form.
4. A method for configuration management of a service cluster according to claim 3, characterized by: and detecting the maintenance state of the configuration item, determining a configuration flow needing to be updated according to the service component information and the configuration space information which the configuration item belongs to when the maintenance state of the current configuration item is updated, pulling all the configuration items of the configuration flow needing to be updated, and reforming the configuration flow.
5. A method for configuration management of a service cluster according to claim 3, characterized by: further comprising: and storing the configuration template in a service template library in a configuration space information name mode.
6. The method for configuration management of a service cluster of claim 5, wherein: detecting the maintenance state of the configuration item, judging whether to change the configuration template according to the maintenance state of the configuration item, reloading the configuration item set corresponding to the configuration template when changing the configuration template, and filling the changed configuration item template to form a configuration flow.
7. A method for configuration management of a service cluster according to claim 3, characterized by: and filling the configuration item set into the configuration template through the template engine to form a configuration flow.
8. The method for configuration management of a service cluster of claim 1, wherein: further comprising: when the starting server starts, all service components of the server are traversed, and all configuration items of each service component are output.
9. The method for configuration management of a service cluster of claim 1, wherein: further comprising: querying the global configuration according to the service ID and the role instance ID;
inquiring the configuration of the specified type according to the service ID and the type tag;
the localization configuration is queried according to the role instance ID.
10. A distributed service oriented configuration management apparatus, characterized in that: the method comprises the following steps:
the configuration center database is used for storing configuration items of all the service components as structured data;
the configuration item pulling module is in communication connection with the database; the configuration item pulling module is used for responding to an instruction of pulling the configuration items of the service assembly so as to pull the corresponding configuration items from the database, and dividing the configuration items into a plurality of configuration item sets according to a configuration space;
the configuration item loading module is in communication connection with the configuration item pulling module; the configuration item loading module is used for loading the configuration item sets into the memory of the corresponding service component according to the service mapping.
CN202010918471.6A 2020-09-03 2020-09-03 Configuration management method and device for distributed service Pending CN112118298A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010918471.6A CN112118298A (en) 2020-09-03 2020-09-03 Configuration management method and device for distributed service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010918471.6A CN112118298A (en) 2020-09-03 2020-09-03 Configuration management method and device for distributed service

Publications (1)

Publication Number Publication Date
CN112118298A true CN112118298A (en) 2020-12-22

Family

ID=73801734

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010918471.6A Pending CN112118298A (en) 2020-09-03 2020-09-03 Configuration management method and device for distributed service

Country Status (1)

Country Link
CN (1) CN112118298A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113836372A (en) * 2021-08-26 2021-12-24 北京臻观数智科技有限公司 Configuration center data visualization method and system based on distributed service

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080005143A1 (en) * 2006-06-30 2008-01-03 International Business Machines Corporation Methods and apparatus for automatically creating composite configuration items in configuration management database
CN105138343A (en) * 2015-10-10 2015-12-09 携程计算机技术(上海)有限公司 Management service configuration method and system
CN107807931A (en) * 2016-09-09 2018-03-16 北京京东尚科信息技术有限公司 The method and system of Template Information management
CN108197139A (en) * 2017-11-22 2018-06-22 链家网(北京)科技有限公司 A kind of processing method and terminal of synchronized update configuration item
CN109660377A (en) * 2017-10-12 2019-04-19 中兴通讯股份有限公司 Unified configuring management method, service server and operation and maintenance management platform
CN110719187A (en) * 2018-07-13 2020-01-21 深圳兆日科技股份有限公司 Configuration management method, system and computer readable storage medium
CN110955460A (en) * 2019-11-15 2020-04-03 北京金山云网络技术有限公司 Service process starting method and device, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080005143A1 (en) * 2006-06-30 2008-01-03 International Business Machines Corporation Methods and apparatus for automatically creating composite configuration items in configuration management database
CN105138343A (en) * 2015-10-10 2015-12-09 携程计算机技术(上海)有限公司 Management service configuration method and system
CN107807931A (en) * 2016-09-09 2018-03-16 北京京东尚科信息技术有限公司 The method and system of Template Information management
CN109660377A (en) * 2017-10-12 2019-04-19 中兴通讯股份有限公司 Unified configuring management method, service server and operation and maintenance management platform
CN108197139A (en) * 2017-11-22 2018-06-22 链家网(北京)科技有限公司 A kind of processing method and terminal of synchronized update configuration item
CN110719187A (en) * 2018-07-13 2020-01-21 深圳兆日科技股份有限公司 Configuration management method, system and computer readable storage medium
CN110955460A (en) * 2019-11-15 2020-04-03 北京金山云网络技术有限公司 Service process starting method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113836372A (en) * 2021-08-26 2021-12-24 北京臻观数智科技有限公司 Configuration center data visualization method and system based on distributed service

Similar Documents

Publication Publication Date Title
US7930100B2 (en) Computer readable medium storing a map data updating program and map data updating terminal
US6915340B2 (en) System and method for deriving future network configuration data from the current and previous network configuration data
US7730097B2 (en) Smart database
US6523036B1 (en) Internet database system
US8050663B2 (en) System and method of providing contents for mobile communication terminal
CN101730099B (en) Terminal management method based on authority control and device
US20130066883A1 (en) Data management apparatus and system
US7020659B2 (en) System and method for managing bi-directional relationships between objects
CN106326239A (en) Distributed file system and file meta-information management method thereof
US10248686B2 (en) Shared data with relationship information
CN112685091A (en) Service request processing method, device, equipment and medium based on big data
CN112118298A (en) Configuration management method and device for distributed service
CN110765073B (en) File management method, medium, device and apparatus for distributed storage system
CN114691625B (en) Data management method for mass dynamic files
EP1569132B1 (en) Computer system and method of performing a database access
CN113641686B (en) Data processing method, data processing apparatus, electronic device, storage medium, and program product
EP3995972A1 (en) Metadata processing method and apparatus, and computer-readable storage medium
CN110928860B (en) Data migration method and device
CN116762057A (en) Automated platform for managing, deploying and orchestrating highly distributed service applications
CN112132533B (en) Method for searching dependence of custom development content
JP6070008B2 (en) Map data distribution device
CN112905564B (en) Atlas-based method and device for managing metadata of Oracle database
CN117112654B (en) City data display method, device, computer equipment and storage medium
CN116700902B (en) Container acceleration deployment method and device for asynchronous parallel extraction of mirror image layer
CN117234542A (en) Mirror image file processing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination