CN112003918B - Method, device, equipment and medium for configuration synchronization between container application and client - Google Patents

Method, device, equipment and medium for configuration synchronization between container application and client Download PDF

Info

Publication number
CN112003918B
CN112003918B CN202010821145.3A CN202010821145A CN112003918B CN 112003918 B CN112003918 B CN 112003918B CN 202010821145 A CN202010821145 A CN 202010821145A CN 112003918 B CN112003918 B CN 112003918B
Authority
CN
China
Prior art keywords
client
container application
application
configuration file
information
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
CN202010821145.3A
Other languages
Chinese (zh)
Other versions
CN112003918A (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.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data 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 Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202010821145.3A priority Critical patent/CN112003918B/en
Publication of CN112003918A publication Critical patent/CN112003918A/en
Application granted granted Critical
Publication of CN112003918B publication Critical patent/CN112003918B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Abstract

The application discloses a method, a device, equipment and a computer readable storage medium for configuration synchronization between a container application and a client, wherein the method comprises the following steps: acquiring installation information of a client, and storing the installation information in a database; polling the application information of the container application, and judging whether the configuration file in the container application is changed or not according to the application information of the container application; if so, acquiring installation information of a client corresponding to the container application with the changed configuration file from the database, and acquiring the configuration file from the container application with the changed configuration file; replacing the original configuration file in the target client by using the acquired configuration file; the target client is a client corresponding to the installation information acquired from the database. According to the technical scheme disclosed by the application, the automatic synchronization of the configuration between the container application and the client is realized without the participation of a user, so that the experience degree of the user and the usability of the container platform are improved, and the error rate of task submission is reduced.

Description

Method, device, equipment and medium for configuration synchronization between container application and client
Technical Field
The present application relates to the field of container platform technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for configuration synchronization between a container application and a client.
Background
In the cloud computing era, a large number of application services are deployed and operated in a containerization manner, generally, the application services are deployed in containers, clients are deployed on a host, and users only need to submit tasks to the application services in the containers through the clients, but the normal task submission is performed on the premise that the configuration of the clients is consistent with the configuration of the corresponding container applications, and the container applications and the clients need to be configured and synchronized.
At present, a conventional method for implementing configuration synchronization between a container application and a client is to actively discover a change in configuration information by a user and manually implement configuration synchronization by the user, and specifically, when the user submits a task, if the client is found to be unable to normally submit the task, it is determined that the configuration information in the container application has changed, and at this time, the user may obtain the change in configuration information from the container application and manually change the configuration information of the client to implement configuration synchronization. Because the existing configuration synchronization method is configured by the user actively when the task submission errors occur, the error rate of task submission is improved, and the user experience and the usability of the container platform are reduced. In addition, since the changed configuration information may be more, the workload of the user may be increased, and it cannot be guaranteed that the user can completely acquire the changed configuration information, so that the user experience and the usability of the container platform may be further reduced, and meanwhile, the error rate of task submission may be further increased due to the fact that the user finds out that it is not timely.
In summary, a technical problem to be solved by those skilled in the art is how to implement configuration synchronization between a container application without user participation and a client, so as to improve usability of a container platform and reduce a task submission error rate.
Disclosure of Invention
In view of the foregoing, an object of the present application is to provide a method, an apparatus, a device, and a computer-readable storage medium for configuration synchronization between a container application and a client, which are used to implement configuration synchronization between the container application and the client without user participation, so as to improve usability of a container platform and reduce a task submission error rate.
In order to achieve the above purpose, the present application provides the following technical solutions:
a method of configuration synchronization between a container application and a client, comprising:
acquiring installation information of a client, and storing the installation information in a database;
polling application information of a container application, and judging whether a configuration file in the container application is changed or not according to the application information of the container application;
if so, acquiring installation information of a client corresponding to the container application with the changed configuration file from the database, and acquiring the configuration file from the container application with the changed configuration file;
replacing the original configuration file in the target client by using the acquired configuration file; and the target client is a client corresponding to the installation information acquired from the database.
Preferably, the determining whether the configuration file in the container application is changed according to the application information of the container application includes:
and judging whether the container application is restarted or newly started or not according to the application information of the container application, and if so, determining that the configuration file in the container application is changed.
Preferably, the determining whether the container application is restarted or newly started according to the application information of the container application includes:
acquiring specific index information from the application information of the container application;
and judging whether the specific index information is smaller than a threshold value, if so, determining that the container application is restarted or newly started.
Preferably, storing the installation information in a database includes:
storing the installation information in the form of a key-value in an etcd database; the client side sets the value of the key-value as the domain name or the IP address of the host machine where the client side is located.
Preferably, the obtaining of the installation information of the client includes:
after the client is installed, receiving a user refreshing instruction, and acquiring installation information of the client according to the user refreshing instruction;
and when the client is normally used, acquiring the installation information of the client at regular time according to the received timing task.
Preferably, the obtaining of the installation information of the client includes:
and acquiring the installation information of the client through the default installation path of the client.
An apparatus for configuration synchronization between a container application and a client, comprising:
the system comprises a first acquisition module, a second acquisition module and a first display module, wherein the first acquisition module is used for acquiring the installation information of a client and storing the installation information in a database;
the judging module is used for polling application information of the container application and judging whether a configuration file in the container application is changed or not according to the application information of the container application;
the second obtaining module is used for obtaining the installation information of the client corresponding to the container application with the changed configuration file from the database and obtaining the configuration file from the container application with the changed configuration file if the configuration file in the container application is determined to be changed;
the replacing module is used for replacing the original configuration file in the target client by using the acquired configuration file; and the target client is a client corresponding to the installation information acquired from the database.
Preferably, the judging module includes:
and the judging unit is used for judging whether the container application is restarted or newly started according to the application information of the container application, and if so, determining that the configuration file in the container application is changed.
An apparatus for configuration synchronization between a container application and a client, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method for configuration synchronization between a container application and a client as described in any one of the above when said computer program is executed.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a method for configuration synchronization between a container application and a client as defined in any one of the preceding claims.
The application provides a method, a device, equipment and a computer-readable storage medium for configuration synchronization between a container application and a client, wherein the method comprises the following steps: acquiring installation information of a client, and storing the installation information in a database; polling the application information of the container application, and judging whether the configuration file in the container application is changed or not according to the application information of the container application; if so, acquiring installation information of a client corresponding to the container application with the changed configuration file from the database, and acquiring the configuration file from the container application with the changed configuration file; replacing the original configuration file in the target client by using the acquired configuration file; and the target client is a client corresponding to the installation information acquired from the database.
According to the technical scheme, the acquired installation information of the client is stored in the database, whether the configuration file in the container application is changed or not is judged according to the polled application information of the container application, when the configuration file of the container application is determined to be changed, the installation information of the client corresponding to the container application with the changed configuration file is acquired from the database, the configuration file is acquired from the container application with the changed configuration file, then the acquired configuration file is used for replacing the original configuration file in the client corresponding to the installation information acquired from the database, so that automatic synchronization of configuration between the container application and the client is realized, users do not need to participate in the configuration file, the experience degree of the users and the usability of a container platform are improved, in addition, the configuration synchronization can be realized without task submission errors in the process, so that the configuration file of the client is kept consistent with the configuration file in the container application, and therefore, the task submission error rate can be reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only the embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for configuration synchronization between a container application and a client according to an embodiment of the present application;
fig. 2 is a specific flowchart of a method for configuration synchronization between a container application and a client according to an embodiment of the present application;
fig. 3 is a flowchart illustrating an implementation of a client discovery apparatus according to an embodiment of the present disclosure;
fig. 4 is a flowchart of a single polling of the condition monitoring device according to the embodiment of the present application;
fig. 5 is a flowchart illustrating an implementation of a configuration synchronization apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an apparatus for configuration synchronization between a container application and a client according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an apparatus for configuration synchronization between a container application and a client according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, which shows a flowchart of a method for configuration synchronization between a container application and a client according to an embodiment of the present application, the method for configuration synchronization between a container application and a client according to an embodiment of the present application may include:
s11: and acquiring the installation information of the client and storing the installation information in a database.
In view of the problems of low platform usability and high task submission error rate existing in the conventional mode of actively realizing the configuration synchronization between the container application and the client by the user, the application provides a scheme for the configuration synchronization between the container application and the client, so as to realize the configuration synchronization between the container application and the client without user participation, thereby improving the usability of the container platform and reducing the task submission error rate.
Specifically, the installation information of the client is obtained, where the obtained installation information of the client may include a name of the client, an application name of a container application corresponding to the client, a domain name of a host where the client is located, and the like, and then the obtained installation information of the client may be stored in a database, so that the required installation information of the client may be obtained from the database, and a configuration file may be distributed according to the obtained installation information of the client.
S12: polling the application information of the container application, and judging whether the configuration file in the container application is changed or not according to the application information of the container application; if yes, go to step S13.
At the same time as, before, or after step S11 is executed, the application information of the container application may be polled, where it is considered that configuration synchronization operation needs to be performed immediately once the configuration file of the container application is changed, otherwise, the configuration file of the host client (including configuration information such as IP and port inside) cannot be synchronized with the configuration file of the container application in time, so that the client cannot submit a task normally, therefore, the polling process should be high-frequency, and the polling frequency may be set according to a requirement, for example, may be set to 5S, that is, the application information of the container application may be polled once every 5S. It should be noted that references herein to container applications specifically refer to applications operating in containers.
When polling the application information of the container application, whether the configuration file in the container application is changed or not can be judged according to the application information of the container application, if the configuration file in the container application is not changed, the step of polling the application information of the container application can be continuously executed, that is, the step S12 can be returned to be executed, and if the configuration file in the container application is changed, the step S13 can be executed to realize the change of the configuration file of the client through the step S13 and the step S14, so that the configuration of the container application and the configuration of the client can be kept consistent, the client can normally submit the task, and the error rate of task submission can be reduced.
S13: and acquiring the installation information of the client corresponding to the container application with the changed configuration file from the database, and acquiring the configuration file from the container application with the changed configuration file.
After determining that the configuration file in the container application is changed, the installation information of the client corresponding to the container application with the changed configuration file may be obtained from the database, and the configuration file may be obtained from the container application with the changed configuration file.
S14: replacing the original configuration file in the target client by using the acquired configuration file; and the target client is a client corresponding to the installation information acquired from the database.
After step S13 is executed, the configuration file in the target client (specifically, the client corresponding to the installation information obtained from the database is used as the target client, and the client corresponding to the container application with the changed configuration file is used as the target client) may be replaced by the configuration file obtained from the container application with the changed configuration file according to the installation information of the client corresponding to the container application with the changed configuration file obtained from the database, specifically, the configuration file obtained from the container application with the changed configuration file may be distributed to the installation path of the client on a different host, and the configuration file in the target client may be replaced by the distributed configuration file, so as to finally achieve synchronization of configuration between the container application and the client.
The configuration synchronization process does not need a user to participate in the process, but automatically realizes the configuration, so the workload of the user can be reduced, the user experience and the user friendliness of the platform are improved, the usability of the platform is improved, the changed configuration file can be completely acquired through processes such as polling and the like, the configuration accuracy is improved conveniently, the configuration synchronization is not performed when a task is submitted wrongly, and meanwhile, the configuration of the container application and the configuration of the client side are always kept consistent as much as possible through the process, so the error rate of the task submission can be reduced, and the workload of the user is reduced.
According to the technical scheme, the acquired installation information of the client is stored in the database, whether the configuration file in the container application is changed or not is judged according to the polled application information of the container application, the installation information of the client corresponding to the container application with the changed configuration file is acquired from the database when the configuration file of the container application is determined to be changed, the configuration file is acquired from the container application with the changed configuration file, then the acquired configuration file is used for replacing the original configuration file in the client corresponding to the installation information acquired from the database, so that automatic synchronization of configuration between the container application and the client is achieved, users do not need to participate in the configuration file, the experience degree of the users and the usability of a container platform are improved, in addition, the configuration synchronization can be achieved without task submission errors in the process, so that the configuration file of the client and the configuration file in the container application are kept consistent, and therefore the task submission error rate can be reduced.
In the method for configuration synchronization between a container application and a client provided in an embodiment of the present application, determining whether a configuration file in the container application is changed according to application information of the container application may include:
and judging whether the container application is restarted or newly started or not according to the application information of the container application, and if so, determining that the configuration file in the container application is changed.
Considering that the restart or new start of a general container application is because the configuration file of the container application is changed to enable the configuration of the container application to be valid, it may be considered that the internal configuration file is changed when the container application is restarted or newly started, and therefore, when it is determined whether the configuration file in the container application is changed according to the application information of the container application, it may be determined whether the configuration file in the container application is changed by determining whether the container application is restarted or newly started according to the application information of the container application, if it is determined that the container application is restarted or newly started according to the application information of the container application, it is determined that the configuration file in the container application is changed, and if it is determined that the container application is not restarted or newly started according to the application information of the container application, it is determined that the configuration file in the container application is not changed.
Whether the configuration file in the container application is changed or not can be intuitively determined by judging whether the container application is restarted or newly started or not according to the application information of the container application to determine whether the configuration file in the container application is changed or not.
The method for configuration synchronization between a container application and a client according to the embodiment of the present application, which determines whether the container application is restarted or newly started according to application information of the container application, may include:
acquiring specific index information from application information of the container application;
and judging whether the specific index information is smaller than a threshold value, and if so, determining that the container application is restarted or newly started.
When judging whether the container application is restarted or newly started according to the application information of the container application, specific index information can be acquired from the application information of the polled container application, wherein the specific index information is specified by a user or by a cluster default in advance, and only the fact that whether the container application is restarted or newly started can be judged through the index information. Then, the specific index information may be compared with a preset threshold (the threshold is a critical condition, and the setting of the threshold should be considered to correspond to the polling frequency), if the specific index information is less than the threshold, it is determined that the container application reaches the synchronous configuration condition, that is, it is determined that the container application is restarted or newly started, then step S13 and step S14 may be performed, if the specific index information is not less than the threshold, it is determined that the container application does not reach the synchronous configuration condition, that is, it is determined that the container application is not restarted or newly started, at this time, the next polling may be waited, and the step of obtaining the specific index information from the application information of the container application is performed after the next polling comes.
For example: when the container application is deployed in the k8s cluster, AGE in Pod can be used as specific index information, the threshold value is set to 5s for every 5s according to the polling frequency, and if AGE is less than 5s, the synchronous configuration condition is considered to be reached, that is, the container application is determined to be restarted or newly started.
The method for configuration synchronization between a container application and a client provided by the embodiment of the application stores installation information in a database, and may include:
storing the installation information in the form of key-value in the etcd database; the client side sets the value of the key-value as the domain name or IP address of the host machine where the client side is located.
When the installation information is stored in the database, the obtained installation information of the client may be specifically stored in the etcd database in a key-value manner, where the etcd database is a highly available distributed key-value (key-value) database, and the k8s cluster is data backend persistent storage data using the database as its data.
When the installation information is stored in the etcd database in a key-value mode, a key in the key-value mode is set as the name of a container application corresponding to a client, the splicing of the client and the value in the key-value mode are set as the domain name or the IP address of a host where the client is located, and the setting can be convenient for knowing which container application the client goes to find a configuration file, which hosts the client goes to find the client and synchronize the configuration file during synchronous configuration.
The method for configuration synchronization between a container application and a client, provided by the embodiment of the application, may obtain installation information of the client, and include:
after the client is installed, receiving a user refreshing instruction, and acquiring installation information of the client according to the user refreshing instruction;
and when the client is normally used, regularly acquiring the installation information of the client according to the received timing task.
When the installation information of the client is obtained, considering that the time of using the client after the client is initially installed by a user may be earlier than the next execution time of the timing task, and the installation information of the client cannot be updated to the database before the user uses the client under the condition, so that the synchronization with the configuration of the container application may not be timely caused. In addition, when the client is installed and used normally, the installation information of the client can be obtained regularly according to the received timing task, and the obtained installation information of the client is updated into the database (namely, the installation information corresponding to the client and stored in the database in advance is replaced), so that the problem that the installation information of some clients is missed to cause that the client cannot be synchronized with the configuration of the container application in time and finally cause errors when the client submits the task is avoided, wherein the timing process of the timing task does not need to be executed at high frequency, and can be specifically set to be 12h or 24h.
Of course, in the process of obtaining the installation information of the client regularly, the user refresh instruction can also be received, and the installation information of the client can be obtained according to the user refresh instruction, so that the flexibility of obtaining the installation information of the client is improved.
The method for configuration synchronization between a container application and a client, provided by the embodiment of the application, may obtain installation information of the client, and include:
and acquiring the installation information of the client through the default installation path of the client.
When the installation information of the client is obtained, the information can be specifically inquired through a default installation path of the client, the installation information of the client under the path is recorded, and the domain name or the IP address of the host is obtained, so that the convenience of obtaining the installation information of the client is improved.
In a specific embodiment of the present application, a client discovery device, a state monitoring device, and a configuration synchronization device may be divided according to a process of configuration synchronization between a container application and a client, and are implemented by the three devices, specifically refer to fig. 2 to 5, where fig. 2 illustrates a specific flowchart of a method of configuration synchronization between a container application and a client provided in the embodiment of the present application, fig. 3 illustrates an execution flowchart of a client discovery device provided in the embodiment of the present application, fig. 4 illustrates a flowchart of one-time polling of a state monitoring device provided in the embodiment of the present application, and fig. 5 illustrates an execution flowchart of a configuration synchronization device provided in the embodiment of the present application, where the client discovery device searches for installation information of a client from a default installation path of the client at regular time or according to a user refresh instruction, and stores the installation information in an etcd database, which mainly provides the installation information of the client for the configuration synchronization device; the state monitoring device polls the application information of the container application, if the container application is restarted or newly started, the application information of the container application is transmitted to the synchronous configuration device, and the state monitoring device mainly finds the information of configuration change and triggers the synchronous configuration device to execute synchronous configuration operation; the configuration synchronization device receives application information of the container application with the changed configuration file sent by the state monitoring device, installation information corresponding to the application information is inquired in the etcd database, then the latest configuration file is obtained from the container application with the changed configuration file, the latest configuration file is distributed to installation paths of the client sides on different hosts corresponding to the installation information inquired from the etcd database, the original configuration file in the client side is replaced by the latest configuration file, and finally the synchronization operation of the container application and the configuration information of the client side is achieved.
An apparatus for configuration synchronization between a container application and a client is further provided in an embodiment of the present application, and referring to fig. 6, which shows a schematic structural diagram of an apparatus for configuration synchronization between a container application and a client provided in an embodiment of the present application, and the apparatus may include:
a first obtaining module 61, configured to obtain installation information of a client, and store the installation information in a database;
the judging module 62 is configured to poll application information of the container application, and judge whether a configuration file in the container application is changed according to the application information of the container application;
a second obtaining module 63, configured to, if it is determined that the configuration file in the container application is changed, obtain, from the database, installation information of the client corresponding to the container application in which the configuration file is changed, and obtain the configuration file from the container application in which the configuration file is changed;
a replacing module 64, configured to replace an original configuration file in the target client with the acquired configuration file; and the target client is a client corresponding to the installation information acquired from the database.
In an embodiment of the present application, the determining module 62 may include:
and the judging unit is used for judging whether the container application is restarted or newly started according to the application information of the container application, and if so, determining that the configuration file in the container application is changed.
In an embodiment of the present application, an apparatus for configuration synchronization between a container application and a client includes:
an acquisition subunit, configured to acquire specific index information from application information of the container application;
and the judging subunit is used for judging whether the specific index information is smaller than a threshold value, and if so, determining that the container application is restarted or newly started.
In an apparatus for configuration synchronization between a container application and a client, a first obtaining module 61 may include:
a storage unit for storing the installation information in the form of key-value in the etcd database; the client side sets the value of the key-value as the domain name or IP address of the host machine where the client side is located.
In an apparatus for configuration synchronization between a container application and a client, a first obtaining module 61 may include:
the first acquisition unit is used for receiving a user refreshing instruction after the client is installed and acquiring the installation information of the client according to the user refreshing instruction;
and the second acquisition unit is used for acquiring the installation information of the client regularly according to the received timing task when the client is used normally.
In an apparatus for configuration synchronization between a container application and a client, a first obtaining module 61 may include:
and the third acquisition unit is used for acquiring the installation information of the client through the default installation path of the client.
An embodiment of the present application further provides a device for configuration synchronization between a container application and a client, refer to fig. 7, which shows a schematic structural diagram of the device for configuration synchronization between a container application and a client, where the device provided in the embodiment of the present application may include:
a memory 71 for storing a computer program;
a processor 72, configured to execute the computer program stored in the memory 71, and configured to perform the following steps:
acquiring installation information of a client, and storing the installation information in a database; polling the application information of the container application, and judging whether the configuration file in the container application is changed or not according to the application information of the container application; if so, acquiring the installation information of the client corresponding to the container application with the changed configuration file from the database, and acquiring the configuration file from the container application with the changed configuration file; replacing the original configuration file in the target client by using the acquired configuration file; and the target client is a client corresponding to the installation information acquired from the database.
An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and when executed by a processor, the computer program may implement the following steps:
acquiring installation information of a client, and storing the installation information in a database; polling the application information of the container application, and judging whether the configuration file in the container application is changed or not according to the application information of the container application; if so, acquiring installation information of a client corresponding to the container application with the changed configuration file from the database, and acquiring the configuration file from the container application with the changed configuration file; replacing the original configuration file in the target client by using the acquired configuration file; and the target client is a client corresponding to the installation information acquired from the database.
The computer-readable storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
For a description of a relevant part in the device, the apparatus, and the computer-readable storage medium for configuration synchronization between a container application and a client provided in the embodiment of the present application, reference may be made to a detailed description of a corresponding part in the method for configuration synchronization between a container application and a client provided in the embodiment of the present application, and details are not repeated here.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include the inherent elements. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element. In addition, parts of the above technical solutions provided in the embodiments of the present application, which are consistent with the implementation principles of corresponding technical solutions in the prior art, are not described in detail so as to avoid redundant description.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A method for configuration synchronization between a container application and a client, comprising:
acquiring installation information of a client, and storing the installation information in a database;
polling application information of a container application, and judging whether a configuration file in the container application is changed or not according to the application information of the container application;
if so, acquiring installation information of a client corresponding to the container application with the changed configuration file from the database, and acquiring the configuration file from the container application with the changed configuration file;
replacing the original configuration file in the target client by using the acquired configuration file; the target client is a client corresponding to the installation information acquired from the database;
storing the installation information in a database, including:
storing the installation information in the form of a key-value in an etcd database; the client side sets the value in the key-value as the domain name or the IP address of the host machine where the client side is located;
acquiring installation information of a client, comprising:
after the client is installed, receiving a user refreshing instruction, and acquiring installation information of the client according to the user refreshing instruction;
and when the client is normally used, acquiring the installation information of the client at regular time according to the received timing task.
2. The method of claim 1, wherein determining whether the configuration file in the container application is changed according to the application information of the container application comprises:
and judging whether the container application is restarted or newly started or not according to the application information of the container application, and if so, determining that the configuration file in the container application is changed.
3. The method for configuration synchronization between a container application and a client according to claim 2, wherein determining whether the container application is restarted or newly started according to the application information of the container application comprises:
acquiring specific index information from the application information of the container application;
and judging whether the specific index information is smaller than a threshold value, if so, determining that the container application is restarted or newly started.
4. The method for configuration synchronization between a container application and a client according to claim 1, wherein obtaining installation information of the client comprises:
and acquiring the installation information of the client through the default installation path of the client.
5. An apparatus for configuration synchronization between a container application and a client, comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring the installation information of a client and storing the installation information in a database;
the judging module is used for polling application information of the container application and judging whether the configuration file in the container application is changed or not according to the application information of the container application;
the second obtaining module is used for obtaining the installation information of the client corresponding to the container application with the changed configuration file from the database and obtaining the configuration file from the container application with the changed configuration file if the configuration file in the container application is determined to be changed;
the replacing module is used for replacing the original configuration file in the target client by using the acquired configuration file; the target client is a client corresponding to the installation information acquired from the database;
the first acquisition module comprises:
a storage unit for storing the installation information in the form of key-value in an etcd database; the client side sets the value in the key-value as the domain name or the IP address of the host machine where the client side is located;
the first obtaining module comprises:
the first obtaining unit is used for receiving a user refreshing instruction after the client is installed, and obtaining the installation information of the client according to the user refreshing instruction;
and the second acquisition unit is used for acquiring the installation information of the client regularly according to the received timing task when the client is used normally.
6. The apparatus for configuration synchronization between a container application and a client according to claim 5, wherein the determining module comprises:
and the judging unit is used for judging whether the container application is restarted or newly started according to the application information of the container application, and if so, determining that the configuration file in the container application is changed.
7. An apparatus for configuration synchronization between a container application and a client, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method for configuration synchronization between a container application and a client according to any of claims 1 to 4 when executing said computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a method for configuration synchronization between a container application and a client according to any one of claims 1 to 4.
CN202010821145.3A 2020-08-14 2020-08-14 Method, device, equipment and medium for configuration synchronization between container application and client Active CN112003918B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010821145.3A CN112003918B (en) 2020-08-14 2020-08-14 Method, device, equipment and medium for configuration synchronization between container application and client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010821145.3A CN112003918B (en) 2020-08-14 2020-08-14 Method, device, equipment and medium for configuration synchronization between container application and client

Publications (2)

Publication Number Publication Date
CN112003918A CN112003918A (en) 2020-11-27
CN112003918B true CN112003918B (en) 2023-01-24

Family

ID=73473234

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010821145.3A Active CN112003918B (en) 2020-08-14 2020-08-14 Method, device, equipment and medium for configuration synchronization between container application and client

Country Status (1)

Country Link
CN (1) CN112003918B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603281A (en) * 2016-12-07 2017-04-26 乐视控股(北京)有限公司 Configuration file management method and system
CN109597655A (en) * 2017-09-28 2019-04-09 华为技术有限公司 Configure the method and device of application program
CN109976822A (en) * 2017-12-25 2019-07-05 中国电信股份有限公司 Configuration method, device and the distributed system of Distributed Application
CN110543627A (en) * 2019-09-10 2019-12-06 北京搜狐新媒体信息技术有限公司 Method and system for storing report configuration information

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603281A (en) * 2016-12-07 2017-04-26 乐视控股(北京)有限公司 Configuration file management method and system
CN109597655A (en) * 2017-09-28 2019-04-09 华为技术有限公司 Configure the method and device of application program
CN109976822A (en) * 2017-12-25 2019-07-05 中国电信股份有限公司 Configuration method, device and the distributed system of Distributed Application
CN110543627A (en) * 2019-09-10 2019-12-06 北京搜狐新媒体信息技术有限公司 Method and system for storing report configuration information

Also Published As

Publication number Publication date
CN112003918A (en) 2020-11-27

Similar Documents

Publication Publication Date Title
US11288253B2 (en) Allocation method and device for a distributed lock
US20170195282A1 (en) Address Processing Method, Related Device, and System
US20230106118A1 (en) Distributed processing of transactions in a network using timestamps
CN110309161B (en) Data synchronization method and device and server
EP3541098B1 (en) Processing method for communication identifier binding and terminal
US20180367441A1 (en) Routing table synchronization method, apparatus, and system
US8407530B2 (en) Server reachability detection
US20070204024A1 (en) Mapping managing devices to managed devices
KR20190044145A (en) Processing mutations for a remote database
US11327654B2 (en) Method and device for baseboard management controller mounting folder with KVM
EP3054386B1 (en) Execution plan storage method, device and system
MX2015007249A (en) System update method, apparatus, and device.
CN110704376A (en) Log file saving method and device
CN107592199B (en) Data synchronization method and system
CN111277373B (en) Server switching control method, terminal and storage medium
CN112003918B (en) Method, device, equipment and medium for configuration synchronization between container application and client
US20180302404A1 (en) Method for processing data request and system therefor, access device, and storage device
WO2018010603A1 (en) Storage mode upgrade method, apparatus and system based on video cloud storage system
CN112751693B (en) Data processing method and device of distributed storage system and electronic equipment
CN111092956A (en) Resource synchronization method, device, storage medium and equipment
CN114866517A (en) Installation file execution method and device and storage medium
CN111736944A (en) Docker container positioning method and device based on Kubernetes
EP2602718A1 (en) Computer system management method and management device
CN114218317A (en) Progress information control method, micro-service device, electronic equipment and storage medium
CN109101253B (en) Management method and device for host in cloud computing system

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