CN111277432B - Configuration information updating method and device, electronic equipment and storage medium - Google Patents
Configuration information updating method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111277432B CN111277432B CN202010027431.2A CN202010027431A CN111277432B CN 111277432 B CN111277432 B CN 111277432B CN 202010027431 A CN202010027431 A CN 202010027431A CN 111277432 B CN111277432 B CN 111277432B
- Authority
- CN
- China
- Prior art keywords
- configuration
- configuration information
- item
- configuration item
- node
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0813—Configuration setting characterised by the conditions triggering a change of settings
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45595—Network integration; Enabling network access in virtual machine instances
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Radiation-Therapy Devices (AREA)
Abstract
The embodiment of the application provides a configuration information updating method, a device, electronic equipment and a storage medium, and relates to the technical field of information processing. The method comprises the following steps: acquiring a configuration update request; analyzing the configuration update request to obtain update configuration information, wherein the update configuration information comprises the identification of each target configuration item to be updated and new configuration information of each target configuration item; determining configuration information modification functions corresponding to the target configuration items respectively; and updating the current configuration information of each target configuration item into new configuration information by calling back the configuration information modification function corresponding to each target configuration item. According to the technical scheme, when the configuration of the neutron service component is updated, the neutron service component does not need to be restarted, the problem of network paralysis of the virtual machine caused by restarting is avoided, normal operation of the neutron service component is not affected, and stability of a system is improved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, an electronic device, and a storage medium for updating configuration information.
Background
With the development of cloud computing, a large number of enterprises plan or are using cloud computing, and cloud computing models include public clouds and private clouds. Public clouds generally refer to clouds that third party provider users can use, and public clouds are generally available over the Internet, and may be free or low cost. Private clouds are built for a single customer use, providing the most effective control of data security and quality of service.
Network resources, such as virtual network cards, virtual routers, virtual firewalls, virtual switches, etc., are indispensable in both private and public cloud environments, and the implementation of these network resource functions depends on network flow tables that provide a basis for forwarding data, and the neutron service in Openstack also depends on the network flow tables. The network flow table may be lost or abnormal, which may cause the malfunction of the virtual machine network communication function. If the online neutral service needs to update the adjustment configuration, the service is restarted after the configuration file is required to be modified, and the neutral restart service can trigger the emptying and reconstruction of the network flow table, which may cause network paralysis of the virtual machine in some large-scale cloud environments and bring great influence to user service.
Disclosure of Invention
The application provides a configuration information updating method, a device, electronic equipment and a storage medium, which can solve the problems in the prior art.
The specific technical scheme provided by the embodiment of the application is as follows:
in a first aspect, an embodiment of the present application provides a method for updating configuration information, where the method includes:
acquiring a configuration update request;
analyzing the configuration update request to obtain update configuration information, wherein the update configuration information comprises the identification of each target configuration item to be updated and new configuration information of each target configuration item;
determining configuration information modification functions corresponding to the target configuration items respectively;
and updating the current configuration information of each target configuration item into new configuration information by calling back the configuration information modification function corresponding to each target configuration item.
In one possible implementation manner, the execution body of the method is a neutron proxy node, and the configuration update request is obtained, which includes at least one of the following:
receiving a configuration updating request sent by a neutron control node, wherein the configuration updating request is determined by the neutron control node through a received first representation state transformation restful request;
the configuration update request is obtained by monitoring the first Unix socket file.
In one possible implementation, the method further includes:
and receiving a first command line CLI configuration update request, and writing the received configuration update request into a first Unix socket file.
In one possible implementation, the neutron proxy node comprises a proxy node of a neutron control node or a proxy node of a neutron computing node.
In one possible implementation manner, the first restful request carries a node identifier of a neutron proxy node, and the configuration update request is determined by a neutron control node through the following modes:
receiving a first Restful request;
and analyzing the first Restful request, and obtaining each node identifier and a configuration update request corresponding to each node identifier based on an analysis result.
In one possible implementation manner, the execution body of the method is a neutron control node, and acquiring the configuration update request includes at least one of the following:
receiving a second Restful request, and obtaining a configuration update request based on the second Restful request;
the configuration update request is obtained by monitoring the second Unix socket file.
In one possible implementation, the method further includes:
and receiving a second CLI configuration update request, and writing the received configuration update request into a second Unix socket file.
In one possible implementation manner, the second Restful request carries a node identifier of the neutron control node, and the obtaining a configuration update request based on the second Restful request includes:
analyzing the second Restful request, and obtaining each node identifier and a configuration update request corresponding to each node identifier based on an analysis result;
and determining a configuration update request corresponding to the node identifier of the neutron control node in the node identifiers as the configuration update request.
In one possible implementation, before obtaining the configuration update request, the method further includes:
receiving a configuration item setting request, wherein the configuration item setting request comprises the identification of each updatable configuration item and the configuration information modification function corresponding to each updatable configuration item;
according to the configuration item setting request, establishing and storing the identification of each updatable configuration item and the mapping relation between the configuration information modification functions corresponding to each updatable configuration item;
determining configuration information modification functions corresponding to each target configuration item, including:
and determining configuration information modification functions corresponding to the target configuration items respectively based on the mapping relation and the identification of the target configuration items.
In one possible implementation, after receiving the configuration item setting request, the method further includes:
acquiring current configuration information of each corresponding updatable configuration item according to the identifier of each updatable configuration item in the configuration item setting request;
and storing the identification of each updatable configuration item and corresponding current configuration information by adopting a single object in the form of a key value pair, wherein a key in the key value pair is the identification of the updatable configuration item, and the value is the current configuration information of the updatable configuration item.
In one possible implementation, for a target configuration item, the configuration information modification function includes any one of the following:
a key value modification function;
a key value modification function and a configuration item processing function;
updating the current configuration information of the target configuration item into new configuration information by calling back a configuration information modification function corresponding to the target configuration item, including:
if the configuration information modification function is a key value modification function, modifying the value in the key value pair of the single object of the target configuration item from the current configuration information to new configuration information by calling back the key value modification function corresponding to the target configuration item;
if the configuration information modification function is a key value modification function and a configuration item processing function, modifying the value in the key value pair of the single object of the target configuration item from the current configuration information to new configuration information by calling back the key value modification function corresponding to the target configuration item, and updating the current configuration information of the target configuration item to the new configuration information by calling back the configuration item processing function corresponding to the target configuration item.
In a second aspect, an embodiment of the present application provides a method for updating configuration information, where the method includes:
receiving a Restful request, analyzing the Restful request to obtain each node identifier and a configuration update request corresponding to each node identifier, wherein the configuration update request comprises update configuration information, and the update configuration information comprises identifiers of target configuration items to be updated and new configuration information of the target configuration items;
if the node identification comprises the identification of the neutron control node, determining a configuration information modification function corresponding to each target configuration item corresponding to the identification of the neutron control node, and updating the current configuration information of each target configuration item into new configuration information by calling back the configuration information modification function corresponding to each target configuration item;
if the node identifier includes the identifier of the neutron proxy node, a configuration update request is sent to the corresponding neutron proxy node, so that the neutron proxy node determines a configuration information modification function corresponding to each target configuration item in the configuration update request according to the received configuration update request, and updates the current configuration information of each target configuration item into new configuration information by calling back the configuration information modification function corresponding to each target configuration item.
In a third aspect, an embodiment of the present invention provides a configuration information updating apparatus, including:
the acquisition module is used for acquiring the configuration update request;
the analysis module is used for analyzing the configuration update request to obtain update configuration information, wherein the update configuration information comprises the identification of each target configuration item to be updated and new configuration information of each target configuration item;
the determining module is used for determining configuration information modification functions corresponding to the target configuration items respectively;
and the updating module is used for updating the current configuration information of each target configuration item into new configuration information through the configuration information modification function corresponding to each callback target configuration item.
In a fourth aspect, an embodiment of the present invention provides a configuration information updating apparatus, including:
the receiving module is used for receiving the Restful request, analyzing the Restful request to obtain each node identifier and a configuration update request corresponding to each node identifier, wherein the configuration update request comprises update configuration information, and the update configuration information comprises identifiers of target configuration items to be updated and new configuration information of the target configuration items;
the determining module is used for determining a configuration information modification function corresponding to each target configuration item corresponding to the identifier of the neutron control node if the node identifier comprises the identifier of the neutron control node, and updating the current configuration information of each target configuration item into new configuration information by calling back the configuration information modification function corresponding to each target configuration item;
And the sending module is used for sending the configuration update request to the corresponding neutron proxy node if the node identifier comprises the identifier of the neutron proxy node, so that the neutron proxy node determines the configuration information modification function corresponding to each target configuration item in the configuration update request according to the received configuration update request, and updates the current configuration information of each target configuration item into new configuration information through the configuration information modification function corresponding to each callback target configuration item.
In a fifth aspect, embodiments of the present invention also provide an electronic device, including one or more processors; a memory; one or more computer programs, wherein the one or more computer programs are stored in memory and configured to be executed by the one or more processors, the one or more programs configured to perform the methods as set forth in the first or second aspects of the present application.
In a sixth aspect, embodiments of the present invention also provide a computer readable storage medium for storing a computer program which, when run on a processor, causes the processor to perform a method as shown in the first or second aspect of the present application.
The beneficial effects that this application provided technical scheme brought are:
the application provides a configuration information updating method, a device, electronic equipment and a storage medium, and a configuration updating request is acquired; analyzing the configuration update request to obtain update configuration information, wherein the update configuration information comprises the identification of each target configuration item to be updated and new configuration information of each target configuration item; determining configuration information modification functions corresponding to the target configuration items respectively; and updating the current configuration information of each target configuration item into new configuration information by calling back the configuration information modification function corresponding to each target configuration item. According to the technical scheme, when the configuration updating is carried out on the neutron service component, the current configuration information is updated to the new configuration information by calling back the configuration information modification function corresponding to the target configuration item, the neutron service component does not need to be restarted, the problem of network paralysis of the virtual machine caused by the restarting is avoided, the normal operation of the neutron service component is not influenced, and the stability of the system is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that are required to be used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a flowchart of a configuration information updating method provided in an embodiment of the present application;
FIGS. 2a-2b are schematic structural diagrams of a control node and a computing node according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a control node according to an embodiment of the present application determining a configuration update request through a restful request;
FIG. 4 is a schematic diagram of determining a configuration update request by monitoring a socket file according to an embodiment of the present application;
fig. 5 is a schematic diagram of a configuration information registration process provided in an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a configuration update subsystem according to an embodiment of the present disclosure;
fig. 7 is a flowchart of a configuration information updating method provided in an embodiment of the present application;
FIG. 8 is a flowchart of a specific process for updating configuration information according to an embodiment of the present application;
fig. 9 is a system architecture diagram of a configuration information updating method according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a configuration information updating device according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a configuration information updating device according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only for the purpose of illustrating the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein includes all or any element and all combination of one or more of the associated listed items.
The following describes the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Noun interpretation:
infrastructure as a service (Infrastructure as a Service, iaaS) refers to a service mode in which IT infrastructure is provided externally as a service through a network and charges are made according to the actual usage or occupancy of resources by users.
OpenStack: the open source cloud computing management platform manages the resource pool (server, storage and network) of the IaaS cloud through commands or Web-based visual control panels.
neutron: network components in Openstack are used to manage the lifecycle of various network resources.
The technical scheme can be applied to updating configuration information of a neutron service component, wherein the neutron service component comprises at least one neutron control node (hereinafter referred to as a control node) and at least one neutron computing node (hereinafter referred to as a computing node), the control node comprises at least one neutron proxy node, and the computing node comprises at least one neutron proxy node. According to the technical scheme, by adding the bypass thread in the neutron proxy node of the control node (hereinafter referred to as the proxy node of the control node) and the neutron proxy node of the computing node (hereinafter referred to as the proxy node of the computing node), the updating of the neutron service component is realized in a mode of running the configuration updating subsystem in the bypass thread, the restarting is not needed during updating, and the normal work of the main thread of the neutron service component is not influenced.
The embodiment of the application provides a method for updating configuration information, as shown in fig. 1, the method comprises the following steps:
step S101, acquiring a configuration update request;
step S102, analyzing the configuration update request to obtain update configuration information, wherein the update configuration information comprises the identification of each target configuration item to be updated and new configuration information of each target configuration item;
the configuration update request may be a request for updating configuration information in a control node or a computing node in the neutron service component. The configuration update request carries the identification of each target configuration item to be updated and new configuration information of each target configuration item.
Analyzing the received configuration update request to obtain at least one identifier of a target configuration item to be updated and new configuration information of each target configuration item, wherein the target configuration item is the configuration item in a control node or a computing node to be updated, the new configuration information of the target configuration item is the configuration information of the updated target configuration item, and the identifier of the target configuration item is specifically the identifier of the configuration item, and can be the name of the configuration item, or can be a key, and is usually a key.
The specific manner of obtaining the configuration update request may be implemented by the following embodiments.
In one possible implementation manner, the execution subject of the method is a neutron proxy node, and the configuration update request is obtained, which includes at least one of the following:
receiving a configuration updating request sent by a control node, wherein the configuration updating request is determined by the control node through a received first representational state transfer (Representational State Transfer, REST) restful request;
the configuration update request is obtained by monitoring the first Unix socket file.
In practical application, the configuration update request may be determined by using a hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP) network transmission and a request received through a restful application program interface (Application Programming Interface, API), when the execution body is a neutron proxy node, the control node receives a first restful request through a server process, determines the configuration update request according to the first restful request, where the configuration update request may be an update request for the server process of the control node, or may be an update request for the neutron proxy node, and when the configuration update request determined by the control node is for the neutron proxy node, sends the configuration update request to the corresponding neutron proxy node, and the neutron proxy node receives the configuration update request and subsequently processes the configuration update request; the configuration update request may also be a command line request directly input by a user in the form of an input command, whether the control node or the neutron proxy node, may create a thread in which the configuration update request in the form of a command line is obtained by monitoring the corresponding Unix socket file.
In the embodiment of the application, the configuration update request mode is obtained through the restful request mode, so that the method can be applied to an operation and maintenance system of the private cloud for operation and maintenance management staff to use, and furthermore, a client receiving the restful request can be provided for any third party call, such as a configuration center. The configuration update request is input in a command line form, and the mode of acquiring the configuration update request by monitoring the Unix socket file can be provided for a developer through a background service. The embodiment provides two ways for acquiring the configuration update request, so that the configuration update is more convenient to use, and is suitable for meeting more requirements.
In addition, the configuration update request in the first Unix socket file is obtained by:
in one possible implementation, the method further includes:
and receiving a first Command Line Interface (CLI) configuration update request, and writing the received configuration update request into a first Unix socket file.
In practical application, the neutron proxy node receives a configuration update request in the form of a command line, and writes the configuration update request into a Unix socket file. The Unix socket file is a local file of a preconfigured neutron proxy node, and communication between different processes can be realized through the Unix socket file. The Unix socket only performs data copying, and does not perform complex operations such as adding and deleting message heads, calculating checksums, calculating message sequences and the like which need to be processed in a network protocol stack, so that the Unix socket is used for communication between different processes of the same computer, and the operation is simple and efficient.
The proxy node of the neutron may also be a proxy node of a different node in the neutron service component.
In one possible implementation, the neutron proxy node may be a proxy node of a control node or a proxy node of a compute node.
In practical application, the neutron proxy node can be a proxy node of the control node, and the proxy control node realizes corresponding functions; the neutron proxy node can also be a proxy node of the computing node, and the proxy computing node realizes corresponding functions.
In an example, as shown in fig. 2a, the control node includes a main service node (a neutron-server as shown in the figure and may also be understood as a service process) and a plurality of proxy nodes, where the neutron-server is used to provide an OpenStack network API to the outside, receive a network request, call a plugin processing request, and so on, and for example, the neutron-server is tasked with receiving a restful request and distributing the processing. The proxy node of the control node may include a neutron-dhcp-agent, neutron-l3-agent, neutron-metadata-agent, neutron-openvswitch-agent. The function of these proxy nodes is as follows: the neutron-DHCP-agent is used for managing dynamic host configuration protocol (Dynamic Host Configuration Protocol, DHCP) services of the neutron network; the neutron-l3-agent is used for managing a neutron virtual router service; the neutron-metadata-agent is used for accessing metadata services of the virtual machine; the neutron-openvswitch agent is used to manage the virtual switches of the neutron.
The Neutron proxy node can also be a proxy node of the computing node, and the proxy computing node realizes corresponding functions. As shown in fig. 2b, the proxy node of the compute node may include a neutron-openvswitch agent for managing the virtual switches of the neutron. The agent nodes of the control node and the neutron agent nodes of the computing node are respectively provided with a pre-configured configuration updating subsystem, and the pre-configured configuration updating subsystem is used for updating the configuration information of each node.
The specific manner of determining the configuration update request corresponding to the proxy node may be implemented by the following embodiments.
In one possible implementation manner, the first restful request carries a node identifier of a neutron proxy node, and the configuration update request is determined by the control node through the following ways:
receiving a first Restful request;
and analyzing the first Restful request, and obtaining each node identifier and a configuration update request corresponding to each node identifier based on an analysis result.
In practical application, the control node receives the restful request through the neutron server process, analyzes the first restful request, and can obtain each node identifier and a configuration update request corresponding to each node identifier based on an analysis result. The configuration update request may be directed to a server process of the control node, or may be directed to a proxy node of the control node or a proxy node of the computing node, if directed to the server process of the control node, the control node performs corresponding processing, and if directed to the proxy node of the control node or the computing node, the control node may send the configuration update request to the corresponding proxy node according to the node identifier. Specifically, if the Restful request received by the control node carries the node identifier of the neutron proxy node, the Restful request includes a configuration update request for the neutron proxy node corresponding to the node identifier, and the control node may send the corresponding configuration update request to the corresponding neutron proxy node, so that the neutron proxy node updates configuration information based on the received configuration update request.
The above embodiments of the present application are implementation methods using a neutron proxy node as an execution body, and the method in the present application may also use a control node as an execution body, where specific implementation methods are described in the following embodiments.
In one possible implementation manner, the execution body of the method is a control node, and acquiring the configuration update request includes at least one of the following:
receiving a second Restful request, and obtaining a configuration update request based on the second Restful request;
the configuration update request is obtained by monitoring the second Unix socket file.
In practical application, the control node can determine the configuration update request through the received second Restful request, specifically, the server process of the control node receives the second Restful request through the HTTP network, and determines the configuration update request according to the second Restful request. In addition, the configuration update request may be a command line request directly input by a user in the form of an input command, whether the control node or the neutron proxy node, a thread may be newly created, and the configuration update request in the form of a command line is obtained by monitoring the corresponding Unix socket file in the thread.
In the embodiment of the application, the configuration update request mode is obtained through the restful request mode, so that the method can be applied to an operation and maintenance system of the private cloud for operation and maintenance management staff to use, and furthermore, a client receiving the restful request can be provided for any third party call, such as a configuration center. The configuration update request is input in a command line form, and the mode of acquiring the configuration update request by monitoring the Unix socket file can be provided for a developer through a background service. The embodiment provides two ways for acquiring the configuration update request, so that the configuration update is more convenient to use, and is suitable for meeting more requirements.
In addition, the configuration update request in the second Unix socket file is obtained by:
in one possible implementation, the method further includes:
and receiving a second CLI configuration update request, and writing the received configuration update request into a second Unix socket file.
In practical application, the control node receives a configuration update request in the form of a command line, and writes the configuration update request into the Unix socket file. The Unix socket file is a local file, and communication between different processes can be realized through the Unix socket file. The Unix socket only performs data copying, and does not perform complex operations such as adding and deleting message heads, calculating checksums, calculating message sequences and the like which need to be processed in a network protocol stack, so that the Unix socket is used for communication between different processes of the same computer, and the operation is simple and efficient.
The specific manner of determining the configuration update request corresponding to the control node may be implemented by the following embodiments.
In one possible implementation manner, the second Restful request carries a node identifier of the control node, and the obtaining the configuration update request based on the second Restful request includes:
Analyzing the second Restful request, and obtaining each node identifier and a configuration update request corresponding to each node identifier based on an analysis result;
and determining the configuration update request corresponding to the node identifier of the control node in the node identifiers as the configuration update request.
In practical application, the second Restful request received by the control node carries the node identifier of the control node, the control node receives the second Restful request through a server process, analyzes the second Restful request, and can obtain each node identifier and the configuration update request corresponding to each node identifier based on the analysis result. And determining the configuration update request corresponding to the node identifier of the control node in the node identifiers as the configuration update request. The configuration update request corresponding to the node identification of the control node is a configuration update request for a server process of the control node.
The implementation of receiving a configuration update request via a restful request is described below in one particular embodiment.
In an example, a schematic diagram of a control node determining a configuration update request via a restful request is shown in fig. 3. The control node adds an API for dynamically modifying configuration in a server process (a neutron-server shown in the figure), a Web server in the server process receives a restful request through the API, analyzes the restful request, obtains each node identifier and a configuration update request corresponding to each node identifier, determines a sending path of the configuration update request according to the node identifier, transmits the path to a route map, configures a corresponding route processing function, directly sends the configuration update request to a control node own configuration update subsystem for processing if the configuration update request is for the server process of the control node, and sends the configuration update request to a corresponding proxy node (a neutron-optional-agent, neutron-dhcp-agent shown in the figure) through a remote procedure call (Remote Procedure Call, RPC) through a server (a Rabbmq) of an advanced message queue protocol if the configuration update request is for the proxy node or a proxy node of a computing node.
The implementation of determining a configuration update request by a request in the form of a command line is described below in one particular embodiment.
In an example, a schematic diagram of determining a configuration update request by monitoring a socket file is shown in fig. 4, a command line interface client (Cli client shown in the figure) receives a command line request input by a user, and a neutron service shown in the figure includes: the server processes in the control nodes, the proxy nodes of the control nodes, and the proxy nodes of the computing nodes may each include a Unix socket monitoring module (shown as Unix socket monitoring) and a configuration update subsystem. After receiving the command line request, writing a local Unix socket Sock file, and each node acquires a configuration update request in the form of the command line by monitoring the form of the Sock file and sends the configuration line request to a configuration update subsystem for corresponding processing.
Step S103, determining configuration information modification functions corresponding to the target configuration items respectively;
the configuration information modification function is a function for modifying the configuration information of each configuration item, and the configuration information modification function may be a section of program statement for modifying the field value of the configuration item in the configuration file, or may be a function for creating a new thread, or a function for closing a thread, etc., which is not limited in this application.
Before the configuration information updating request corresponding to each node is obtained, the configuration items in each node and the information related to the configuration items need to be registered, and after the registration, the corresponding nodes can be updated according to the configuration information updating request.
In one possible implementation, before obtaining the configuration update request, the method further includes:
receiving a configuration item setting request, wherein the configuration item setting request comprises the identification of each updatable configuration item and the configuration information modification function corresponding to each updatable configuration item;
according to the configuration item setting request, establishing and storing the identification of each updatable configuration item and the mapping relation between the configuration information modification functions corresponding to each updatable configuration item;
determining configuration information modification functions corresponding to each target configuration item, including:
and determining configuration information modification functions corresponding to the target configuration items respectively based on the mapping relation and the identification of the target configuration items.
In this embodiment, the configuration update request is obtained before the configuration update request is received, and when each node is started, the configuration information related to each node may be registered in the configuration update subsystem, and the registration of the configuration information is implemented by setting the configuration item and the corresponding configuration information modification function. Receiving a configuration item setting request, wherein the request comprises at least one updatable configuration item identifier and configuration information modification functions corresponding to each updatable configuration item, establishing a mapping relation between each updatable configuration item identifier and the corresponding configuration information modification function, storing, after registration, enabling a configuration update subsystem to respond when receiving the configuration update request, determining the configuration information modification function corresponding to the identifier of the target configuration item based on the identifier of each updatable configuration item and the mapping relation between the configuration information modification functions corresponding to each updatable configuration item, and correspondingly updating the configuration information of the updatable configuration item.
In one possible implementation, after receiving the configuration item setting request, the method further includes:
acquiring current configuration information of each corresponding updatable configuration item according to the identifier of each updatable configuration item in the configuration item setting request;
and storing the identification of each updatable configuration item and corresponding current configuration information by adopting a single object in the form of a key value pair, wherein a key in the key value pair is the identification of the updatable configuration item, and the value is the current configuration information of the updatable configuration item.
In practical application, after receiving a configuration item setting request, according to the identifier of each updatable configuration item, the current configuration information of each updatable configuration item can be obtained, and a single object is adopted to globally store the identifier of each updatable configuration item and the corresponding current configuration information, where the single object may be in the form of a key value pair, for example, the configuration items of a general program are all in the form of a key value pair similar to "key=value", the keys in the key value pair are the identifiers of the updatable configuration items, the values are the current configuration information of the updatable configuration items, for example, "pool_size=5", and indicate that the number of threads in a thread pool is 5, where pool_size is a key, that is, the key of the updatable configuration item, and 5 is a value, that is, the current configuration information of each updated configuration item. When registering the configuration item, the value of the key is registered, and the value of the key of the configuration item associated with each node is registered to the configuration updating subsystem.
When registering, the configuration item is globally saved in the memory through the single-instance object, for example, the single-instance object can save the key value pair corresponding to the configuration item through a field or hash function hash. In the embodiment of the application, the configuration items are saved by adopting the single-instance object, so that repeated creation of the configuration items can be avoided, the system overhead caused by repeated creation of the configuration items is reduced, and the memory is saved.
Because the functions of the nodes of the neutron component are different, the required configuration information is also different, the configuration information associated with each node of the neutron component is required to be registered by analyzing the original configuration file of the neutron component, and the configuration information registration process is described below through a specific embodiment.
As shown in fig. 5, the configuration items of each node, i.e., the node-server, neutron-dhcp-agent, neutron-openvswitch-agent, and the corresponding configuration information modification function are respectively registered, the configuration files in the figure respectively represent the configuration items corresponding to each node and the configuration information modification function (i.e., the configuration related to the node-server, the configuration related to the node-dhcp-agent, the configuration related to the node-openvswitch-agent, and the configuration update subsystem of each node may include a configuration registration module (configuration registration shown in the figure), a configuration key matching module (configuration key matching shown in the figure), and a configuration processing module (configuration processing shown in the figure), where the configuration registration module corresponding to each node is used to register the configuration related to the node-server, the configuration related to the node-dhcp-agent, and the configuration related to the node-openvswitch-agent, respectively. When the configuration updating subsystem receives a configuration updating request, a configuration key matching module is used for matching the value of the key of the configuration item analyzed in the configuration updating request with the value of the key of the configuration item registered in the configuration registration module for each node, and the configuration item successfully matched and the configuration information modification function corresponding to the configuration item are sent to a configuration processing module; the configuration processing module is used for modifying the current configuration information of the configuration item into new configuration information by utilizing the configuration information modification function corresponding to the configuration item.
Step S104, updating the current configuration information of each target configuration item into new configuration information through callback of the corresponding configuration information modification function of each target configuration item.
Specifically, a configuration information modification function corresponding to the configuration item to be updated can be called in a callback mode, and the current configuration information of the configuration item to be updated is updated into new configuration information by utilizing the modification function.
The new configuration information of the target configuration item is different, and the implementation manner of updating the target configuration item by using the configuration information modification function is different, which is specifically described in the following embodiments.
In one possible implementation, for a target configuration item, the configuration information modification function includes any one of the following:
a key value modification function;
a key value modification function and a configuration item processing function;
updating the current configuration information of the target configuration item into new configuration information by calling back a configuration information modification function corresponding to the target configuration item, including:
if the configuration information modification function is a key value modification function, modifying the value in the key value pair of the single object of the target configuration item from the current configuration information to new configuration information by calling back the key value modification function corresponding to the target configuration item;
If the configuration information modification function is a key value modification function and a configuration item processing function, modifying the value in the key value pair of the single object of the target configuration item from the current configuration information to new configuration information by calling back the key value modification function corresponding to the target configuration item, and updating the current configuration information of the target configuration item to the new configuration information by calling back the configuration item processing function corresponding to the target configuration item.
In practical application, the configuration information modification function may include a key value modification function, or a key value modification function and a configuration item processing function, when registering the configuration items, a corresponding configuration information modification function is configured for each configuration item, some configuration information modification functions of the configuration items are key value modification functions, and some configuration information modification functions of the configuration items are key value modification functions and configuration item processing functions. Wherein the configuration item processing function is a function for performing corresponding processing on the configuration item, for example, a thread creation function and the like. If the configuration information of the target configuration item is updated according to the value in the key value pair of the target configuration item, that is, the value in the key value pair corresponding to the target configuration item is modified, the configuration update of the target configuration item can be realized, then a key value modification function corresponding to the target configuration item is called, the value in the key value pair of the single object storing the target configuration item is modified, and the value in the key value pair is modified from the current configuration information to the new configuration information.
If the updating of the target configuration item needs to modify both the key value pair and the corresponding function by callback, for example, modifying the number of the working threads corresponding to the configuration item, the key value modifying function corresponding to the target configuration item and the configuration item processing function of the target configuration item are called in a callback mode, the target configuration item is modified by using the key value modifying function, and corresponding processing is performed by using the configuration item processing function, for example, a new working thread is created by a thread creating function, and some working threads are closed by using a thread closing function. In addition to the modification of the worker thread, updating the target configuration item by calling back other functions may be included, which is not limited in this application.
In an example, the current configuration information of the target configuration item is "pool_size=5", the new configuration information is "pool_size=10", then the key value modifying function is called in a callback manner, the original "pool_size=5" is modified to "pool_size=10", and then the thread creating function for creating new threads is called to create 5 new working threads.
In yet another example, the current configuration information of the target configuration item is "pool_size=5", the new configuration information is "pool_size=3", and then the "pool_size=5" is changed to "pool_size=3" by the callback key value modification function; for two threads which are about to finish work at present, no new work is redistributed, a thread closing function is called in a callback mode, and the two threads are closed when the two threads finish work.
The specific operation of the various modules in the configuration update subsystem is described below with respect to a specific embodiment.
As shown in fig. 6, a configuration analysis module (configuration analysis shown in the figure) in the configuration updating subsystem analyzes a configuration updating request obtained from a restful api or a socket monitoring module, obtains each target configuration item to be updated and new configuration information of each target configuration item, and sends the configuration updating request to a configuration matching module (configuration matching shown in the figure); each configuration item which needs to be dynamically updated and a configuration information modification function corresponding to each configuration item are registered in the configuration registration module (configuration registration shown in the figure) in advance; the configuration matching module matches each target configuration item with the configuration items registered in the configuration registration module, and takes the configuration information modification function of each successfully matched configuration item as the configuration information modification function corresponding to each corresponding target configuration item; the memory application module (memory application shown in the figure) calls the configuration information modification function corresponding to each target configuration item in a callback mode, modifies the current configuration information of the target configuration item by using the configuration information modification function, and applies the new configuration information of each target configuration item to be updated to the memory. The configuration information modification function corresponding to each callback is different, taking 3 callbacks as examples (such as callback 1, callback 2 and callback 3 shown in the figure), each callback calls one configuration information modification function, and the current configuration information in the target configuration item is modified into new configuration information by utilizing each configuration information modification function.
The configuration information updating method provided by the embodiment of the application comprises the steps of firstly obtaining a configuration updating request; analyzing the configuration update request to obtain update configuration information, wherein the update configuration information comprises the identification of each target configuration item to be updated and new configuration information of each target configuration item; determining configuration information modification functions corresponding to the target configuration items respectively; and updating the current configuration information of each target configuration item into new configuration information by calling back the configuration information modification function corresponding to each target configuration item. According to the technical scheme, when the configuration updating is carried out on the neutron service component, the current configuration information is updated to the new configuration information by calling back the configuration information modification function corresponding to the target configuration item, the neutron service component does not need to be restarted, the problem of network paralysis of the virtual machine caused by the restarting is avoided, the normal operation of the neutron service component is not influenced, and the stability of the system is improved.
The following description describes a specific implementation procedure of updating configuration information by the control node according to the received Restful request.
The embodiment of the application provides a method for updating configuration information, as shown in fig. 7, the method comprises the following steps:
Step S201, receiving a Restful request, analyzing the Restful request to obtain each node identifier and a configuration update request corresponding to each node identifier, wherein the configuration update request comprises update configuration information, and the update configuration information comprises each target configuration item to be updated and new configuration information of each target configuration item;
specifically, the control node receives a restful request through a server process, the restful request carries each node identifier and a configuration update request corresponding to each node identifier, after the restful request is analyzed, each node identifier and the configuration update request corresponding to each node identifier are obtained, and the configuration update request can be a request for updating configuration information in a control node or a computing node in a neutron service component. The configuration update request carries each target configuration item to be updated and new configuration information of each target configuration item.
Step S202, if the node identification comprises the identification of the control node, determining a configuration information modification function corresponding to each target configuration item corresponding to the identification of the control node, and updating the current configuration information of each target configuration item into new configuration information by calling back the configuration information modification function corresponding to each target configuration item;
If the node identification comprises the identification of the control node, the configuration update request is indicated to be specific to the control node, a configuration information modification function corresponding to each target configuration item corresponding to the identification of the control node is determined, and the current configuration information of each target configuration item is updated to be new configuration information by calling back the configuration information modification function corresponding to each target configuration item.
In step S203, if the node identifier includes an identifier of the neutron proxy node, a configuration update request is sent to the corresponding neutron proxy node, so that the neutron proxy node determines, according to the received configuration update request, a configuration information modification function corresponding to each target configuration item in the configuration update request, and updates the current configuration information of each target configuration item to new configuration information by calling back the configuration information modification function corresponding to each target configuration item.
If the node identification includes the identification of the neutron proxy node, the configuration update request is indicated to be for the proxy node, wherein the proxy node can include a proxy node of a control node or a proxy node of a calculation node, the control node sends the configuration update request to the corresponding proxy node according to the identification of the proxy node, the proxy node determines a configuration information modification function corresponding to each target configuration item in the configuration update request, and updates the current configuration information of each target configuration item into new configuration information by calling back the configuration information modification function corresponding to each target configuration item.
The specific implementation process of step S201 to step S203 has been described in detail in a plurality of alternative embodiments in the corresponding embodiment of fig. 1, and will not be described here again.
According to the technical scheme, when the configuration updating is carried out on the neutron service component, the current configuration information is updated to the new configuration information by calling back the configuration information modification function corresponding to the target configuration item, the neutron service component does not need to be restarted, the problem of network paralysis of the virtual machine caused by the restarting is avoided, the normal operation of the neutron service component is not influenced, and the stability of the system is improved.
The following describes, by way of a particular embodiment, a particular process for configuration updating in a flow chart manner.
As shown in fig. 8, for the received request, if the request is a restful request, step S301 is executed to parse the restful request, where the parsing result includes each node identifier and a configuration update request corresponding to each node identifier, and according to the node identifier, it is determined whether the configuration update request is a neurton-server configuration update request for a server process of a control node of the neurton component, if not, step S302 is executed to send the configuration update request to a proxy node corresponding to the node identifier by remote Rpc calling; executing step S303, and processing by the configuration updating subsystem of the proxy node;
If the request is a command line request, writing the request into a socket file, obtaining a configuration update request by monitoring the socket file, executing step S303, and processing by a configuration update subsystem of a node corresponding to the configuration update request;
if the request is a neurton-server configuration update request, directly executing step S303, and sending the configuration update request to a configuration update subsystem of the control node for processing;
step S304 is next carried out, the configuration updating subsystem analyzes the configuration updating request to obtain each target configuration item and new configuration information corresponding to each target configuration item;
step S305, matching each target configuration item with the configuration items registered in the configuration registration module, and taking the configuration information modification function of each successfully matched configuration item as the configuration information modification function corresponding to each corresponding target configuration item;
step S306, callback is performed on the key value modification function of the target configuration items in a callback mode, key value pairs of each target configuration item stored in the memory are modified, and key value pairs in new configuration information are applied to the memory;
step S307, callback is performed on the corresponding configuration item processing function in a callback mode, and the current configuration information of the target configuration item is changed into new configuration information.
In step S303, the processing performed by the request processing subsystem is performed by the configuration update subsystem of the node corresponding to the configuration update request, which may be the configuration update subsystem of the control node or the configuration update subsystem of the proxy node, and the configuration and functions of the processing update subsystems of the nodes are the same, so that the drawing is not distinguished.
A system architecture to which the technical solution of the present application is applicable is described below by means of a specific embodiment.
As shown in fig. 9, the system architecture is divided into three layers, and the specific description of each layer is as follows:
the first layer is a business layer and comprises a self-service platform, an operation and maintenance platform and a monitoring platform.
The self-service platform is used for providing an interface for applying for network resources for the user, the user can apply for the network resources through the self-service platform, and the network resources can comprise: virtual network cards, virtual routers, virtual firewalls, virtual switches, etc.
The operation and maintenance platform is used for providing an interface operated by an administrator for a user, and the operations such as migration of the host machine and the like can be carried out through the interface, so that data in the network resource are transferred and stored into the designated equipment.
The monitoring platform is used for monitoring all network resource use conditions of the whole platform.
The second layer is a gateway layer comprising: a database (DB shown in the figure), a control module (venus shown in the figure), a network protocol (Internet Protocol, IP) management system (IP system shown in the figure), and a role-based access control Rbac module (Rbac shown in the figure);
the database is used for storing data related to network resources;
the control module can be realized through a venus operating system, is used for providing uniform resource interfaces for a self-service platform, an operation and maintenance platform and a monitoring platform in a service layer, and is communicated with a database, an IP management system and an Rbac module;
the IP management system is used for managing network resources such as network protocols;
the Rbac module is used for distributing corresponding operation authorities for different users.
The third layer is the base cloud layer (Openstack layer shown in the figure), including Rest Client, cli Client, and neutron component (neutron shown in the figure);
the basic cloud layer is mainly used for providing Iaas service for open-source Openstack.
The Rest Client is used for receiving a configuration update request from a network layer through a restful api, and the types of the request can comprise a POST request, a GET request and a LIST request;
cli Client is used for providing a command line interface for a user, receiving a configuration update request in the form of a command line input by the user, and setting a key=value of a configuration item in a neutral component (neutron config set key =value as shown in the figure);
The configuration updating subsystem is included in the neutron component, and the configuration information of each node in the neutron component is updated through the configuration updating subsystem.
The neutron component of the base cloud layer uses the configuration update subsystem in two ways, one is a restful request and the other is a command line request. The general restful request can be provided for an operation and maintenance system of the private cloud for operation and maintenance management staff to use; the restful client may also provide for any third party call, such as a configuration center. The command line request may be provided for use by a developer in a background service. By providing two use modes on the product, the configuration is more convenient to update and use, and is suitable for meeting more requirements.
Based on the same principle as the method shown in fig. 1, there is also provided in an embodiment of the present disclosure a configuration information updating apparatus 40, as shown in fig. 10, the configuration information updating apparatus 40 including:
an obtaining module 41, configured to obtain a configuration update request;
the parsing module 42 is configured to parse the configuration update request to obtain updated configuration information, where the updated configuration information includes an identifier of each target configuration item to be updated and new configuration information of each target configuration item;
A determining module 43, configured to determine a configuration information modification function corresponding to each target configuration item;
and the updating module 44 is configured to update the current configuration information of each target configuration item to new configuration information by calling back the configuration information modification function corresponding to each target configuration item.
In one possible implementation, the apparatus 40 is configured in a neutron proxy node, and the obtaining module 41 may include at least one of the following:
the first receiving unit is used for receiving a configuration update request sent by the neutron control node, wherein the configuration update request is determined by the neutron control node through the received first representation layer state transformation restful request;
the first monitoring unit is used for acquiring a configuration update request by monitoring the first Unix socket file.
In one possible implementation, the apparatus 40 further includes a first receiving module;
the first receiving module is used for receiving the CLI configuration update request of the first command line and writing the received configuration update request into the first Unix socket file.
In one possible implementation, the neutron proxy node comprises a proxy node of a neutron control node or a proxy node of a neutron computing node.
In one possible implementation manner, the first restful request carries a node identifier of a neutron proxy node, and the configuration update request is determined by a neutron control node through the following modes:
receiving a first Restful request;
and analyzing the first Restful request, and obtaining each node identifier and a configuration update request corresponding to each node identifier based on an analysis result.
In one possible implementation, the apparatus 40 is configured in a neutron control node, and the obtaining module 41 may include at least one of the following:
the second receiving unit is used for receiving a second Restful request and obtaining a configuration update request based on the second Restful request;
and the second monitoring unit is used for acquiring a configuration update request by monitoring the second Unix socket file.
In one possible implementation, the apparatus 40 further includes a second receiving module;
and the second receiving module is used for receiving a second CLI configuration update request and writing the received configuration update request into a second Unix socket file.
In one possible implementation, the second Restful request carries the node identifier of the neutron control node, and the apparatus 40 further includes a request determining module;
the request determining module is used for analyzing the second Restful request and obtaining each node identifier and a configuration update request corresponding to each node identifier based on the analysis result;
And determining a configuration update request corresponding to the node identifier of the neutron control node in the node identifiers as the configuration update request.
In one possible implementation, the apparatus 40 further includes a configuration item setting module;
the configuration item setting module is used for receiving a configuration item setting request, wherein the configuration item setting request comprises the identification of each updatable configuration item and the configuration information modification function corresponding to each updatable configuration item;
according to the configuration item setting request, establishing and storing the identification of each updatable configuration item and the mapping relation between the configuration information modification functions corresponding to each updatable configuration item;
the determining module 43 is configured to determine, based on the mapping relationship and the identifier of each target configuration item, a configuration information modification function corresponding to each target configuration item.
In one possible implementation, the apparatus 40 further includes a configuration information acquisition module;
the configuration information acquisition module is used for acquiring the current configuration information of each corresponding updatable configuration item according to the identification of each updatable configuration item in the configuration item setting request;
and storing the identification of each updatable configuration item and corresponding current configuration information by adopting a single object in the form of a key value pair, wherein a key in the key value pair is the identification of the updatable configuration item, and the value is the current configuration information of the updatable configuration item.
In one possible implementation, for a target configuration item, the configuration information modification function includes any one of the following:
a key value modification function;
a key value modification function and a configuration item processing function;
an update module 44 for:
if the configuration information modification function is a key value modification function, modifying the value in the key value pair of the single object of the target configuration item from the current configuration information to new configuration information by calling back the key value modification function corresponding to the target configuration item;
if the configuration information modification function is a key value modification function and a configuration item processing function, modifying the value in the key value pair of the single object of the target configuration item from the current configuration information to new configuration information by calling back the key value modification function corresponding to the target configuration item, and updating the current configuration information of the target configuration item to the new configuration information by calling back the configuration item processing function corresponding to the target configuration item.
The apparatus in this embodiment corresponds to the method in fig. 1, and the specific implementation process has been described in detail in the embodiment corresponding to fig. 1, which is not described herein again.
The configuration information updating device provided by the embodiment of the application acquires a configuration updating request; analyzing the configuration update request to obtain update configuration information, wherein the update configuration information comprises the identification of each target configuration item to be updated and new configuration information of each target configuration item; determining configuration information modification functions corresponding to the target configuration items respectively; and updating the current configuration information of each target configuration item into new configuration information by calling back the configuration information modification function corresponding to each target configuration item. According to the technical scheme, when the configuration updating is carried out on the neutron service component, the current configuration information is updated to the new configuration information by calling back the configuration information modification function corresponding to the target configuration item, the neutron service component does not need to be restarted, the problem of network paralysis of the virtual machine caused by the restarting is avoided, the normal operation of the neutron service component is not influenced, and the stability of the system is improved.
Based on the same principle as the method shown in fig. 7, there is also provided in an embodiment of the present disclosure a configuration information updating apparatus 50, as shown in fig. 11, the configuration information updating apparatus 50 including:
the receiving module 51 is configured to receive the Restful request, analyze the Restful request, and obtain each node identifier and a configuration update request corresponding to each node identifier, where the configuration update request includes update configuration information, and the update configuration information includes identifiers of each target configuration item to be updated and new configuration information of each target configuration item;
the determining module 52 is configured to determine, when the node identifier includes an identifier of the neutron control node, a configuration information modification function corresponding to each target configuration item corresponding to the identifier of the neutron control node, and update current configuration information of each target configuration item to new configuration information by calling back the configuration information modification function corresponding to each target configuration item;
the sending module 53 is configured to send a configuration update request to a corresponding neutron proxy node when the node identifier includes an identifier of the neutron proxy node, so that the neutron proxy node determines, according to the received configuration update request, a configuration information modification function corresponding to each target configuration item in the configuration update request, and updates current configuration information of each target configuration item to new configuration information by calling back the configuration information modification function corresponding to each target configuration item.
The apparatus in this embodiment corresponds to the method in fig. 7, and the specific implementation process has been described in detail in the embodiment corresponding to fig. 7, which is not described herein again.
The above embodiment describes a configuration information updating apparatus from the viewpoint of a virtual module, and the following describes an electronic device from the viewpoint of a physical module, specifically as follows:
an embodiment of the present application provides an electronic device, as shown in fig. 12, an electronic device 9000 shown in fig. 12 includes: a processor 9001 and a memory 9003. Wherein the processor 9001 is coupled to a memory 9003, such as via a bus 9002. Optionally, the electronic device 9000 may further comprise a transceiver 9004. Note that, in practical applications, the transceiver 9004 is not limited to one, and the structure of the electronic device 9000 is not limited to the embodiment of the present application.
The processor 9001 may be a CPU, general purpose processor, GPU, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. The processor 9001 may also be a combination implementing computing functions, e.g. comprising one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
The memory 9003 may be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, an EEPROM, a CD-ROM or other optical disk storage, optical disk storage (including compact disks, laser disks, optical disks, digital versatile disks, blu-ray disks, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such.
The memory 9003 is used to store application code for executing the present application and is controlled for execution by the processor 9001. The processor 9001 is configured to execute application code stored in the memory 9003 to implement what is shown in any of the method embodiments described above.
The embodiment of the application provides electronic equipment, which comprises: one or more processors; a memory; one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs, when executed by the processor, obtaining a configuration update request; analyzing the configuration update request to obtain update configuration information, wherein the update configuration information comprises each target configuration item to be updated and new configuration information of each target configuration item; determining configuration information modification functions corresponding to the target configuration items respectively; and updating the current configuration information of each target configuration item into new configuration information by calling back the configuration information modification function corresponding to each target configuration item. Or alternatively
Receiving a Restful request, analyzing the Restful request to obtain each node identifier and a configuration update request corresponding to each node identifier, wherein the configuration update request comprises update configuration information, and the update configuration information comprises each target configuration item to be updated and new configuration information of each target configuration item; if the node identification comprises the identification of the neutron control node, determining a configuration information modification function corresponding to each target configuration item corresponding to the identification of the neutron control node, and updating the current configuration information of each target configuration item into new configuration information by calling back the configuration information modification function corresponding to each target configuration item; if the node identifier includes the identifier of the neutron proxy node, a configuration update request is sent to the corresponding neutron proxy node, so that the neutron proxy node determines a configuration information modification function corresponding to each target configuration item in the configuration update request according to the received configuration update request, and updates the current configuration information of each target configuration item into new configuration information by calling back the configuration information modification function corresponding to each target configuration item.
Embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, which when executed on a processor, enables the processor to perform the corresponding content of the foregoing method embodiments.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
The foregoing is only a partial embodiment of the present invention, and it should be noted that it will be apparent to those skilled in the art that modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.
Claims (14)
1. The method is characterized in that an execution main body of the method is a neutron control node or a neutron proxy node; the method comprises the steps that bypass threads except a main thread are added in a neutron control node or a neutron proxy node; executing the method through a configuration updating subsystem running in the bypass thread to update configuration information of a corresponding node;
the method comprises the following steps:
receiving a configuration item setting request, wherein the configuration item setting request comprises an identifier of each updatable configuration item and a configuration information modification function corresponding to each updatable configuration item;
according to the configuration item setting request, establishing and storing the identification of each updatable configuration item and the mapping relation between configuration information modification functions corresponding to each updatable configuration item;
acquiring a configuration update request;
analyzing the configuration update request to obtain update configuration information, wherein the update configuration information comprises the identification of each target configuration item to be updated and new configuration information of each target configuration item;
determining configuration information modification functions corresponding to the target configuration items respectively based on the mapping relation and the identification of the target configuration items, wherein the configuration information modification functions are used for modifying the configuration information of the corresponding target configuration items;
And updating the current configuration information of each target configuration item into the new configuration information by calling back the configuration information modification function corresponding to each target configuration item.
2. The method of claim 1, wherein the method execution body is a neutron proxy node, and the acquiring the configuration update request includes at least one of:
receiving a configuration update request sent by a neutron control node, wherein the configuration update request is determined by the neutron control node through a received first representation layer state transformation restful request;
the configuration update request is obtained by monitoring the first Unix socket file.
3. The method according to claim 2, wherein the method further comprises:
and receiving a first command line CLI configuration update request, and writing the received configuration update request into the first Unix socket file.
4. A method according to claim 2 or 3, wherein the neutron proxy node comprises a proxy node of the neutron control node or a proxy node of a neutron computing node.
5. The method of claim 2, wherein the first restful request carries a node identifier of the neutron proxy node, and the configuration update request is determined for the neutron control node by:
Receiving the first Restful request;
and analyzing the first Restful request, and obtaining each node identifier and a configuration update request corresponding to each node identifier based on an analysis result.
6. The method of claim 1, wherein an execution body of the method is a neutron control node, and the acquiring the configuration update request includes at least one of:
receiving a second Restful request, and obtaining a configuration update request based on the second Restful request;
the configuration update request is obtained by monitoring the second Unix socket file.
7. The method of claim 6, wherein the second Restful request carries a node identifier of the neutron control node, and wherein obtaining the configuration update request based on the second Restful request comprises:
analyzing the second Restful request, and obtaining each node identifier and a configuration update request corresponding to each node identifier based on an analysis result;
and determining a configuration update request corresponding to the node identifier of the neutron control node in the node identifiers as the configuration update request.
8. The method of claim 1, wherein after receiving the configuration item setting request, the method further comprises:
Acquiring current configuration information of each corresponding updatable configuration item according to the identifier of each updatable configuration item in the configuration item setting request;
and storing the identification of each updatable configuration item and corresponding current configuration information by adopting a single object in the form of a key value pair, wherein a key in the key value pair is the identification of the updatable configuration item, and the value is the current configuration information of the updatable configuration item.
9. The method of claim 1, wherein for a target configuration item, the configuration information modification function comprises any one of:
a key value modification function;
the key value modification function and the configuration item processing function;
updating the current configuration information of the target configuration item to the new configuration information by calling back the configuration information modification function corresponding to the target configuration item, including:
if the configuration information modification function is a key value modification function, modifying the value in the key value pair of the single object of the target configuration item from the current configuration information to new configuration information by calling back the key value modification function corresponding to the target configuration item;
if the configuration information modification function is a key value modification function and a configuration item processing function, modifying the value in the key value pair of the single object of the target configuration item from the current configuration information to new configuration information by calling back the key value modification function corresponding to the target configuration item, and updating the current configuration information of the target configuration item to the new configuration information by calling back the configuration item processing function corresponding to the target configuration item.
10. The configuration information updating method is characterized in that an execution main body of the method is a neutron control node, and bypass threads except a main thread are added in the neutron control node; executing the method through a configuration updating subsystem running in a bypass thread to update configuration information of the neutron control node or a neutron proxy node;
the method comprises the following steps:
receiving a configuration item setting request, wherein the configuration item setting request comprises an identifier of each updatable configuration item and a configuration information modification function corresponding to each updatable configuration item;
according to the configuration item setting request, establishing and storing the identification of each updatable configuration item and the mapping relation between configuration information modification functions corresponding to each updatable configuration item;
receiving a Restful request, and analyzing the Restful request to obtain each node identifier and a configuration update request corresponding to each node identifier, wherein the configuration update request comprises update configuration information, and the update configuration information comprises identifiers of target configuration items to be updated and new configuration information of the target configuration items;
If the node identifier includes an identifier of a neutron control node, determining a configuration information modification function corresponding to each target configuration item corresponding to the identifier of the neutron control node based on the mapping relationship and the identifier of each target configuration item, and updating current configuration information of each target configuration item into the new configuration information by calling back the configuration information modification function corresponding to each target configuration item, wherein the configuration information modification function is used for modifying configuration information of the corresponding target configuration item;
if the node identifier includes an identifier of a neutron proxy node, the configuration update request is sent to the corresponding neutron proxy node, so that the neutron proxy node determines a configuration information modification function corresponding to each target configuration item in the configuration update request based on the mapping relation and the identifier of each target configuration item according to the received configuration update request, and updates the current configuration information of each target configuration item to the new configuration information by recalling the configuration information modification function corresponding to each target configuration item.
11. The device is characterized in that an execution subject of the device is a neutron control node or a neutron proxy node; the method comprises the steps that bypass threads except a main thread are added in a neutron control node or a neutron proxy node; the device is applied to a configuration updating subsystem running in a bypass thread to update the configuration information of the corresponding node;
the device comprises:
the configuration item setting module is used for receiving a configuration item setting request, wherein the configuration item setting request comprises the identification of each updatable configuration item and the configuration information modification function corresponding to each updatable configuration item; according to the configuration item setting request, establishing and storing the identification of each updatable configuration item and the mapping relation between configuration information modification functions corresponding to each updatable configuration item;
the acquisition module is used for acquiring the configuration update request;
the analysis module is used for analyzing the configuration update request to obtain update configuration information, wherein the update configuration information comprises the identification of each target configuration item to be updated and new configuration information of each target configuration item;
the determining module is used for determining configuration information modification functions corresponding to the target configuration items respectively based on the mapping relation and the identification of the target configuration items, and the configuration information modification functions are used for modifying the configuration information of the corresponding target configuration items;
And the updating module is used for updating the current configuration information of each target configuration item into the new configuration information by calling back the configuration information modification function corresponding to each target configuration item.
12. The configuration information updating device is characterized in that an execution main body of the device is a neutron control node, and bypass threads except a main thread are added in the neutron control node; the device is applied to a configuration updating subsystem running in a bypass thread to update the configuration information of the neutron control node or the neutron proxy node;
the device comprises:
the configuration item setting module is used for receiving a configuration item setting request, wherein the configuration item setting request comprises the identification of each updatable configuration item and the configuration information modification function corresponding to each updatable configuration item; according to the configuration item setting request, establishing and storing the identification of each updatable configuration item and the mapping relation between configuration information modification functions corresponding to each updatable configuration item;
the receiving module is used for receiving the Restful request, analyzing the Restful request to obtain each node identifier and a configuration update request corresponding to each node identifier, wherein the configuration update request comprises update configuration information, the update configuration information comprises identifiers of each target configuration item to be updated and new configuration information of each target configuration item, and the configuration information modification function is used for modifying the configuration information of the corresponding target configuration item;
The determining module is configured to determine, if the node identifier includes an identifier of a neutron control node, a configuration information modification function corresponding to each target configuration item corresponding to the identifier of the neutron control node based on the mapping relationship and the identifier of each target configuration item, and update current configuration information of each target configuration item to the new configuration information by calling back the configuration information modification function corresponding to each target configuration item;
and the sending module is used for sending the configuration update request to the corresponding neutron proxy node if the node identifier comprises the identifier of the neutron proxy node, so that the neutron proxy node determines the configuration information modification function corresponding to each target configuration item in the configuration update request based on the mapping relation and the identifier of each target configuration item according to the received configuration update request, and updates the current configuration information of each target configuration item to the new configuration information by calling back the configuration information modification function corresponding to each target configuration item.
13. An electronic device, the electronic device comprising:
One or more processors;
a memory;
one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-10.
14. A computer readable storage medium for storing a computer program which, when run on a processor, causes the processor to perform the method of any one of claims 1 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010027431.2A CN111277432B (en) | 2020-01-10 | 2020-01-10 | Configuration information updating method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010027431.2A CN111277432B (en) | 2020-01-10 | 2020-01-10 | Configuration information updating method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111277432A CN111277432A (en) | 2020-06-12 |
CN111277432B true CN111277432B (en) | 2023-05-23 |
Family
ID=71000124
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010027431.2A Active CN111277432B (en) | 2020-01-10 | 2020-01-10 | Configuration information updating method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111277432B (en) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113760344A (en) * | 2020-07-06 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Dynamic configuration method, device, electronic equipment and storage medium |
CN111917587B (en) * | 2020-08-07 | 2023-03-24 | 中国工商银行股份有限公司 | Method for network service management by using service system and service system |
CN112965735B (en) * | 2021-02-25 | 2023-07-14 | 北京奇艺世纪科技有限公司 | Model updating method, device, equipment and computer readable medium |
CN113193981B (en) * | 2021-03-29 | 2022-05-24 | 新华三大数据技术有限公司 | Configuration issuing method and device and network system |
CN113900728B (en) * | 2021-09-18 | 2024-08-16 | 浪潮云信息技术股份公司 | Synchronous configuration method, system, electronic equipment and storage medium |
CN114553771B (en) * | 2021-12-24 | 2023-10-13 | 天翼云科技有限公司 | Method for virtual router loading and related equipment |
CN114047941B (en) * | 2022-01-12 | 2022-04-26 | 飞狐信息技术(天津)有限公司 | Configuration upgrading method and device for redis service nodes |
CN114466011B (en) * | 2022-01-29 | 2023-08-04 | 苏州浪潮智能科技有限公司 | Metadata service request method, device, equipment and medium |
CN115297155B (en) * | 2022-08-03 | 2024-06-11 | 广州文远知行科技有限公司 | Configuration management method and device applied to automatic driving platform and related equipment |
CN117579485B (en) * | 2024-01-12 | 2024-04-09 | 腾讯科技(深圳)有限公司 | Configuration changing method, device, equipment and storage medium |
CN118394429B (en) * | 2024-06-28 | 2024-09-20 | 浪潮电子信息产业股份有限公司 | Project configuration management method, equipment, product and medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7519690B1 (en) * | 2002-02-28 | 2009-04-14 | Sprint Communications Company L.P. | Dynamically updateable parameters in integrated services hub |
CN103559063A (en) * | 2013-11-14 | 2014-02-05 | 金蝶软件(中国)有限公司 | Update method and update system of application, application system and parameter configuration system |
CN106506246A (en) * | 2016-12-28 | 2017-03-15 | 瑞斯康达科技发展股份有限公司 | Optical network unit, the method for its dynamic expansion management function and GPON systems |
CN106878363A (en) * | 2016-06-01 | 2017-06-20 | 阿里巴巴集团控股有限公司 | A kind of information processing method, apparatus and system |
CN108804618A (en) * | 2018-05-31 | 2018-11-13 | 康键信息技术(深圳)有限公司 | Configuration method for database, device, computer equipment and storage medium |
CN109992279A (en) * | 2017-12-30 | 2019-07-09 | 中国移动通信集团山西有限公司 | Method for updating configuration data, calculates equipment and storage medium at device |
CN110244987A (en) * | 2019-06-18 | 2019-09-17 | 腾讯科技(深圳)有限公司 | Configuration data processing method, device, readable storage medium storing program for executing and computer equipment |
-
2020
- 2020-01-10 CN CN202010027431.2A patent/CN111277432B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7519690B1 (en) * | 2002-02-28 | 2009-04-14 | Sprint Communications Company L.P. | Dynamically updateable parameters in integrated services hub |
CN103559063A (en) * | 2013-11-14 | 2014-02-05 | 金蝶软件(中国)有限公司 | Update method and update system of application, application system and parameter configuration system |
CN106878363A (en) * | 2016-06-01 | 2017-06-20 | 阿里巴巴集团控股有限公司 | A kind of information processing method, apparatus and system |
CN106506246A (en) * | 2016-12-28 | 2017-03-15 | 瑞斯康达科技发展股份有限公司 | Optical network unit, the method for its dynamic expansion management function and GPON systems |
CN109992279A (en) * | 2017-12-30 | 2019-07-09 | 中国移动通信集团山西有限公司 | Method for updating configuration data, calculates equipment and storage medium at device |
CN108804618A (en) * | 2018-05-31 | 2018-11-13 | 康键信息技术(深圳)有限公司 | Configuration method for database, device, computer equipment and storage medium |
CN110244987A (en) * | 2019-06-18 | 2019-09-17 | 腾讯科技(深圳)有限公司 | Configuration data processing method, device, readable storage medium storing program for executing and computer equipment |
Also Published As
Publication number | Publication date |
---|---|
CN111277432A (en) | 2020-06-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111277432B (en) | Configuration information updating method and device, electronic equipment and storage medium | |
CN112035215B (en) | Node autonomous method, system and device of node cluster and electronic equipment | |
US10659523B1 (en) | Isolating compute clusters created for a customer | |
US11172022B2 (en) | Migrating cloud resources | |
US10148736B1 (en) | Executing parallel jobs with message passing on compute clusters | |
US11368407B2 (en) | Failover management using availability groups | |
US10445121B2 (en) | Building virtual machine disk images for different cloud configurations from a single generic virtual machine disk image | |
US20170006119A1 (en) | Integrated user interface for consuming services across different distributed networks | |
US11544344B2 (en) | Remote web browsing service | |
US20160352836A1 (en) | Migrating cloud resources | |
US11102278B2 (en) | Method for managing a software-defined data center implementing redundant cloud management stacks with duplicate API calls processed in parallel | |
US10673694B2 (en) | Private network mirroring | |
JP2024079760A (en) | Cloud service for cross-cloud operations | |
US9591079B2 (en) | Method and apparatus for managing sessions of different websites | |
US11570048B2 (en) | Declarative language and compiler for provisioning and deploying data centers on cloud platforms | |
CN112527376B (en) | Method for realizing DevOps automation based on reverse proxy service | |
US11093477B1 (en) | Multiple source database system consolidation | |
JP2017021667A (en) | System and control method | |
US11240107B1 (en) | Validation and governance of a cloud computing platform based datacenter | |
US11290318B2 (en) | Disaster recovery of cloud resources | |
CN111596953B (en) | Version management system, development data transmission control method and related device | |
EP3788747B1 (en) | Private network mirroring | |
US11050847B1 (en) | Replication of control plane metadata | |
US11157454B2 (en) | Event-based synchronization in a file sharing environment | |
CN115485677A (en) | Secure data replication in a distributed data storage environment |
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 | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40023535 Country of ref document: HK |
|
GR01 | Patent grant | ||
GR01 | Patent grant |