CN115022175A - Configuration information synchronization method and device - Google Patents

Configuration information synchronization method and device Download PDF

Info

Publication number
CN115022175A
CN115022175A CN202210703788.7A CN202210703788A CN115022175A CN 115022175 A CN115022175 A CN 115022175A CN 202210703788 A CN202210703788 A CN 202210703788A CN 115022175 A CN115022175 A CN 115022175A
Authority
CN
China
Prior art keywords
configuration information
address
server
level access
access server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210703788.7A
Other languages
Chinese (zh)
Inventor
杨飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
ICBC Technology Co Ltd
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
ICBC Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC, ICBC Technology Co Ltd filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202210703788.7A priority Critical patent/CN115022175A/en
Publication of CN115022175A publication Critical patent/CN115022175A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • 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/085Retrieval of network configuration; Tracking network configuration history
    • H04L41/0853Retrieval of network configuration; Tracking network configuration history by actively collecting configuration information or by backing up configuration information

Abstract

The invention provides a method and a device for synchronizing configuration information, which can be used in the financial field or other technical fields. The method comprises the following steps: accessing a database and acquiring session information of the database; acquiring an IP address of at least one server from the session information; and if the situation that the configuration information corresponding to the IP address does not exist is judged and known according to the IP address of the at least one server, sending a configuration information synchronization request based on the IP address where the configuration information does not exist so as to synchronize the configuration information. The device is used for executing the method. The configuration information synchronization method and device provided by the embodiment of the invention improve the timeliness of configuration information synchronization.

Description

Configuration information synchronization method and device
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for synchronizing configuration information.
Background
Currently, a configuration management system is set to manage configuration information of a production environment, where the configuration information includes software information, ledger information, and the like.
As time goes on, the configuration information of the production environment changes, for example, the software version is updated, a new database user is created, and offline processing is performed due to business atrophy, so that the configuration information of the production environment changes. In the prior art, a regular organizer is required to check the configuration information of the production environment, and when the configuration information of the production environment is found to be different from the configuration information in the configuration management system, the configuration information of the production environment and the configuration information in the configuration management system are synchronized. Since the synchronization process of the configuration information requires manual discovery and synchronization, and there is a problem that the update of the configuration information is delayed, how to synchronize the configuration information in time becomes an important problem to be solved in the field.
Disclosure of Invention
To solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for synchronizing configuration information, which can at least partially solve the problems in the prior art.
In a first aspect, the present invention provides a method for synchronizing configuration information, including:
accessing a database and acquiring session information of the database;
acquiring the IP address of at least one server from the session information;
and if the situation that the configuration information corresponding to the IP address does not exist is judged and known according to the IP address of the at least one server, sending a configuration information synchronization request based on the IP address where the configuration information does not exist so as to synchronize the configuration information.
In a second aspect, the present invention provides a device for synchronizing configuration information, including:
the first acquisition module is used for accessing the database and acquiring the session information of the database;
a second obtaining module, configured to obtain an IP address of at least one server from the session information;
and the sending module is used for sending a configuration information synchronization request based on the IP address without the configuration information to synchronize the configuration information if the condition that the configuration information corresponding to the IP address does not exist is judged and known according to the IP address of the at least one server.
In a third aspect, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method for synchronizing the configuration information according to any of the above embodiments when executing the computer program.
In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method for synchronizing configuration information according to any of the embodiments described above.
In a fifth aspect, the present invention provides a computer program product, the computer program product comprising a computer program, and the computer program when executed by a processor implements the method for synchronizing configuration information according to any of the above embodiments.
The configuration information synchronization method and device provided by the embodiment of the invention access the database and acquire the session information of the database; acquiring an IP address of at least one server from the session information; if the situation that the configuration information corresponding to the IP address does not exist is judged and known according to the IP address of the at least one server, the configuration information synchronization request is sent based on the IP address where the configuration information does not exist so as to synchronize the configuration information, the missing configuration information can be actively discovered and synchronized, and the timeliness of the configuration information synchronization is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
fig. 1 is a flowchart illustrating a method for synchronizing configuration information according to a first embodiment of the present invention.
Fig. 2 is a flowchart illustrating a method for synchronizing configuration information according to a second embodiment of the present invention.
Fig. 3 is a flowchart illustrating a method for synchronizing configuration information according to a third embodiment of the present invention.
Fig. 4 is a flowchart illustrating a synchronization method for configuration information according to a fourth embodiment of the present invention.
Fig. 5 is a flowchart illustrating a synchronization method for configuration information according to a fifth embodiment of the present invention.
Fig. 6 is a flowchart illustrating a method for synchronizing configuration information according to a sixth embodiment of the present invention.
Fig. 7 is a schematic structural diagram of a configuration information synchronization apparatus according to a seventh embodiment of the present invention.
Fig. 8 is a schematic structural diagram of a synchronization apparatus for configuration information according to an eighth embodiment of the present invention.
Fig. 9 is a schematic structural diagram of a synchronization apparatus for configuration information according to a ninth embodiment of the present invention.
Fig. 10 is a schematic structural diagram of a configuration information synchronization apparatus according to a tenth embodiment of the present invention.
Fig. 11 is a schematic structural diagram of a configuration information synchronization apparatus according to an eleventh embodiment of the present invention.
Fig. 12 is a schematic structural diagram of a configuration information synchronization apparatus according to a twelfth embodiment of the present invention.
Fig. 13 is a schematic physical structure diagram of an electronic device according to a thirteenth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
In order to facilitate understanding of the technical solutions provided in the present application, the following first describes relevant contents of the technical solutions in the present application.
The production environment is as follows: systems that have provided services to customers all belong to the production environment. The system which does not provide service for the client yet still is in the research and development testing stage, does not belong to the production environment, and belongs to the development testing environment.
Configuring a management system: one of the core functions of the configuration management system is to manage configuration information of the production environment, including software information deployed on the server, such as MySQL, Mongodb, Redis, Tomcat, Nginx, Kafka, and the like. Besides, the system also comprises account information, such as IP address, service port, service user name, server resource configuration and the like.
The following describes a specific implementation process of the configuration information synchronization method provided in the embodiment of the present invention, taking a configuration management server as an execution subject. The configuration management server is a server in which the configuration management system is deployed.
Fig. 1 is a schematic flowchart of a synchronization method for configuration information according to a first embodiment of the present invention, and as shown in fig. 1, the synchronization method for configuration information according to the embodiment of the present invention includes:
s101, accessing a database and acquiring session information of the database;
specifically, the configuration management server may access the database and acquire Session (Session) information of the database. The configuration management server can be connected with the database through the account number and the password of the database to realize the access to the database. The Session information of the database stores the back-end application information of the currently accessed database, and the back-end application information comprises the IP address and the port number of the server.
S102, acquiring an IP address of at least one server from the session information;
specifically, the configuration management server may obtain an IP address of at least one server from the Session information. The IP address obtained from the Session information is the IP address of the server accessing the database.
S103, if the situation that the configuration information corresponding to the IP address does not exist is judged and known according to the IP address of the at least one server, sending a configuration information synchronization request based on the IP address where the configuration information does not exist so as to synchronize the configuration information.
Specifically, the configuration management server may determine, based on each IP address in the IP addresses of the at least one server, whether configuration information corresponding to the IP address exists in the configuration management server, if the corresponding configuration information cannot be queried in the configuration management server according to the IP address, the IP address is assigned to the IP address where the configuration information does not exist, and the configuration information of the server corresponding to the IP address needs to be synchronized to the configuration management server. The configuration management server sends a configuration information synchronization request to the server corresponding to the IP address to synchronize the configuration information, that is, the configuration information of the server corresponding to the IP address is synchronized to the configuration management server. It can be understood that, in the IP address of the at least one server, there may be configuration information corresponding to one IP address that is not present in the configuration information of the configuration management server, or there may be configuration information corresponding to a plurality of IP addresses that is not present in the configuration information of the configuration management server. The configuration management server sends a configuration information synchronization request to the server corresponding to each IP address. The configuration management server stores the configuration information of each server in correspondence with each IP address.
The configuration information synchronization method provided by the embodiment of the invention accesses the database and obtains the session information of the database; acquiring an IP address of at least one server from the session information; if the situation that the configuration information corresponding to the IP address does not exist is judged and known according to the IP address of the at least one server, the configuration information synchronization request is sent based on the IP address where the configuration information does not exist so as to synchronize the configuration information, the missing configuration information can be actively discovered and synchronized, and the timeliness of the configuration information synchronization is improved. In addition, the configuration information is synchronized without manual inspection, and the efficiency of configuration information synchronization is improved.
Fig. 2 is a schematic flow chart of a synchronization method for configuration information according to a second embodiment of the present invention, and as shown in fig. 2, on the basis of the foregoing embodiments, further, the synchronization method for configuration information according to the embodiment of the present invention further includes:
s201, accessing a current-level access server corresponding to each IP address according to each IP address in the IP addresses without the configuration information, and acquiring an IP address of a next-level access server accessing the current-level access server corresponding to each IP address;
specifically, for each IP address in the IP addresses for which the configuration information does not exist, the configuration management server accesses the server corresponding to the IP address according to the IP address, and the server corresponding to the IP address serves as the current-level access server at this time. And the configuration management server accesses the current-level server to acquire the IP addresses of other servers accessing the current-level server, and accesses the other servers of the current level as the next-level access server of the current-level access server. It will be appreciated that the configuration management server will not act as a next level access server to the current level access server.
For example, the configuration management server may access a server corresponding to the IP address through a Secure Shell (SSH).
For example, the IP address where the configuration information does not exist includes IP address 1 and IP address 2. The server corresponding to the IP address 1 and the server corresponding to the IP address 2 are taken as the current-level server. The configuration management server accesses the server corresponding to the IP address 1, obtains the IP address of the next-level access server of the server corresponding to the IP address 1, accesses the server corresponding to the IP address 2, and obtains the IP address of the next-level access server of the server corresponding to the IP address 2.
S202, if the situation that the configuration information corresponding to the IP address of the next-level access server does not exist is judged and known according to the IP address of each next-level access server, the next-level access server without the configuration information is used as the current-level server to continuously obtain the next-level access server without the configuration information until the next-level access server without the configuration information does not exist.
Specifically, for the IP address of each next-level access server, the configuration management server may determine whether the configuration management server has configuration information corresponding to the IP address of the next-level access server, and if the corresponding configuration information is not queried in the configuration management server according to the IP address of the next-level access server, which indicates that there is no configuration information corresponding to the IP address of the next-level access server, the next-level access server is the next-level access server whose configuration information does not exist. If the configuration information corresponding to the IP address of the next-level access server exists in the configuration information of the configuration management server, the next-level access server is not the next-level access server without the configuration information. Taking the next-level access server without the configuration information as the current-level server, repeating the process of accessing the IP address of the next-level access server of the current-level access server in step S201, and if the process of determining that the configuration information corresponding to the IP address of the next-level access server does not exist according to the IP address of each next-level access server in this step, obtaining the next-level access server without the configuration information, and so on until the next-level access server without the configuration information is not obtained.
For example, the IP addresses of the next-stage access server of the server corresponding to the IP address 1 are IP address 3, IP address 4, and IP address 5, respectively. The configuration management server respectively inquires corresponding configuration information in the configuration management server according to the IP address 4 and the IP address 5, but cannot inquire corresponding configuration information in the configuration management server according to the IP address 3, the server corresponding to the IP address 3 is taken as a current-level server, a next-level access server of the server corresponding to the IP address 3 is continuously acquired, if the IP address of the next-level access server of the server corresponding to the IP address 3 is the IP address 6, and the corresponding configuration information is inquired in the configuration management server according to the IP address 6, the next-level access server of the server corresponding to the IP address 6 is not continuously acquired. The processing procedure of the IP address of the next-level access server of the server corresponding to the IP address 2 is similar to the processing procedure of the IP address of the next-level access server of the server corresponding to the IP address 1, and is not described herein again.
S203, sending a configuration information synchronization request to the next-level access server without the existence of each configuration information so as to synchronize the configuration information.
Specifically, for all the next-level access servers where the obtained configuration information does not exist, the configuration management server sends a configuration information synchronization request to each next-level access server where the configuration information does not exist, so as to synchronize the configuration information, that is, synchronize the configuration information of the next-level access server where the configuration information does not exist to the configuration management server.
Fig. 3 is a schematic flowchart of a synchronization method for configuration information according to a third embodiment of the present invention, and as shown in fig. 3, on the basis of the foregoing embodiments, further, the accessing, according to each IP address in IP addresses where configuration information does not exist, a current-level access server corresponding to each IP address, and obtaining an IP address of a next-level access server accessing the current-level access server corresponding to each IP address includes:
s301, obtaining thread information corresponding to the port number on the current-level access server according to the port number; wherein the port number is obtained from the session information;
specifically, the configuration management server may obtain an IP address and a port number from Session information of the database, where the port number corresponds to the IP address. When the configuration management server accesses the current-level access server corresponding to the IP address, the configuration management server can obtain the thread information corresponding to the port number according to the port number query.
For example, the configuration management server checks the thread information corresponding to the port number of the current stage access server in the database session information through the Netstat command.
S302, acquiring process information corresponding to the port number according to the thread information corresponding to the port number;
specifically, the configuration management server may obtain process information corresponding to the thread according to the thread information corresponding to the port number, and use the process information corresponding to the thread as the process information corresponding to the port number. And acquiring the port number monitored by the process while acquiring the process information.
S303, according to the process information corresponding to the port number, the IP address of the next-level access server of the current-level access server is obtained.
Specifically, the configuration management server may obtain, according to the process information corresponding to the port number, an IP address of another server accessing the process, as an IP address of a next-level access server of the current-level access server. The port number of the next-level access server of the current-level access server can be obtained while the IP address of the next-level access server of the current-level access server is obtained.
For example, the configuration management server may query the IP address and port number of the other server in the access process by a Netstat command, and use the IP address and port number of the other server obtained by the query as the IP address and port number of the next-level access server of the current-level access server.
Fig. 4 is a schematic flowchart of a synchronization method for configuration information according to a fourth embodiment of the present invention, and as shown in fig. 4, on the basis of the foregoing embodiments, further, the sending a configuration information synchronization request based on an IP address where configuration information does not exist to synchronize the configuration information includes:
s401, sending the configuration information synchronization request to a server corresponding to an IP address without configuration information, so that the server corresponding to the IP address without configuration information installs a configuration information acquisition proxy plug-in; the configuration information synchronization request comprises a configuration information acquisition agent plug-in installation package;
specifically, the configuration management server sends a configuration information synchronization request to a server corresponding to an IP address where configuration information does not exist, where the configuration information synchronization request includes a configuration information acquisition proxy plug-in installation package, and the configuration information acquisition proxy plug-in installation package is used for installing a configuration information acquisition proxy plug-in. And after receiving the configuration information synchronization request, the server installs the configuration information acquisition proxy plug-in according to the configuration information acquisition proxy plug-in installation package. The configuration information acquisition agent plug-in installation package is set according to actual needs, and the embodiment of the invention is not limited.
For example, the configuration information collection proxy plug-ins may include a configuration update plug-in, a promemeus monitoring plug-in, and a Sky Walking plug-in. The configuration updating plug-in is used for collecting system configuration information and application software information of the server as configuration information of the server, wherein the system configuration information comprises but is not limited to a CPU, a disk, a memory, an IP (Internet protocol), an operating system version and the like, and the application software information comprises but is not limited to software type, version, service port, cluster configuration and the like. The Prometheus monitoring plug-in can acquire information such as the use condition of a disk, a CPU (central processing unit), an internal memory, SSL (secure sockets layer) expiration time, a database QPS (quick Path Server), Nginx request quantity and the like as configuration information of the server. The Prometheus monitoring plug-in can also carry an Alertmanager plug-in for summarizing alarm information of the server and converting the alarm information into configuration information, and can also extract alarm rules and alarm thresholds and convert the alarm rules and the alarm thresholds into the configuration information of the server. And the Sky Walking plug-in is used for converting the extracted interface list and the response time into configuration information for storage.
S402, receiving configuration information uploaded by a server corresponding to an IP address without configuration information, wherein the configuration information is acquired by the server corresponding to the IP address without configuration information through a configuration information acquisition proxy plug-in.
Specifically, after the server corresponding to the IP address for which the configuration information does not exist acquires the configuration information of the server through the configuration information acquisition proxy plug-in, the configuration information of the server is uploaded to the configuration management server. The configuration management server receives the configuration information uploaded by the server corresponding to the IP address without the configuration information, and stores the configuration information corresponding to the IP address of the server, so that the configuration information is updated.
It can be understood that, for the server installed with the configuration information collection proxy plug-in, the configuration management server may periodically call the configuration information collection proxy plug-in to update the configuration information.
On the basis of the foregoing embodiments, further, if it is determined that there is no configuration information corresponding to the IP address according to the IP address of the at least one server, the determining includes:
if the fact that the IP address in the IP addresses of the at least one server does not exist in the local configuration information is judged and known, the situation that the configuration information corresponding to the IP address does not exist exists.
Specifically, for each IP address of the IP addresses of the at least one server, the configuration management server locally queries whether configuration information corresponding to the IP address exists according to the IP address, and if configuration information corresponding to the IP address is not queried, the IP address is used as an IP address where configuration information does not exist, which indicates that the configuration information corresponding to the IP address does not exist. If the configuration information corresponding to the IP address is inquired, the IP address is not taken as the IP address without the configuration information.
Fig. 5 is a schematic flowchart of a synchronization method for configuration information according to a fifth embodiment of the present invention, and as shown in fig. 5, on the basis of the foregoing embodiments, further, the synchronization method for configuration information according to the embodiment of the present invention further includes:
s501, calling an application program interface of a configuration information acquisition proxy plug-in regularly to send a configuration information updating request;
specifically, the configuration management server may periodically call an application program interface of the configuration information acquisition proxy plug-in, send a configuration information update request, and each server deploying the configuration information acquisition proxy plug-in may receive the configuration information update request. The period is set according to actual needs, and the embodiment of the invention is not limited.
S502, receiving configuration information sent by each configuration information acquisition agent plug-in to update local configuration information.
Specifically, after each server deploying the configuration information acquisition agent plug-in receives the configuration information update request, the configuration information of the server is acquired through the locally deployed configuration information acquisition agent plug-in, and then the configuration information of the server is sent to the configuration management server through the configuration information acquisition agent plug-in. The configuration management server updates local configuration information based on the configuration information sent by each server deploying the configuration information acquisition proxy plug-in through the configuration information acquisition proxy plug-in, so as to realize automatic updating of the configuration information of each server stored by the configuration management server. The local configuration information is configuration information of each server stored by the configuration management server.
Fig. 6 is a schematic flowchart of a synchronization method for configuration information according to a sixth embodiment of the present invention, and as shown in fig. 6, on the basis of the foregoing embodiments, further, the synchronization method for configuration information according to the embodiment of the present invention further includes:
s601, receiving a configuration information change request;
specifically, the configuration management server receives a configuration information change request, which may be used to change existing configuration information, add new configuration information, or delete configuration information.
And S602, updating the local corresponding configuration information according to the configuration information change request.
Specifically, after receiving the configuration information change request, the configuration management server may change the local corresponding configuration information according to the configuration information change request. If the existing configuration information is changed, the local corresponding configuration information is changed according to the latest configuration information included in the configuration information change request. If the new configuration information is added, the new configuration information is added locally according to the new configuration information included in the configuration information change request. If the configuration information is to be deleted, the corresponding configuration information is found according to the query information included in the configuration information change request, and the found configuration information is deleted.
For example, as the amount of access of clients increases, the number of back-end servers needs to be increased, and the requests are sent to different servers through the load balancer. The operation and maintenance personnel can create a new back-end virtual machine on the operation and maintenance platform. After the virtual machine is created, the operation and maintenance platform calls an API (application programming interface) of the configuration management system and sends a configuration information adding request to the configuration management server, wherein the configuration information adding request comprises information of the newly created virtual machine, and after the configuration management server receives the configuration information adding request, the configuration information of the virtual machine is added based on the information of the newly created virtual machine.
For example, when the monitoring system finds that the database master library is unavailable, prompt information is sent to operation and maintenance personnel, the operation and maintenance personnel judge whether to perform master-slave switching, and if the database master library cannot be repaired, the database master library and the database slave library need to be switched. After the master library and the slave libraries of the database are switched, operation and maintenance personnel call an API of a configuration management system through an operation and maintenance platform and send a configuration information change request to a configuration management server, wherein the configuration information change request comprises indication information for changing the identifier of the slave library of the database into the identifier of the master library and marking the state of the master library of the database as a fault, and the configuration management server changes the identifier of the slave library of the database into the identifier of the master library according to the configuration information change request and marks the state of the master library of the database as a fault.
For example, if a certain function module is no longer used, at this time, the operation and maintenance staff may close the virtual machine related to the function module through the operation and maintenance platform, the operation and maintenance platform may call an API interface of the configuration management system, send a configuration information deletion request to the configuration management server, send the configuration information deletion request including indication information for changing the state of the function module into a released state, the configuration management server may change the state of the function module into a released state, and if no indication is given for changing the state of the function module within 30 days, delete the configuration information of the function module after 30 days.
Fig. 7 is a schematic structural diagram of a synchronization apparatus for configuration information according to a seventh embodiment of the present invention, and as shown in fig. 7, the synchronization apparatus for configuration information according to the embodiment of the present invention includes a first obtaining module 701, a second obtaining module 702, and a sending module 703, where:
the first obtaining module 701 is configured to access a database and obtain session information of the database; the second obtaining module 702 is configured to obtain an IP address of at least one server from the session information; the sending module 703 is configured to send a configuration information synchronization request based on the IP address where the configuration information does not exist to perform configuration information synchronization if it is determined that the configuration information corresponding to the IP address does not exist according to the IP address of the at least one server.
Specifically, the first obtaining module 701 may access the database and obtain Session (Session) information of the database. The configuration management server can be connected with the database through the account number and the password of the database to realize the access to the database. The Session information of the database stores the back-end application information of the currently accessed database, and the back-end application information comprises the IP address and the port number of the server.
The second obtaining module 702 may obtain the IP address of at least one server from the Session information. The IP address obtained from the Session information is the IP address of the server accessing the database.
The sending module 703 may determine whether the configuration information corresponding to the IP address exists in the configuration management server based on each IP address in the IP addresses of the at least one server, and if the corresponding configuration information cannot be queried in the configuration management server according to the IP address, the IP address is assigned to the IP address where the configuration information does not exist, and the configuration information of the server corresponding to the IP address needs to be synchronized to a synchronization device of the configuration information. The sending module 703 sends a configuration information synchronization request to the server corresponding to the IP address to synchronize the configuration information, that is, synchronize the configuration information of the server corresponding to the IP address to the synchronization apparatus of the configuration information. The sending module 703 sends a configuration information synchronization request to the server corresponding to each IP address. The configuration management server stores the configuration information of each server in correspondence with each IP address.
The configuration information synchronization device provided by the embodiment of the invention accesses the database and acquires the session information of the database; acquiring an IP address of at least one server from the session information; if the situation that the configuration information corresponding to the IP address does not exist is judged and known according to the IP address of the at least one server, the configuration information synchronization request is sent based on the IP address where the configuration information does not exist so as to synchronize the configuration information, the missing configuration information can be actively discovered and synchronized, and the timeliness of the configuration information synchronization is improved. In addition, the configuration information is synchronized without manual inspection, and the efficiency of configuration information synchronization is improved.
Fig. 8 is a schematic structural diagram of a synchronization apparatus for configuration information according to an eighth embodiment of the present invention, as shown in fig. 8, on the basis of the foregoing embodiments, further, the synchronization apparatus for configuration information according to the embodiment of the present invention further includes an obtaining module 704, a determining module 705, and a synchronizing module 706, where:
the obtaining module 704 is configured to access, according to each IP address in the IP addresses where the configuration information does not exist, a current-level access server corresponding to each IP address, and obtain an IP address of a next-level access server that accesses the current-level access server corresponding to each IP address; the judging module 705 is configured to, if it is judged and known that the configuration information corresponding to the IP address of the next-level access server does not exist according to the IP address of each next-level access server, use the next-level access server for which the configuration information does not exist as the current-level server to continuously obtain the next-level access server for which the configuration information does not exist until the next-level access server for which the configuration information does not exist; the synchronization module 706 is configured to send a configuration information synchronization request to each next-level access server where the configuration information does not exist, so as to perform configuration information synchronization.
Fig. 9 is a schematic structural diagram of a synchronization apparatus for configuration information according to a ninth embodiment of the present invention, and as shown in fig. 9, on the basis of the foregoing embodiments, further, obtaining module 704 includes a first obtaining unit 7041, a second obtaining unit 7042, and a third obtaining unit 7043, where:
a first obtaining unit 7041 is configured to obtain, according to a port number, thread information corresponding to the port number on the current-level access server; wherein the port number is obtained from the session information; a second obtaining unit 7042 is configured to obtain, according to the thread information corresponding to the port number, process information corresponding to the port number; third obtaining unit 7043 is configured to obtain, according to the process information corresponding to the port number, an IP address of a next-level access server of the current-level access server.
Fig. 10 is a schematic structural diagram of a synchronization apparatus for configuration information according to a tenth embodiment of the present invention, and as shown in fig. 10, on the basis of the foregoing embodiments, the sending module 703 further includes a sending unit 7031 and a receiving unit 7032, where:
the sending unit 7031 is configured to send the configuration information synchronization request to a server corresponding to an IP address where configuration information does not exist, so that the server corresponding to the IP address where configuration information does not exist installs a configuration information acquisition proxy plug-in; the configuration information synchronization request comprises a configuration information acquisition agent plug-in installation package; the receiving unit 7032 is configured to receive configuration information uploaded by a server corresponding to an IP address where the configuration information does not exist, where the configuration information is acquired by the server corresponding to the IP address where the configuration information does not exist through a configuration information acquisition proxy plug-in.
On the basis of the foregoing embodiments, further, the sending module 703 is specifically configured to:
if the IP address in the IP addresses of the at least one server is judged and known not to exist in the local configuration information, the configuration information corresponding to the IP address does not exist.
Fig. 11 is a schematic structural diagram of a configuration information synchronization apparatus according to an eleventh embodiment of the present invention, and as shown in fig. 11, on the basis of the foregoing embodiments, further, the configuration information synchronization apparatus according to the embodiment of the present invention further includes a calling module 707 and a first receiving module 708, where:
the calling module 707 is configured to periodically call an application program interface of the configuration information acquisition proxy plug-in to send a configuration information update request; the first receiving module 708 is configured to receive configuration information update local configuration information sent by each configuration information collection agent plug-in.
Fig. 12 is a schematic structural diagram of a configuration information synchronization apparatus according to a twelfth embodiment of the present invention, and as shown in fig. 12, on the basis of the foregoing embodiments, further, the configuration information synchronization apparatus according to the embodiment of the present invention further includes a second receiving module 709 and an updating module 710, where:
the second receiving module 709 is configured to receive a configuration information change request; the updating module 710 is configured to update the locally corresponding configuration information according to the configuration information change request.
The embodiment of the apparatus provided in the embodiment of the present invention may be specifically configured to execute the processing flows of the above method embodiments, and the functions of the apparatus are not described herein again, and refer to the detailed description of the above method embodiments.
It should be noted that the configuration information synchronization method and apparatus provided in the embodiment of the present invention may be used in the financial field, and may also be used in any technical field other than the financial field.
Fig. 13 is a schematic physical structure diagram of an electronic device according to a thirteenth embodiment of the present invention, and as shown in fig. 13, the electronic device may include: a processor (processor)1301, a communication Interface (Communications Interface)1302, a memory (memory)1303, and a communication bus 1304, wherein the processor 1301, the communication Interface 1302, and the memory 1303 complete communication with each other via the communication bus 1304. Processor 1301 may call logic instructions in memory 1303 to perform the following method: accessing a database and acquiring session information of the database; acquiring an IP address of at least one server from the session information; and if the situation that the configuration information corresponding to the IP address does not exist is judged and known according to the IP address of the at least one server, sending a configuration information synchronization request based on the IP address where the configuration information does not exist so as to synchronize the configuration information.
In addition, the logic instructions in the memory 1303 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The present embodiment discloses a computer program product comprising a computer program stored on a computer-readable storage medium, the computer program comprising program instructions, which when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, including: accessing a database and acquiring session information of the database; acquiring an IP address of at least one server from the session information; and if the situation that the configuration information corresponding to the IP address does not exist is judged and known according to the IP address of the at least one server, sending a configuration information synchronization request based on the IP address where the configuration information does not exist so as to synchronize the configuration information.
The present embodiment provides a computer-readable storage medium, which stores a computer program, where the computer program causes the computer to execute the method provided by the above method embodiments, for example, the method includes: accessing a database and acquiring session information of the database; acquiring an IP address of at least one server from the session information; and if the situation that the configuration information corresponding to the IP address does not exist is judged and known according to the IP address of the at least one server, sending a configuration information synchronization request based on the IP address where the configuration information does not exist so as to synchronize the configuration information.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the description herein, reference to the description of the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," "an example," "a particular example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (11)

1. A method for synchronizing configuration information, comprising:
accessing a database and acquiring session information of the database;
acquiring an IP address of at least one server from the session information;
and if the situation that the configuration information corresponding to the IP address does not exist is judged and known according to the IP address of the at least one server, sending a configuration information synchronization request based on the IP address where the configuration information does not exist so as to synchronize the configuration information.
2. The method of claim 1, further comprising:
accessing a current-level access server corresponding to each IP address according to each IP address in the IP addresses without the configuration information, and obtaining an IP address of a next-level access server accessing the current-level access server corresponding to each IP address;
if the situation that the configuration information corresponding to the IP address of the next-level access server does not exist is judged and known according to the IP address of each next-level access server, taking the next-level access server without the configuration information as the current-level server to continuously acquire the next-level access server without the configuration information until the next-level access server without the configuration information does not exist;
and sending a configuration information synchronization request to each next-level access server without the existence of the configuration information so as to synchronize the configuration information.
3. The method of claim 2, wherein the accessing the current-level access server corresponding to each IP address according to each IP address in the IP addresses where the configuration information does not exist, and the obtaining the IP address of the next-level access server accessing the current-level access server corresponding to each IP address comprises:
obtaining thread information corresponding to the port number on a current-level access server according to the port number; wherein the port number is obtained from the session information;
acquiring process information corresponding to the port number according to the thread information corresponding to the port number;
and acquiring the IP address of the next-level access server of the current-level access server according to the process information corresponding to the port number.
4. The method of claim 1, wherein sending a configuration information synchronization request for synchronization of configuration information based on an IP address where configuration information does not exist comprises:
sending the configuration information synchronization request to a server corresponding to an IP address without configuration information, so that the server corresponding to the IP address without configuration information installs a configuration information acquisition proxy plug-in; the configuration information synchronization request comprises a configuration information acquisition agent plug-in installation package;
and receiving configuration information uploaded by a server corresponding to the IP address without the configuration information, wherein the configuration information is acquired by the server corresponding to the IP address without the configuration information through a configuration information acquisition proxy plug-in.
5. The method of claim 1, wherein the determining that there is no configuration information corresponding to the IP address according to the IP address of the at least one server comprises:
if the fact that the IP address in the IP addresses of the at least one server does not exist in the local configuration information is judged and known, the situation that the configuration information corresponding to the IP address does not exist exists.
6. The method of claim 1, further comprising:
calling an application program interface of the configuration information acquisition proxy plug-in regularly to send a configuration information updating request;
and receiving the configuration information sent by each configuration information acquisition agent plug-in to update the local configuration information.
7. The method of any of claims 1 to 6, further comprising:
receiving a configuration information change request;
and updating the local corresponding configuration information according to the configuration information change request.
8. An apparatus for synchronizing configuration information, comprising:
the first acquisition module is used for accessing the database and acquiring the session information of the database;
a second obtaining module, configured to obtain an IP address of at least one server from the session information;
and the sending module is used for sending a configuration information synchronization request based on the IP address without the configuration information to synchronize the configuration information if the condition that the configuration information corresponding to the IP address does not exist is judged and known according to the IP address of the at least one server.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method of any one of claims 1 to 7.
11. A computer program product, characterized in that the computer program product comprises a computer program which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
CN202210703788.7A 2022-06-21 2022-06-21 Configuration information synchronization method and device Pending CN115022175A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210703788.7A CN115022175A (en) 2022-06-21 2022-06-21 Configuration information synchronization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210703788.7A CN115022175A (en) 2022-06-21 2022-06-21 Configuration information synchronization method and device

Publications (1)

Publication Number Publication Date
CN115022175A true CN115022175A (en) 2022-09-06

Family

ID=83077276

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210703788.7A Pending CN115022175A (en) 2022-06-21 2022-06-21 Configuration information synchronization method and device

Country Status (1)

Country Link
CN (1) CN115022175A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5950230A (en) * 1997-05-28 1999-09-07 International Business Machines Corporation RAID array configuration synchronization at power on
KR20060070987A (en) * 2004-12-21 2006-06-26 주식회사 팬택 Method for setting time synchronization or slot between base station and mobile communication terminal and mobile communication terminal of enabling the method
CN102693324A (en) * 2012-01-09 2012-09-26 西安电子科技大学 Distributed database synchronization system, synchronization method and node management method
US20130238768A1 (en) * 2012-03-07 2013-09-12 Ashish Vaidya Systems and methods for comparing configuration files and generating corrective commands
US20140325040A1 (en) * 2013-04-24 2014-10-30 Ciena Corporation Network-based dhcp server recovery
CN105610987A (en) * 2016-03-18 2016-05-25 车智互联(北京)科技有限公司 Method, application and system for managing server cluster
CN106169964A (en) * 2016-09-28 2016-11-30 杭州迪普科技有限公司 Network equipments configuration synchronous method and device
CN106850222A (en) * 2017-01-04 2017-06-13 普联技术有限公司 The configuration and synchronization method of wireless networking devices, wireless networking devices and system
CN112165460A (en) * 2020-09-10 2021-01-01 杭州安恒信息技术股份有限公司 Flow detection method and device, computer equipment and storage medium
CN113722396A (en) * 2021-08-25 2021-11-30 武汉达梦数据库股份有限公司 Method and equipment for switching main service and standby service of data synchronization receiving end

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5950230A (en) * 1997-05-28 1999-09-07 International Business Machines Corporation RAID array configuration synchronization at power on
KR20060070987A (en) * 2004-12-21 2006-06-26 주식회사 팬택 Method for setting time synchronization or slot between base station and mobile communication terminal and mobile communication terminal of enabling the method
CN102693324A (en) * 2012-01-09 2012-09-26 西安电子科技大学 Distributed database synchronization system, synchronization method and node management method
US20130238768A1 (en) * 2012-03-07 2013-09-12 Ashish Vaidya Systems and methods for comparing configuration files and generating corrective commands
US20140325040A1 (en) * 2013-04-24 2014-10-30 Ciena Corporation Network-based dhcp server recovery
CN105610987A (en) * 2016-03-18 2016-05-25 车智互联(北京)科技有限公司 Method, application and system for managing server cluster
CN106169964A (en) * 2016-09-28 2016-11-30 杭州迪普科技有限公司 Network equipments configuration synchronous method and device
CN106850222A (en) * 2017-01-04 2017-06-13 普联技术有限公司 The configuration and synchronization method of wireless networking devices, wireless networking devices and system
CN112165460A (en) * 2020-09-10 2021-01-01 杭州安恒信息技术股份有限公司 Flow detection method and device, computer equipment and storage medium
CN113722396A (en) * 2021-08-25 2021-11-30 武汉达梦数据库股份有限公司 Method and equipment for switching main service and standby service of data synchronization receiving end

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"动态地址分配DHCP与IP地址管理方式及分配原则", 电脑知识与技术(经验技巧), no. 04 *

Similar Documents

Publication Publication Date Title
US9696977B2 (en) Method and system for allocating ID of software component
CN113778623B (en) Resource processing method and device, electronic equipment and storage medium
CN107210924B (en) Method and apparatus for configuring a communication system
US20040143654A1 (en) Node location management in a distributed computer system
CN109104368B (en) Connection request method, device, server and computer readable storage medium
CN111464603B (en) Server capacity expansion method and system
CN113079098B (en) Method, device, equipment and computer readable medium for updating route
CN112181049B (en) Cluster time synchronization method, device, system, equipment and readable storage medium
CN112069152B (en) Database cluster upgrading method, device, equipment and storage medium
CN111565120B (en) 5G network slicing product configuration method and system and electronic equipment
US20090094599A1 (en) System and method for optimized targeting in a large scale system
CN114900449B (en) Resource information management method, system and device
CN110611688B (en) Method, electronic device and computer program product for searching nodes
CN115022175A (en) Configuration information synchronization method and device
CN110633322A (en) Resource information synchronization method and device, electronic equipment and storage medium
CN111736944A (en) Docker container positioning method and device based on Kubernetes
CN113364839A (en) Service calling method, service calling device and zookeeper cluster
CN115189931A (en) Distributed key management method, device, equipment and storage medium
CN109167826B (en) Method, device and system for putting WEB application on shelf
CN111338647B (en) Big data cluster management method and device
CN110650033B (en) Distributed application configuration management method and distributed computing system
CN114461399A (en) Resource allocation method and device, storage medium and electronic device
CN105827567B (en) Service management and control method and capability opening platform
CN114257503A (en) Method, server, system and storage medium for accelerating domain name deployment
CN111857955A (en) Method for automatically constructing and updating resource configuration information in heterogeneous cloud 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