CN107864053B - Zookeeper-based dynamic configuration method and device - Google Patents

Zookeeper-based dynamic configuration method and device Download PDF

Info

Publication number
CN107864053B
CN107864053B CN201711043234.4A CN201711043234A CN107864053B CN 107864053 B CN107864053 B CN 107864053B CN 201711043234 A CN201711043234 A CN 201711043234A CN 107864053 B CN107864053 B CN 107864053B
Authority
CN
China
Prior art keywords
service interface
node
zookeeper
configuration information
service
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
Application number
CN201711043234.4A
Other languages
Chinese (zh)
Other versions
CN107864053A (en
Inventor
张旭华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201711043234.4A priority Critical patent/CN107864053B/en
Publication of CN107864053A publication Critical patent/CN107864053A/en
Application granted granted Critical
Publication of CN107864053B publication Critical patent/CN107864053B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/0816Configuration setting characterised by the conditions triggering a change of settings the condition being an adaptation, e.g. in response to network events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Abstract

The present disclosure relates to a zookeeper-based dynamic configuration method and apparatus, the method comprising: monitoring nodes on a zookeeper connected with the service interfaces, wherein each service interface is connected with at least one node; under the condition that the content of the node is monitored to be changed, the service interface acquires the changed content from the node, wherein the content of the node comprises configuration information of the service interface; and the service interface transmits the changed content to a corresponding server so that the server corresponding to the service interface adjusts the configuration information of the service interface. According to the method, the service interfaces are connected with the nodes on the zookeeper, each service interface is connected with at least one node, the nodes on the zookeeper are monitored through the service interfaces, changed node contents are obtained, configuration information of the service interfaces is adjusted according to the changed node contents, and based on the flexibility of the zookeeper, the service interfaces of different application services belonging to different servers can be flexibly configured.

Description

Zookeeper-based dynamic configuration method and device
Technical Field
The present disclosure relates to the field of distributed server technologies, and in particular, to a zookeeper-based dynamic configuration method and apparatus.
Background
When services are deployed in a distributed manner, there is often a need that some services deployed on some machines need to dynamically adjust parameters, such as log output, thresholds involved in programs, and the like, and many existing methods modify open configuration functions of web containers corresponding to programs on the machines, such as JMX (Java Management Extensions) of Java, in the JMX specification, Management components are defined as follows: it is a Java object that can represent management resources, and complies with a certain design model, and needs to implement a specific interface defined by the specification. This definition ensures that all management components represent managed resources in a standard way. However, if there are many machines, it is inconvenient to modify the machines by conventional modification, and the possibility of error is high in the case where the configurations of the machines are different.
Disclosure of Invention
In order to overcome the problems in the related art, the disclosure provides a zookeeper-based dynamic configuration method and device, which are used for improving the configuration efficiency and success rate of dynamically configuring various application services in a distributed server.
According to a first aspect of the embodiments of the present disclosure, there is provided a zookeeper-based dynamic configuration method, including:
monitoring nodes on a zookeeper connected with the service interfaces, wherein each service interface is connected with at least one node;
under the condition that the content of the node is monitored to be changed, the service interface acquires the changed content from the node, wherein the content of the node comprises configuration information of the service interface;
and the service interface transmits the changed content to a corresponding server so that the server corresponding to the service interface adjusts the configuration information of the service interface.
In one possible implementation, the obtaining the changed content from the node includes:
acquiring a changed threshold adjusting instruction, wherein the threshold adjusting instruction comprises a parameter to be adjusted and an adjusted threshold;
the step of transmitting the changed content to a corresponding server by the service interface so that the server corresponding to the service interface adjusts the configuration information of the service interface includes: and the service interface transmits the threshold value adjusting instruction to a corresponding server so that the server corresponding to the service interface adjusts the threshold value of the parameter to be adjusted of the service interface to the adjusted threshold value.
In one possible implementation, the obtaining the changed content from the node includes: acquiring the changed executable code;
the step of transmitting the changed content to a corresponding server by the service interface so that the server corresponding to the service interface adjusts the configuration information of the service interface includes: and the service interface transmits the executable code to a corresponding server so as to enable the server corresponding to the service interface to execute the executable code.
In one possible implementation, the method further includes:
the service interface acquires configuration information to be registered;
searching a node matched with the configuration information to be registered according to the configuration information to be registered and the content of the node on the zookeeper;
and the service interface registers on the matched node and establishes connection with the matched node.
According to a second aspect of the embodiments of the present disclosure, there is provided a zookeeper-based dynamic configuration method, including:
acquiring a dynamic configuration instruction, wherein the dynamic configuration instruction comprises an identifier of a service interface to be configured and information to be configured;
searching a node corresponding to the identifier on the zookeeper according to the corresponding relation between the node and the service interface, wherein the corresponding relation comprises the corresponding relation between the node on the zookeeper and the service interface on the server;
and modifying the content of the searched node according to the information to be configured.
According to a third aspect of the embodiments of the present disclosure, there is provided a zookeeper-based dynamic configuration apparatus, applied to a service interface, the apparatus including:
the monitoring module is used for monitoring nodes on the zookeeper connected with the monitoring module, wherein each service interface is connected with at least one node;
a first obtaining module, configured to obtain, from the node, changed content when it is monitored that content of the node changes, where the content of the node includes configuration information of a service interface;
and the first transmission module is used for transmitting the changed content to a corresponding server so that the server corresponding to the service interface adjusts the configuration information of the service interface.
In one possible implementation manner, the first obtaining module includes: the first obtaining submodule is used for obtaining a changed threshold adjusting instruction, and the threshold adjusting instruction comprises a parameter to be adjusted and an adjusted threshold;
the first transfer module includes: and the first transmission submodule is used for transmitting the threshold value adjusting instruction to a corresponding server by the service interface so as to enable the server corresponding to the service interface to adjust the threshold value of the parameter to be adjusted of the service interface to the adjusted threshold value.
In a possible implementation manner, the first obtaining module further includes: the second acquisition submodule is used for acquiring the changed executable code;
the first transfer module includes: and the second transmission submodule is used for transmitting the executable code to the corresponding server by the service interface so as to enable the server corresponding to the service interface to execute the executable code.
In one possible implementation manner, the method further includes:
the second acquisition module is used for acquiring the configuration information to be registered;
the matching module is used for searching a node matched with the configuration information to be registered according to the configuration information to be registered and the content of the node on the zookeeper;
and the registration module is used for registering on the matched node and establishing connection with the matched node.
According to a fourth aspect of embodiments of the present disclosure, there is provided a zookeeper-based dynamic configuration apparatus, including:
the third acquisition module is used for acquiring a dynamic configuration instruction, wherein the dynamic configuration instruction comprises an identifier of a service interface to be configured and information to be configured;
the searching module is used for searching a node corresponding to the identifier on the zookeeper according to the corresponding relation between the node and the service interface, wherein the corresponding relation comprises the corresponding relation between the node on the zookeeper and the service interface on the server;
and the node content modifying module is used for modifying the content of the searched node according to the information to be configured.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
according to the method, the service interfaces are connected with the nodes on the zookeeper, each service interface is connected with at least one node, the nodes on the zookeeper are monitored through the service interfaces, changed node contents are obtained, configuration information of the service interfaces is adjusted according to the changed node contents, and based on the flexibility of the zookeeper, the service interfaces of different application services belonging to different servers can be flexibly configured.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flow diagram illustrating a zookeeper-based dynamic configuration method in accordance with an exemplary embodiment.
Fig. 2 is a flow diagram illustrating a zookeeper-based dynamic configuration method in accordance with an exemplary embodiment.
Fig. 3 is a flow chart illustrating a zookeeper-based dynamic configuration method in accordance with an exemplary embodiment.
Fig. 4 is a flowchart illustrating a zookeeper-based dynamic configuration method in accordance with an exemplary embodiment.
Fig. 5 is a flowchart illustrating a zookeeper-based dynamic configuration method in accordance with an exemplary embodiment.
Fig. 6 is a block diagram illustrating a zookeeper-based dynamic configuration apparatus according to an exemplary embodiment.
Fig. 7 is a block diagram illustrating a zookeeper-based dynamic configuration apparatus according to an exemplary embodiment.
Fig. 8 is a block diagram illustrating a zookeeper-based dynamic configuration apparatus according to an exemplary embodiment.
Fig. 9 is a schematic diagram illustrating the connection of a service interface to a zookeeper node in accordance with an exemplary embodiment.
Fig. 10 is a block diagram illustrating a dynamic configuration apparatus for zookeeper-based, according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flow diagram illustrating a zookeeper-based dynamic configuration method in accordance with an exemplary embodiment. As shown in fig. 1, the zookeeper-based dynamic configuration method is used in a server, and includes the following steps:
step S10, the service interfaces monitor nodes on the zookeeper connected with the service interfaces, wherein each service interface is connected with at least one node.
For example, data and programs of an application service may not be on the same server, but rather distributed across multiple distributed servers. Each application service may have multiple service interfaces. The service interface of the application service such as "mobile panning", includes "micro panning", "message", "shopping cart" and "my panning", etc.
A zookeeper service is initiated. Defining nodes on a tree-shaped zookeeper according to the server, the application service and the service interface, and registering each server, each application service and each service interface to different nodes on the zookeeper respectively. In order to enable each application service to distinguish between the different servers it is located, the server to which it is deployed is specified in its parameters as each application service is deployed. The application service then registers with the node on the zookeeper according to the designated server node.
It will be appreciated that the zookeeper service is implemented by way of a software program, and may be located in a separate distributed server, or in the same server as the application service.
Each application service may include a plurality of service interfaces, each service interface being connected to at least one node, each node being connected to at least one service interface. The service interface monitors the zookeeper node connected with the service interface by establishing the long connection, and the monitoring period can be set according to the actual requirement, for example, the monitoring period is set to be 8 seconds to monitor the node once. As shown in fig. 9, the application service _1 includes a service interface _ a and a service interface _ b, and the application service _2 includes a service interface _ c and a service interface _ d. zookeeper includes node _1, node _2, and node _3, and service interface _ a connects node _1 and node _ 3. The service interface _ a can listen to the node _1, the node _ 3.
Step S20, when it is monitored that the content of the node changes, the service interface acquires the changed content from the node, and the content of the node includes configuration information of the service interface.
For example, the configuration information is independent of the service provided by the application service, and does not affect the actual use of the application service. The service interface of the application service, such as the mobile phone Taobao, comprises micro-Taobao, message, shopping cart and My Taobao. If the configuration information of the service interface "my panning" needs to be modified, for example, the data transmission rate of the service interface "my panning" is modified, and the like, the service provided by the service interface itself is not affected. When the content in the node is not changed, each application service performs respective default operation and does not depend on zookeeper completely.
In the process that the service interface monitors the node, the service interface records the content in the node, when the content in the node monitored by the service interface is different from the recorded node content, the content of the node is judged to be changed, and the service interface acquires the changed content from the node.
Step S30, the service interface transmits the changed content to a corresponding server, so that the server corresponding to the service interface adjusts the configuration information of the service interface.
For example, the service interface itself cannot adjust the configuration information, and needs to transmit the acquired content of the node to the server, and the server performs corresponding adjustment in the background.
In this embodiment, the service interfaces are connected to nodes on the zookeeper, and each service interface is connected to at least one node. And monitoring the nodes on the zookeeper through the service interface, acquiring the changed node content, and correspondingly adjusting the configuration information of the zookeeper according to the changed node content. Based on the flexibility of the zookeeper, service interfaces of different application services belonging to different servers can be flexibly configured.
Fig. 2 is a flowchart illustrating a zookeeper-based dynamic configuration method according to an exemplary embodiment, where, as shown in fig. 2, the zookeeper-based dynamic configuration method is used in a server, and includes the following steps:
step S10, the service interfaces monitor nodes on the zookeeper connected with the service interfaces, wherein each service interface is connected with at least one node.
Step S21, when it is monitored that the content of the node changes, the service interface acquires the changed content from the node, including acquiring a changed threshold adjustment instruction, where the threshold adjustment instruction includes a parameter to be adjusted and an adjusted threshold.
For example, the changed content acquired by the service interface in the node includes an adjustment instruction, such as a threshold adjustment instruction, an adjustment interface connection rate, an adjustment of the maximum number returned by the request, and the like.
If various problems occur in the system where the application service is located and the connection rate of the service interface needs to be adjusted down, the content in the node connected with the service interface is changed into an interface connection rate adjustment instruction and the adjusted rate is given.
The contents in the node are stored by using various high-level general-purpose languages of the computer which can be read by the service interface.
Step S31, the service interface transmits the threshold adjustment instruction to a corresponding server, so that the server corresponding to the service interface adjusts the threshold of the parameter to be adjusted of the service interface to the adjusted threshold.
For example, after the threshold adjustment instruction is transmitted to the server, the server may modify the configuration information of the server interface in the background.
In this embodiment, after obtaining the threshold adjustment instruction in the node, the service interface transmits the threshold adjustment instruction to the background, and the server executes the threshold adjustment instruction in the background, so as to modify the configuration information of the service interface. Configuration information on different service interfaces of different application services can be conveniently adjusted through modifying the content of the nodes on the zookeeper, and the success rate of dynamic configuration is improved.
Fig. 3 is a flowchart illustrating a zookeeper-based dynamic configuration method according to an exemplary embodiment, where, as shown in fig. 2, the zookeeper-based dynamic configuration method is used in a server, and includes the following steps:
step S10, the service interfaces monitor nodes on the zookeeper connected with the service interfaces, wherein each service interface is connected with at least one node.
Step S22, in the case that it is monitored that the content of the node changes, the service interface acquires the changed content from the node, including: the changed executable code is obtained.
For example, the content of the node includes a piece of executable code, and if dotting needs to be performed in the background, the content in the node may include a piece of executable code.
Step S32, the service interface transmits the executable code to a corresponding server, so that the server corresponding to the service interface executes the executable code.
For example, the executable code is transmitted to the server, the server executes the executable code in the background, data dotting is completed, and configuration information of the service interface is modified.
In this embodiment, after the service interface obtains the executable code from the node, the service interface transmits the executable code to the background, and the server executes the executable code, so that the configuration information of the service interface can be modified. Configuration information on different service interfaces of different application services can be conveniently adjusted through modifying the content of the nodes on the zookeeper, and the success rate of dynamic configuration is improved.
Fig. 4 is a flowchart illustrating a zookeeper-based dynamic configuration method according to an exemplary embodiment, where as shown in fig. 4, the method further includes the following steps according to the above-mentioned embodiment:
step S40, the service interface acquires configuration information to be registered.
For example, after the application service itself is updated or upgraded, the service interface of the application service may be changed. If the application service has a new service interface, the new service interface has new configuration information, or the original service interface of the application service has new configuration information. New configuration information needs to be connected to the node to enable the service interface to monitor the content on the node. The new configuration information is the configuration information to be registered.
Step S50, searching for a node matched with the configuration information to be registered according to the configuration information to be registered and the content of the node on the zookeeper.
For example, the content of the nodes on the zookeeper is known information that can be queried by the service interface, and the content of each node on the zookeeper service can be queried by the service interface.
If the configuration information to be registered already exists in the contents of the nodes on the zookeeper, searching the contents on the nodes according to the configuration information to be registered, and determining the nodes matched with the configuration information to be registered.
If the configuration information to be registered does not exist in the content of the existing zookeeper upper node, the node matched with the configuration information to be registered can be determined in a mode of newly building the node.
And step S60, the service interface registers on the matched node and establishes connection with the matched node.
For example, a registration request message may be sent to a node by a serving node, where the registration request message carries configuration information to be registered, information of an application service to which the serving node belongs, and information of a server to which the serving node belongs, and the node adds corresponding content to the content of the node to complete registration, and establishes a connection between the serving interface and the node.
In this embodiment, when the service interface has configuration information to be registered, the service interface queries a node matched with the configuration information to be registered, and registers on the queried node, and a monitoring connection is established between the service interface and the node, so that the registered service interface can perform dynamic configuration through the registered node.
Fig. 5 is a flowchart illustrating a zookeeper-based dynamic configuration method according to an exemplary embodiment, as shown in fig. 5, the zookeeper-based dynamic configuration method including the steps of:
step S1, acquiring a dynamic configuration instruction, where the dynamic configuration instruction includes an identifier of a service interface to be configured and information to be configured.
For example, when dynamic configuration is required by using zookeeper, only the identifier of the service interface to be configured and information to be configured need to be known, and configuration on a server where the service interface is located is not required.
In order to facilitate the user to input the dynamic configuration information, a dynamic configuration page can be set on the zookeeper service, and different options are provided for the user to select so as to obtain the dynamic configuration information.
Step S2, searching a node corresponding to the identifier on the zookeeper according to the corresponding relation between the node and the service interface, wherein the corresponding relation comprises the corresponding relation between the node on the zookeeper and the service interface on the server.
For example, according to the obtained dynamic configuration information and the known corresponding relationship between the node and the service interface, the node corresponding to the service interface can be found. The corresponding relation between the nodes and the service interface comprises the connection relation between the nodes with zookeeper number and the content on each node.
And step S3, modifying the content of the searched node according to the information to be configured.
For example, the found content of the corresponding node is modified directly according to the information to be configured, so that the service interface monitoring the node can acquire the modified content of the node, and the dynamic configuration is completed.
In this embodiment, when a service interface needs to be dynamically configured, after a node is searched for through an identifier of the service interface and information to be configured, content in the node is modified, and the service interface of the node is monitored to obtain the modified content, so that dynamic configuration can be completed, configuration information of different service interfaces can be modified conveniently, efficiently and accurately, and the service interface can belong to different application services of different servers.
Fig. 6 is a block diagram illustrating a structure of a zookeeper-based dynamic configuration apparatus according to an exemplary embodiment, as shown in fig. 6, the apparatus including:
the monitoring module 10 is used for monitoring nodes on a zookeeper connected with the monitoring module, wherein each service interface is connected with at least one node;
a first obtaining module 20, configured to obtain, when it is monitored that content of the node changes, changed content from the node, where the content of the node includes configuration information of a service interface;
the first transmitting module 30 is configured to transmit the changed content to a corresponding server, so that the server corresponding to the service interface adjusts the configuration information of the service interface.
In this embodiment, the service interfaces are connected with the nodes on the zookeeper, each service interface is connected with at least one node, the nodes on the zookeeper are monitored through the service interfaces, changed node contents are acquired, configuration information of the service interfaces is adjusted according to the changed node contents, and based on the flexibility of the zookeeper, the service interfaces of different application services belonging to different servers can be flexibly configured.
Fig. 7 is a block diagram illustrating a structure of a zookeeper-based dynamic configuration apparatus according to an exemplary embodiment, and as shown in fig. 7, it is different from the above-described embodiment in that:
the first obtaining module 20 includes: the first obtaining submodule 21 is configured to obtain a changed threshold adjusting instruction, where the threshold adjusting instruction includes a parameter to be adjusted and an adjusted threshold;
the first transfer module 30 includes: the first transmission submodule 31 is configured to transmit the threshold adjustment instruction to a corresponding server by the service interface, so that the server corresponding to the service interface adjusts the threshold of the parameter to be adjusted of the service interface to the adjusted threshold.
In a possible implementation manner, the first obtaining module 20 further includes: a second obtaining submodule 22, configured to obtain the changed executable code;
the first transfer module 30 includes: and the second transmission submodule 32 is configured to transmit the executable code to the corresponding server by the service interface, so that the server corresponding to the service interface executes the executable code.
In one possible implementation manner, the method further includes:
a second obtaining module 40, configured to obtain configuration information to be registered;
the matching module 50 is used for searching a node matched with the configuration information to be registered according to the configuration information to be registered and the content of the node on the zookeeper;
and a registering module 60, configured to register on the matched node and establish a connection with the matched node.
Fig. 8 is a block diagram illustrating a zookeeper-based dynamic configuration apparatus according to an exemplary embodiment.
The zookeeper-based dynamic configuration apparatus as shown in fig. 8 includes:
a third obtaining module 1, configured to obtain a dynamic configuration instruction, where the dynamic configuration instruction includes an identifier of a service interface to be configured and information to be configured;
the searching module 2 is used for searching a node corresponding to the identifier on the zookeeper according to the corresponding relation between the node and the service interface, wherein the corresponding relation comprises the corresponding relation between the node on the zookeeper and the service interface on the server;
and the node content modifying module 3 is used for modifying the content of the searched node according to the information to be configured.
In this embodiment, when a service interface needs to be dynamically configured, after a node is searched for through an identifier of the service interface and information to be configured, content in the node is modified, and the service interface of the node is monitored to obtain the modified content, so that dynamic configuration can be completed, configuration information of different service interfaces can be modified conveniently, efficiently and accurately, and the service interface can belong to different application services of different servers.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 10 is a block diagram illustrating a device 1900 for zookeeper-based dynamic configuration according to an example embodiment. For example, the apparatus 1900 may be provided as a server. Referring to FIG. 10, the device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by the processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The device 1900 may also include a power component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input/output (I/O) interface 1958. The device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided that includes instructions, such as the memory 1932 that includes instructions, which are executable by the processing component 1922 of the apparatus 1900 to perform the above-described method. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (4)

1. A zookeeper-based dynamic configuration method is characterized by comprising the following steps:
the service interface acquires configuration information to be registered;
if the configuration information to be registered already exists in the contents of the nodes on the zookeeper, searching the contents on the nodes according to the configuration information to be registered, and determining the nodes matched with the configuration information to be registered;
if the configuration information to be registered does not exist in the content of the existing zookeeper upper node, determining a node matched with the configuration information to be registered in a mode of newly building a node;
the service interface registers on the matched node and establishes connection with the matched node;
monitoring nodes on a zookeeper connected with the service interface, wherein each service interface is connected with at least one node, and each node is connected with at least one service interface;
in case of monitoring that the content of the node changes, performing one of the following operations, wherein the content of the node includes configuration information of the service interface:
the service interface acquires a changed threshold value adjusting instruction, wherein the threshold value adjusting instruction comprises a parameter to be adjusted and an adjusted threshold value; the service interface transmits the threshold value adjusting instruction to a corresponding server so that the server corresponding to the service interface adjusts the threshold value of the parameter to be adjusted of the service interface to the adjusted threshold value;
the service interface acquires the changed executable code; the service interface transmits the executable code to a corresponding server so that the server corresponding to the service interface executes the executable code;
wherein a plurality of service interfaces of the same service are distributed on different servers.
2. A zookeeper-based dynamic configuration device applied to a service interface, the device comprising:
the second acquisition module is used for acquiring the configuration information to be registered;
a matching module to: if the configuration information to be registered already exists in the contents of the nodes on the zookeeper, searching the contents on the nodes according to the configuration information to be registered, and determining the nodes matched with the configuration information to be registered; if the configuration information to be registered does not exist in the content of the existing zookeeper upper node, determining a node matched with the configuration information to be registered in a mode of newly building a node;
the registration module is used for registering on the matched nodes and establishing connection with the matched nodes;
the monitoring module is used for monitoring nodes on the zookeeper connected with the monitoring module, wherein each service interface is connected with at least one node, and each node is connected with at least one service interface;
a first obtaining module, configured to obtain, from the node, changed content when it is monitored that content of the node changes, where the content of the node includes configuration information of a service interface;
the first transmission module is used for transmitting the changed content to a corresponding server so that the server corresponding to the service interface adjusts the configuration information of the service interface;
wherein the first obtaining module comprises: the first obtaining submodule is used for obtaining a changed threshold adjusting instruction, and the threshold adjusting instruction comprises a parameter to be adjusted and an adjusted threshold; the first transfer module includes: the first transmission submodule is used for the service interface to transmit the threshold value adjusting instruction to a corresponding server so that the server corresponding to the service interface adjusts the threshold value of the parameter to be adjusted of the service interface into the adjusted threshold value; or
The first obtaining module comprises: the second acquisition submodule is used for acquiring the changed executable code; the first transfer module includes: the second transmission submodule is used for the service interface to transmit the executable code to a corresponding server so as to enable the server corresponding to the service interface to execute the executable code;
wherein a plurality of service interfaces of the same service are distributed on different servers.
3. A zookeeper-based dynamic configuration apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: the steps of the method of claim 1 are performed.
4. A non-transitory computer readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the method of claim 1.
CN201711043234.4A 2017-10-31 2017-10-31 Zookeeper-based dynamic configuration method and device Active CN107864053B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711043234.4A CN107864053B (en) 2017-10-31 2017-10-31 Zookeeper-based dynamic configuration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711043234.4A CN107864053B (en) 2017-10-31 2017-10-31 Zookeeper-based dynamic configuration method and device

Publications (2)

Publication Number Publication Date
CN107864053A CN107864053A (en) 2018-03-30
CN107864053B true CN107864053B (en) 2022-02-22

Family

ID=61697983

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711043234.4A Active CN107864053B (en) 2017-10-31 2017-10-31 Zookeeper-based dynamic configuration method and device

Country Status (1)

Country Link
CN (1) CN107864053B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108566293B (en) * 2018-03-06 2021-05-18 平安科技(深圳)有限公司 Electronic device, zk node information notification method, and storage medium
CN109245914B (en) * 2018-08-06 2023-11-24 深圳市重投华讯太赫兹科技有限公司 Dynamic configuration method, parameter monitoring terminal and parameter configuration terminal
CN110830528B (en) * 2018-08-07 2023-06-02 北京京东尚科信息技术有限公司 Method and device for controlling distributed timing switch
CN109714188B (en) * 2018-11-02 2023-06-20 中国平安人寿保险股份有限公司 Configuration data management method, device and storage medium based on Zookeeper
CN109710878A (en) * 2018-12-28 2019-05-03 北京百佑科技有限公司 Data interactive method and server
CN111381897A (en) * 2018-12-28 2020-07-07 北京字节跳动网络技术有限公司 Interface calling method and device, mobile terminal and storage medium
CN111884844A (en) * 2020-07-20 2020-11-03 中国建设银行股份有限公司 Message service access method and device based on zookeeper

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104486108A (en) * 2014-12-08 2015-04-01 畅捷通信息技术股份有限公司 Node configuration method base on Zookeeper and node configuration system based on Zookeeper
CN106453501A (en) * 2016-09-09 2017-02-22 北京奇虎科技有限公司 Method and apparatus for modifying configuration information of service

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9135269B2 (en) * 2011-12-07 2015-09-15 Egnyte, Inc. System and method of implementing an object storage infrastructure for cloud-based services
CN103312809A (en) * 2013-06-24 2013-09-18 北京汉柏科技有限公司 Distributed management method for service in cloud platform
CN106789307B (en) * 2016-12-30 2019-12-03 腾讯科技(深圳)有限公司 Configuration data processing method, apparatus and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104486108A (en) * 2014-12-08 2015-04-01 畅捷通信息技术股份有限公司 Node configuration method base on Zookeeper and node configuration system based on Zookeeper
CN106453501A (en) * 2016-09-09 2017-02-22 北京奇虎科技有限公司 Method and apparatus for modifying configuration information of service

Also Published As

Publication number Publication date
CN107864053A (en) 2018-03-30

Similar Documents

Publication Publication Date Title
CN107864053B (en) Zookeeper-based dynamic configuration method and device
US11258667B2 (en) Network management method and related device
EP3595244B1 (en) Network slice management method, unit and system
US20220075610A1 (en) Node selection method and apparatus
US10187272B2 (en) Interface management service entity, function service entity, and element management method
US11070433B2 (en) Network function NF management method and NF management device
WO2020087948A1 (en) Network slice template generation method, apparatus and device, and storage medium
US20230008647A1 (en) Connection establishment method, communication apparatus, and system
US20230283470A1 (en) Service Request Handling
CN106936660B (en) Data acquisition method and device
CN114726789A (en) Method, device, equipment and medium for traffic management and traffic management policy configuration
US20210250853A1 (en) Cellular telecommunications network comprising a plurality of network slices
CN111240904A (en) Database backup method and device, electronic equipment and storage medium
US11419045B2 (en) Automatic evaluation and management of slice reselection experiences
US11533596B2 (en) API publish method and apparatus
GB2574815A (en) Cellular telecommunications network
CN110650071B (en) Access management method and device of user equipment and management server
US20220369212A1 (en) Discovery of Which NEF or AF is Serving a UE
WO2023216960A1 (en) Data processing method and apparatus, core network node, electronic device, and storage medium
WO2023213288A1 (en) Model acquisition method and communication device
CN109729530B (en) Cell establishing method and device
CN116828444A (en) Information acquisition method and device
WO2020239659A1 (en) Radio link templates
WO2022057998A1 (en) Apparatus, method, and computer program
CN117750394A (en) Target information and information acquisition method, device and equipment

Legal Events

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