CN113282335B - Multi-version configuration method and system for application cluster service parameters - Google Patents
Multi-version configuration method and system for application cluster service parameters Download PDFInfo
- Publication number
- CN113282335B CN113282335B CN202110810541.0A CN202110810541A CN113282335B CN 113282335 B CN113282335 B CN 113282335B CN 202110810541 A CN202110810541 A CN 202110810541A CN 113282335 B CN113282335 B CN 113282335B
- Authority
- CN
- China
- Prior art keywords
- version
- last
- new
- currently
- service
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a multi-version configuration method and a system of application cluster service parameters, which comprises the steps of caching a plurality of versions of service parameters at a proxy layer, wherein the plurality of versions comprise a current effective version, a last effective version and a last effective version; the service code accesses the service parameter of the current effective version through the proxy layer; when a rollback instruction is received, the agent layer switches the service parameter version accessed by the service code to a previous effective version or a previous effective version as a current effective version; when the last effective version is switched to be used as the current effective version, the last effective version of the last effective version is loaded into the proxy layer for caching, and the current effective version before switching is deleted from the proxy layer; when the last effective version is switched to be used as the current effective version, loading the last effective version and the last effective version of the last effective version into the proxy layer for caching; the service parameters used by the service application in the method can be quickly backed.
Description
Technical Field
The invention relates to the technical field of use and management of service parameters on an application cluster, in particular to a multi-version configuration method and a multi-version configuration system of service parameters of the application cluster.
Background
When a credit card transaction system processes services, service parameters are relied on as key data, the service parameters are accessed more than once in almost every transaction process, and then relevant processing is carried out according to service parameter definition; in general, service parameters are stored in a relational database, a service program queries the database through SQL statements to obtain the service parameters each time the service program needs to access the service parameters, and all accesses are concentrated on one application, but the application needing to use the service parameters is not the same as the application responsible for accessing the service parameters, and they are deployed on different servers, that is, the service application needing to use the service parameters first needs to call the application responsible for accessing the service parameters through a network, and then the application responsible for accessing the service parameters accesses the relational database through the network, and the service parameters can be taken by the service application using the service parameters through at least two network transmissions.
When the access quantity is small, the access efficiency of the method is in an acceptable range, but once the service quantity is large and the service processing has a strict requirement on the efficiency, the method of inquiring the service parameters through the access relational database and transmitting the service parameters through the network twice can become a bottleneck for improving the service processing efficiency; in order to break the bottleneck of this method, the latest service parameters are generally cached in a local memory of the service application deployment server, that is, in a jvm (java Virtual machine) memory, so that the service application can obtain the required service parameters only by accessing the local memory, thereby greatly submitting the efficiency.
The cached service parameters solve the problem of access efficiency, but when the service parameters have problems and need to be backed off, only the latest version parameters are cached, and the back-off cannot be simply and quickly realized; meanwhile, the latest service parameters only cached cannot meet the different service parameter change effective strategies of different service parameters and different service applications.
Disclosure of Invention
In view of the above problems, an object of the present invention is to provide a multi-version configuration method for application cluster service parameters, that is, to provide a method for caching multi-version service parameters and accessing service parameters through a proxy layer in a service application; the method realizes the support of multi-version service parameters and various service parameter validation strategies on the service application, and once a problem occurs in the process of releasing the new version of the service parameters, the service parameters used by the service application can be quickly and simply backed off in one key mode, so that the service can be recovered to be normal at the highest speed; meanwhile, when the service parameters are released, the service parameter version can be finely validated according to the service requirements, so that service personnel can conveniently manage and release the service parameters to adjust the service processing process.
The second purpose of the invention is to provide a multi-version configuration system for applying the cluster service parameters.
The first technical scheme adopted by the invention is as follows: a multi-version configuration method for application cluster service parameters comprises the following steps:
s100: caching business parameters of a plurality of versions at a proxy layer, wherein the plurality of versions comprise a currently effective version PnLast life-time version Pn-1And last life-time version Pn-2;
S200: service code accesses the currently valid version P through the proxy layernThe service parameter of (2);
s300: when a backspace instruction is received, the proxy layer switches the service parameter version accessed by the service code to the last life version Pn-1Or the last validated version Pn-2As whenPreproduction version Pn';
Wherein, when switching to the last production version Pn-1As the currently validated version Pn' hour, the last life-span version Pn-1Last valid version P ofn-3Loading the current effective version P to the proxy layer for cachingnDelete from the proxy layer;
when switching to the last life-time version Pn-2As the currently validated version Pn' hour, the last life-time version Pn-2Last valid version P ofn-4And last life-time version Pn-3Loading the current effective version P to the proxy layer for cachingnAnd the last lifetime version P before switchingn-1Deleted from the proxy layer.
Preferably, the step S300 further includes:
when the service parameter releases a new version, the current effective version P is releasednCopying one copy to the proxy layer, and copying the current effective version P based on the change information in the Zookeepern' modification to a new version, switching access of the proxy layer to the new version as the currently active version Pn'; performing version upgrade to validate the new version;
the updating of the version to take effect of the new version specifically comprises the following steps:
deleting the last valid version P before modificationn-2Updating the new version to the currently effective version Pn', currently validated version P before modificationnUpdating to last life-time version Pn-1', last life-time version P before modificationn-1Updated to last life-time version Pn-2'。
Preferably, the currently effective version P to be copied based on the change information in the Zookeeper isn' modification is specifically the new version:
all change record nodes of the new version are extracted from the Zookeeper, all the change record nodes are analyzed in a circulating traversal mode, and after all the change record nodes are analyzed, the copied current effective version P is achievedn' modified to a new version.
Preferably, directing the access of the proxy layer to the new version specifically comprises:
(1) currently active version P to be replicatednThe' reference points to the last life-time version Pn-2A memory address pointed to;
(2) the last effective version Pn-2The reference points to the last valid version Pn-1A memory address pointed to;
(3) the last life-span version Pn-1The reference points to the currently active version PnPointed to memory address and the current effective version PnReference points to the currently validated version P of the copyn'' to a memory address to effect a change in the proxy layer access version.
Preferably, after the service parameter releases the new version, the new version validation policy includes an immediate validation policy, a centralized validation policy, and a periodic validation policy.
Preferably, the immediate-effect policy is specifically:
currently validated version PnAfter the replication is completed, the access of the proxy layer is immediately switched to the currently active version P of the replicationn'' while on the currently validated version of the copy Pn' modified to form a new version; the new version is taken as the currently effective version Pn';
When the version is upgraded to take effect, when any one service application fails to update the new version, the new version in other service applications can still take effect.
Preferably, the centralized validation policy specifically includes:
currently validated version PnAfter the replication is completed, the proxy layer still accesses the currently valid version PnFor the currently active version P of the copyn' modified to form a new version; switching the access of the agent layer to a new version after reaching the appointed time interval; the new version is taken as the currently effective version Pn';
When the version is updated to take effect, all the service applications take effect at the same time when all the service applications feed back that the new version is updated; if any one service application fails to update the new version, all the service applications fail to take effect on the new version.
Preferably, the periodically effective policy is specifically:
currently validated version PnAfter the replication is completed, the proxy layer still accesses P on the current effective versionnFor the currently active version P of the copyn' modified to form a new version; when the appointed effective time is reached, the access of the agent layer is switched to a new version; the new version is taken as the currently effective version Pn';
When the version is upgraded to take effect, when any one service application fails to update the new version, the new version in other service applications can still take effect.
The second technical scheme adopted by the invention is as follows: a multi-version configuration system applying cluster service parameters comprises a service parameter caching module, an access module and a rollback processing module;
the business parameter caching module is used for caching business parameters of a plurality of versions at a proxy layer, wherein the plurality of versions comprise a current effective version PnLast life-time version Pn-1And last life-time version Pn-2;
The access module is used for the business code to access the business parameter P of the current effective version through the agent layern;
The rollback processing module is used for switching the service parameter version accessed by the service code to the last life effective version P by the proxy layer when receiving a rollback instructionn-1Or the last validated version Pn-2As the currently validated version Pn';
Wherein, when switching to the last production version Pn-1As the currently validated version Pn' hour, the last life-span version Pn-1Last valid version P ofn-3Loading the current effective version P to the proxy layer for cachingnDelete from the proxy layer;
when switching to the last life-time version Pn-2As the currently validated version Pn' hour, the last life-time version Pn-2Last valid version P ofn-4And last life-time version Pn-3Loading the current effective version P to the proxy layer for cachingnAnd the last lifetime version P before switchingn-1Deleted from the proxy layer.
Preferably, the system further comprises a new version updating module;
the new version updating module is used for updating the currently effective version P after the service parameters release the new versionnCopying one copy to the proxy layer, and copying the current effective version P based on the change information in the Zookeepern' modification to a new version, pointing the access of the proxy layer to the new version as the currently active version Pn'; performing version upgrade to validate the new version;
the updating of the version to take effect of the new version specifically comprises the following steps:
deleting the last valid version P before modificationn-2Updating the new version to the currently effective version Pn', currently validated version P before modificationnUpdating to last life-time version Pn-1', last life-time version P before modificationn-1Updated to last life-time version Pn-2'。
The beneficial effects of the above technical scheme are that:
(1) the multi-version configuration method for the application cluster service parameters realizes the support of multi-version service parameters and various service parameter validation strategies on service application, and once a problem occurs in the process of releasing the new version of the service parameters, the service parameters used by the service application can be quickly and simply backed off in one key mode, so that the service can be recovered to be normal at the highest speed.
(2) When the new version of the service parameter is released, the new version of the service parameter can be finely validated according to the service requirement, so that service personnel can conveniently manage and release the new version of the service parameter to adjust the service processing process.
Drawings
Fig. 1 is a flowchart of a multi-version configuration method for application cluster service parameters according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of three business parameters of the present version according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a service code accessing service parameters through a Proxy layer according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a service parameter layout on a fallback service application according to an embodiment of the present invention;
fig. 5 is a schematic diagram illustrating a new version update of a service parameter according to an embodiment of the present invention;
FIG. 6 is a diagram of a new version immediate validation policy provided by one embodiment of the present invention;
FIG. 7 is a diagram illustrating a new version centralized validation policy provided by an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a multi-version configuration system for applying cluster service parameters according to an embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be described in further detail with reference to the drawings and examples. The following detailed description of the embodiments and the accompanying drawings are provided to illustrate the principles of the invention and are not intended to limit the scope of the invention, which is defined by the claims, i.e., the invention is not limited to the preferred embodiments described.
In the description of the present invention, it is to be noted that, unless otherwise specified, "a plurality" means two or more; the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance; the specific meaning of the above terms in the present invention can be understood as appropriate to those of ordinary skill in the art.
Example 1
As shown in fig. 1, this embodiment discloses a multi-version configuration method for application cluster service parameters, which includes the following steps:
s100: as shown in FIG. 2, inThe proxy layer of the local memory of the business application caches the business parameters of a plurality of versions, wherein the plurality of versions at least comprise the current effective version Pn(Current Version), last production Version Pn-1(Last Version) and Last production Version Pn-2(last Last Version);
S200: service code accesses current effective edition P through Proxy layer (Proxy layer)nThe service parameter of (2);
as shown in FIG. 3, the business code in the business application accesses the currently validated version P through the Proxy layernThe service parameter of (2); the Proxy layer can control the version of the currently accessed business parameter, such as the currently validated version PnLast life-time version Pn-1Or last life-time version Pn-2The service code only focuses on what parameters are used, but does not focus on what version the used parameters are and the switching of versions.
The Proxy layer (Proxy layer) is an entrance for the business code to access the parameter data, the internal logic of the Proxy layer realizes the switching of the parameter version, and the control of the business code to access the latest version is realized through the effective strategy of the new version; the agent layer is realized by the encapsulation of a built-in data structure of a development language, and service parameters of three versions are stored in the agent layer under normal conditions, namely a currently effective version Pn(Current Version), last production Version Pn-1(Last Version) and Last production Version Pn-2(Last Version), in order to realize the switching between the versions, two temporary Version spaces are saved, such as the latest Version to be validated and the Last-life-span Version (Last Version) which needs to be eliminated; the business parameters accessed by the business code are always data in the currently active Version (Current Version).
The agent layer is realized by using Java language, the agent layer is packaged into a class, and 5 main attributes are respectively currentVersion (currently effective version P) in the class of the agent layern) lastVersion (last life version P)n-1) Lastlastlastversion (last life version P)n-2) Tmpcurentversion (replicated currently validated version P)n''), tmplastversion (the last validated version to be deleted), tmpCurrentVersion and tmplastversion are both temporary version attributes; the 5 main attributes are used for storing parameter data by adopting a Hashmap (Hashmap) nested Hashmap two-layer structure; key in the Hashmap of the first layer is the name of the parameter, and value is the value of the parameter and is stored through the Hashmap; the key in the Hashmap of the second layer is a business main key of the parameter value, and the value is an object of the parameter value.
S300: when a problem occurs and a service parameter format on a service application needs to be backed off in time, a system operation and maintenance person or system management sends a back-off instruction, and a Proxy layer receives the back-off instruction and then switches service parameter data versions accessed by all service codes to a previous life-time version Pn-1Or the last effective version is the last life effective version Pn-2As the currently validated version Pn' use;
after the Proxy layer completes the switching of the service parameter data version (to the last life version P)n-1Or last life-time version Pn-2) When switching to the next valid version P, as shown in FIG. 4n-1(Last Version) as the currently validated Version Pn' time, the synchronization component (Sync) is responsible for switching the current active version (last active version P) from the databasen-1) Last valid version P ofn-3(lastlastlastversion) is loaded into the proxy layer of the local memory of the service application for caching; at the same time, the current effective version P before switchingnDelete from the proxy layer;
when switching to the last valid version Pn-2As the currently validated version Pn' hour, the switched current effective version (last effective version P)n-2) Last valid version P ofn-4And last life-time version Pn-3Loading the current effective version P to the proxy layer for cachingnAnd the last lifetime version P before switchingn-1Deleted from the proxy layer.
Further, in an embodiment, as shown in fig. 5, after the service parameter releases a new Version, the Sync copies a Current valid Version (Current Version) to a proxy layer of the service application local memory, and modifies the copied Current Version into the new Version according to the change information in the Zookeeper; the access of the Proxy layer points to the modified copied Current Version, namely points to the new Version;
the version upgrading is carried out to take effect of the new version, and the method specifically comprises the following steps: last life-time version P before modificationn-2Invalidating and deleting; updating the new version to the currently valid version Pn', the currently active version P before modificationnUpdating to last life-time version Pn-1' the last production version P before modificationn-1Updated to last life-time version Pn-2', Current Version-Last Version, Last Version-Last Version.
Wherein, the ZooKeeper is a distributed application program coordination service of a distributed and open source code; the node structure for recording the change content in the Zookeeper is as follows:
modifyUser maintenance operator
modifyTime time of maintenance (date + hours, minutes, seconds)
modifyItem maintenance parameter name
key: maintaining unique key values for parameters
Items: attribute name
before value of modification
afterValue: modified value
The specific changing process of modifying the copied Current Version into a new Version according to the changing information in the Zookeeper is as follows:
(1) taking out all change record nodes of the new version from the Zookeeper;
(2) circularly traversing and analyzing all change record nodes, taking out the value of the modifyItem in the change nodes, finding all values of corresponding parameters in Hashmap pointed by the attribute tmpurrentVersion according to the value (Hashmap is stored), searching corresponding parameter values in the Hashmap storing all parameter values according to the value of key in the change nodes, modifying the value on a parameter value object according to the attribute information changed in items, if the corresponding parameter values are not found, instantiating an object by using the class corresponding to the parameters, and assigning the object attributes according to the records in items (attrbutie Name is consistent to the attribute names of the parameter classes);
(3) when all the change record nodes are analyzed, the Hashmap pointed by the attribute tmpurrentVersion is the parameter data of the latest version, namely the current effective version P to be copied is realizedn' modified to a new version.
The change of the access of the Proxy layer, namely, the access of the Proxy layer is directed to the new version, is realized by the following modes:
the change of the memory address referenced by the attribute is realized when the Proxy layer realizes the switching of the access version in the Java language, for example, when the parameter of a new version is released, the attribute currentVersion (the currently effective version P) is firstly releasedn) The pointed parameter is copied to a copy and the attribute tmpcurentversion (the current valid version of the copy P) is copiedn'') points to the copied argument, and the changed content of the new version argument is in the attribute tmpcurentversion (the current valid version P of the copy)n'') to a new version as the currently active version Pn'; after the new version is changed and modified, the change pointed by the attribute reference is carried out; first the attribute tmpLastLastVersion (the current validated version P of the copy)n'') reference points to the property lastlastlastlastversion Pn-2) Pointed to memory address, the next attribute lastlastlastlastversion (last life-time version P)n-2) The reference points to lastVersion (last production version P)n-1) The memory address pointed to, again attribute lastVersion (last life version P)n-1) The reference points to currentVersion (the currently validated version P)n) Pointed to memory address, then attributes currentVersion (currently validated version P)n) The reference points to tmpcurentversion (the current validated version of the copy, P)n') the memory address pointed to; finally, the attribute tmpLastLastVersion (last valid version P to be deleted) may be deletedn-2) And tmpcurentversion (replicated currently validated version P)n'') reference points to null, or the attribute tmpLa may not be usedThe stLastVersion reference points to null, so that the version rollback is required immediately after the new version is released, the parameter pointed by the attribute tmpLastVersion reference can be directly used without loading in a database; this completes a change to the Proxy layer access version, with the currentVersion attribute already pointing to the latest parameter version.
When the business parameters are released in a new version, the new version validation strategies comprise immediate validation, centralized validation and periodic validation strategies;
(1) immediate validation policy
As shown in fig. 6, the new version immediate validation policy specifically includes: the original Current Version (currently validated Version P) is completed in Syncn) Immediately after replication, the Proxy layer's access to parameters and rules is switched to the replicated Current Version (replicated currently validated Version P)n'') and the Current Version after copying (the Current validated Version of the copy P)n') modified to a new version; the new version being the currently validated version Pn'; wherein Sync pairs the replicated Current Version Pn' ') the modification is performed in synchronization with the Proxy's access to parameters and rules;
when the version is upgraded to take effect, any service application fails to update the new version, and the new version in other service applications can not be affected.
(2) Centralized validation policy
As shown in fig. 7, the new version centralized validation policy specifically includes: the original Current Version (currently validated Version P) is completed in Syncn) After replication, the Proxy layer still has access to the original Current Version (currently validated Version P)n) Parameters and rules above, where Sync is to the post-Copy Current Version Pn') modifying to form a new version; switching Proxy access to parameter and rule cache to modified replicated Current Version (replicated currently validated Version P) after reaching the agreed time intervaln'), i.e. switch to a new version; the new version being the currently validated version Pn'。
When the version is updated to take effect, all the service applications take effect at the same time when all the service applications feed back that the new version is updated; if any service application fails to update the new version, the new version will not take effect in any service application;
for example, in the case of application clustering deployment, the parameter data may exist on multiple deployment instances of multiple service applications, that is, the parameter data may exist in memories of M service applications; the centralized validation is that after the new version of the desired parameter is released, the M service applications take effect simultaneously within the shortest time of the new version change, and the mode needs to obtain that the M service applications feed back that the new version is updated, and then the new version can take effect integrally, if one service application does not feed back, the new version will not take effect in any service application; after receiving that the new version can be switched, the service application defaults to make the new version effective after a certain time (e.g. 3 minutes).
(3) Periodic validation policy
The strategy for the new version to take effect regularly is approximately the same as the strategy for the new version to take effect in a set, and the difference is that the time for taking effect is definite, such as a few minutes in hours and a few minutes in hours on which day; that is, the regular validation refers to that an explicit validation time is specified when a new version is released, the time is relatively long, and once the specified validation time is up, all service applications will take effect the new version once several hours later or tomorrow zero elapses;
when the version is upgraded to take effect, any service application fails to update the new version, and the new version in other service applications can not be affected.
The Proxy switching in the new version validation strategy is essentially a delay task, and the immediate validation strategy, the centralized validation strategy and the regular validation strategy are realized by uniformly using the delay task; wherein, the time delay in the immediate effective strategy is 0, and the time delay of the centralized effective strategy and the periodical effective strategy is N.
Example 2
As shown in fig. 2, the present embodiment discloses a multi-version configuration system for application cluster service parameters, which includes a service parameter caching module, an access module, and a rollback processing module;
the service parameter caching module is used for caching service parameters of a plurality of versions at the proxy layer, wherein the plurality of versions comprise a current effective version PnLast life-time version Pn-1And last life-time version Pn-2;
The access module is used for the business code to access the currently effective version P through the agent layernThe service parameter of (2);
the backspace processing module is used for switching the service parameter version accessed by the service code to a life-generating version P by the proxy layer when receiving a backspace instructionn-1Or last life-time version Pn-2As the currently validated version Pn';
Wherein, when switching to the last valid version Pn-1As the currently validated version Pn' when, last life-time version Pn-1Last valid version P ofn-3Loading the current effective version P to the proxy layer for cachingnDelete from the proxy layer;
when switching to the last valid version Pn-2As the currently validated version PnAt' time, the last life-time version Pn-2Last valid version P ofn-4And last life-time version Pn-3Loading the current effective version P to the proxy layer for cachingnAnd the last lifetime version P before switchingn-1Deleted from the proxy layer.
Further, in one embodiment, the system further comprises a new version validation module;
the new version validation module is used for issuing the current validation version P after the service parameter releases the new versionnCopying one copy to the proxy layer, and copying the current effective version P based on the change information in the Zookeepern' modification to a new version, pointing the access of the proxy layer to the new version as the currently active version Pn'; performing version upgrade to validate the new version;
the version upgrading to validate the new version specifically comprises the following steps:
deleting the last valid version P before modificationn-2Updating the new version to the currently effective version Pn', currently validated version P before modificationnUpdating to last life-time version Pn-1', last life-time version P before modificationn-1Updated to last life-time version Pn-2'。
The multi-version configuration method and the system for the application cluster service parameters realize the support of multi-version service parameters and various service parameter validation strategies on service application, and once a problem occurs in the process of releasing the new version of the service parameters, the service parameters used by the service application can be quickly and simply backed off in one key mode, so that the service can be recovered to be normal at the fastest speed.
When the new version of the service parameter is released, the new version of the service parameter can be finely validated according to the service requirement, so that service personnel can conveniently manage and release the new version of the service parameter to adjust the service processing process.
While the invention has been described with reference to a preferred embodiment, various modifications may be made and equivalents may be substituted for elements thereof without departing from the scope of the invention. In particular, the technical features mentioned in the embodiments can be combined in any way as long as there is no structural conflict. It is intended that the invention not be limited to the particular embodiments disclosed, but that the invention will include all embodiments falling within the scope of the appended claims. The invention has not been described in detail and is part of the common general knowledge of a person skilled in the art.
Claims (7)
1. A multi-version configuration method for application cluster service parameters is characterized by comprising the following steps:
s100: caching business parameters of a plurality of versions at a proxy layer, wherein the plurality of versions comprise a currently effective version PnLast life-time version Pn-1And last life-time version Pn-2;
S200: service code accesses the currently valid version P through the proxy layernThe service parameter of (2);
s300: when a backspace instruction is received, the proxy layer switches the service parameter version accessed by the service code to the last life version Pn-1Or the last validated version Pn-2As the currently validated version Pn';
Wherein, when switching to the last production version Pn-1As the currently validated version Pn' hour, the last life-span version Pn-1Last valid version P ofn-3Loading the current effective version P to the proxy layer for cachingnDelete from the proxy layer;
when switching to the last life-time version Pn-2As the currently validated version Pn' hour, the last life-time version Pn-2Last valid version P ofn-4And last life-time version Pn-3Loading the current effective version P to the proxy layer for cachingnAnd the last lifetime version P before switchingn-1Delete from the proxy layer;
when the service parameter releases a new version, the current effective version P is releasednCopying one copy to the proxy layer, and copying the current effective version P based on the change information in the Zookeepern"modify to the new edition, switch the visit of the agent layer to the new edition, the said new edition is regarded as the edition P of taking effect at presentn'; performing version upgrade to validate the new version;
wherein the currently effective version P to be copied based on the change information in the ZookeepernThe modification to the new version is specifically as follows: all change record nodes of the new version are extracted from the Zookeeper, all the change record nodes are analyzed in a circulating traversal mode, and after all the change record nodes are analyzed, the copied current effective version P is achievedn"modified to a new version;
the updating of the version to take effect of the new version specifically comprises the following steps: deleting the last valid version P before modificationn-2Updating the new version to the currently effective version Pn', currently validated version P before modificationnUpdating to last life-time version Pn-1' last life-time version before modificationPn-1Updated to last life-time version Pn-2'。
2. The multi-version configuration method according to claim 1, wherein switching access of the proxy layer to the new version specifically comprises:
(1) currently active version P to be replicatedn"reference points to last production version Pn-2A memory address pointed to;
(2) the last effective version Pn-2The reference points to the last valid version Pn-1A memory address pointed to;
(3) the last life-span version Pn-1The reference points to the currently active version PnPointed to memory address and the current effective version PnReference points to the currently validated version P of the copyn"memory address pointed to effect a change in the proxy layer access version.
3. The multi-version configuration method of claim 1, wherein the new version validation policy comprises an immediate validation policy, a centralized validation policy, and a periodic validation policy after the service parameter issues the new version.
4. The multi-version configuration method according to claim 3, wherein the immediate validation policy is specifically:
currently validated version PnAfter the replication is completed, the access of the proxy layer is immediately switched to the currently active version P of the replicationn", while on the currently active version P of the copyn"make modifications to form new versions; the new version is taken as the currently effective version Pn';
When the version is upgraded to take effect, when any one service application fails to update the new version, the new version in other service applications can still take effect.
5. The multi-version configuration method according to claim 3, wherein the centralized validation policy is specifically:
currently validated version PnAfter the replication is completed, the proxy layer still accesses the currently valid version PnFor the currently active version P of the copyn"make modifications to form new versions; switching the access of the agent layer to a new version after reaching the appointed time interval; the new version is taken as the currently effective version Pn';
When the version is updated to take effect, all the service applications take effect at the same time when all the service applications feed back that the new version is updated; if any one service application fails to update the new version, all the service applications fail to take effect on the new version.
6. The multi-version configuration method according to claim 3, wherein the periodically-validated policy is specifically:
currently validated version PnAfter the replication is completed, the proxy layer still accesses the currently valid version PnFor the currently active version P of the copyn"make modifications to form new versions; when the appointed effective time is reached, the access of the agent layer is switched to a new version; the new version is taken as the currently effective version Pn';
When the version is upgraded to take effect, when any one service application fails to update the new version, the new version in other service applications can still take effect.
7. A multi-version configuration system applying cluster service parameters is characterized by comprising a service parameter caching module, an access module, a rollback processing module and a new version updating module;
the business parameter caching module is used for caching business parameters of a plurality of versions at a proxy layer, wherein the plurality of versions comprise a current effective version PnLast life-time version Pn-1And last life-time version Pn-2;
The access module is used for the business code to access the business parameter P of the current effective version through the agent layern;
The above-mentionedThe rollback processing module is used for switching the service parameter version accessed by the service code to the last life effective version P by the proxy layer when receiving a rollback instructionn-1Or the last validated version Pn-2As the currently validated version Pn';
Wherein, when switching to the last production version Pn-1As the currently validated version Pn' hour, the last life-span version Pn-1Last valid version P ofn-3Loading the current effective version P to the proxy layer for cachingnDelete from the proxy layer;
when switching to the last life-time version Pn-2As the currently validated version Pn' hour, the last life-time version Pn-2Last valid version P ofn-4And last life-time version Pn-3Loading the current effective version P to the proxy layer for cachingnAnd the last lifetime version P before switchingn-1Delete from the proxy layer;
the new version updating module is used for updating the currently effective version P after the service parameters release the new versionnCopying one copy to the proxy layer, and copying the current effective version P based on the change information in the Zookeepern"modify to new version, point the access of the agent layer to the new version, the new version is taken as the current effective version Pn'; performing version upgrade to validate the new version;
wherein the currently effective version P to be copied based on the change information in the ZookeepernThe modification to the new version is specifically as follows: all change record nodes of the new version are extracted from the Zookeeper, all the change record nodes are analyzed in a circulating traversal mode, and after all the change record nodes are analyzed, the copied current effective version P is achievedn"modified to a new version;
the updating of the version to take effect of the new version specifically comprises the following steps: deleting the last valid version P before modificationn-2Updating the new version to the currently effective version Pn', currently validated version P before modificationnUpdating to last life-time version Pn-1', last life-time version P before modificationn-1Updated to last life-time version Pn-2'。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110810541.0A CN113282335B (en) | 2021-07-19 | 2021-07-19 | Multi-version configuration method and system for application cluster service parameters |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110810541.0A CN113282335B (en) | 2021-07-19 | 2021-07-19 | Multi-version configuration method and system for application cluster service parameters |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113282335A CN113282335A (en) | 2021-08-20 |
| CN113282335B true CN113282335B (en) | 2021-10-15 |
Family
ID=77286687
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110810541.0A Active CN113282335B (en) | 2021-07-19 | 2021-07-19 | Multi-version configuration method and system for application cluster service parameters |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113282335B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115344549B (en) * | 2022-08-26 | 2025-10-17 | 济南浪潮数据技术有限公司 | Method, device and storage medium for recovering historical version of multi-version function |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106713458A (en) * | 2016-12-23 | 2017-05-24 | 智者四海(北京)技术有限公司 | Zookeeper cluster deployment method, Zookeeper cluster deployment device, Zookeeper instance deployment method, Zookeeper instance deployment device, and Zookeeper cluster management platform |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102073520A (en) * | 2010-12-30 | 2011-05-25 | 中国民航信息网络股份有限公司 | Dynamic management system and method for C++ application program version |
| CN103283209B (en) * | 2011-04-18 | 2015-12-09 | 北京新媒传信科技有限公司 | An application service platform system and its implementation method |
| US9665360B2 (en) * | 2011-07-29 | 2017-05-30 | Glory Global Solutions (International) Limited | System and method for updating configuration data for sub-systems of an automated banking machine |
| CN107548085A (en) * | 2016-06-24 | 2018-01-05 | 中兴通讯股份有限公司 | Base station edition backing method and system |
| CN108418857B (en) * | 2018-01-22 | 2021-06-22 | 北京奇艺世纪科技有限公司 | Zookeeper cluster system and connection method and device thereof |
| CN111522665A (en) * | 2020-04-24 | 2020-08-11 | 北京思特奇信息技术股份有限公司 | Zookeeper-based method for realizing high availability and load balancing of Influxdb-proxy |
-
2021
- 2021-07-19 CN CN202110810541.0A patent/CN113282335B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106713458A (en) * | 2016-12-23 | 2017-05-24 | 智者四海(北京)技术有限公司 | Zookeeper cluster deployment method, Zookeeper cluster deployment device, Zookeeper instance deployment method, Zookeeper instance deployment device, and Zookeeper cluster management platform |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113282335A (en) | 2021-08-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7526479B2 (en) | Configuration manager in enterprise computing system | |
| US7254578B2 (en) | Concurrency classes for shared file systems | |
| US7693888B2 (en) | Data synchronizer with failover facility | |
| JP4427586B2 (en) | Data processing method and apparatus | |
| US20100070472A1 (en) | Method and system for maintaining current data for wireless devices | |
| US10275347B2 (en) | System, method and computer program product for managing caches | |
| US20140089474A1 (en) | System and method for managing multiple server node clusters using a hierarchical configuration data structure | |
| WO2001084338A9 (en) | Cluster configuration repository | |
| JP2003528391A (en) | Method and apparatus for storing changes to file attributes without having to store additional copies of file contents | |
| US12292833B2 (en) | System and method for cache invalidation | |
| US8490078B2 (en) | System and method for application management | |
| CN111881223A (en) | Data management method, device, system and storage medium | |
| CN114996337B (en) | Multi-cluster database management system and method | |
| CN111506592A (en) | Method and device for upgrading database | |
| US7281014B2 (en) | Method and apparatus for moving data between storage devices | |
| US7890468B2 (en) | Rollback support in distributed data management systems | |
| US20190065327A1 (en) | Efficient versioned object management | |
| CN113282335B (en) | Multi-version configuration method and system for application cluster service parameters | |
| CN114844879A (en) | Image management method, electronic device and storage medium | |
| CN110618996B (en) | Function library heat updating method applied to distributed database | |
| US10162841B1 (en) | Data management platform | |
| EP4136541B1 (en) | Transactional support for non-relational database | |
| CN118860993B (en) | Metadata processing method and device based on distributed storage system | |
| CN114327603A (en) | Data caching method and device thereof, and computer-readable storage medium | |
| CN104301355A (en) | Cluster heat disposition method and system based on single machine complete disposition and new old node pool |
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 |