CN104092718B - The update method of configuration information in distributed system and distributed system - Google Patents

The update method of configuration information in distributed system and distributed system Download PDF

Info

Publication number
CN104092718B
CN104092718B CN201310687405.2A CN201310687405A CN104092718B CN 104092718 B CN104092718 B CN 104092718B CN 201310687405 A CN201310687405 A CN 201310687405A CN 104092718 B CN104092718 B CN 104092718B
Authority
CN
China
Prior art keywords
configuration information
configuration
component
client
renewal
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
CN201310687405.2A
Other languages
Chinese (zh)
Other versions
CN104092718A (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.)
Tencent Cyber Tianjin Co Ltd
Original Assignee
Tencent Cyber Tianjin 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 Tencent Cyber Tianjin Co Ltd filed Critical Tencent Cyber Tianjin Co Ltd
Priority to CN201310687405.2A priority Critical patent/CN104092718B/en
Publication of CN104092718A publication Critical patent/CN104092718A/en
Application granted granted Critical
Publication of CN104092718B publication Critical patent/CN104092718B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of update method of configuration information in distributed system and distributed system.The system includes configuration client, server cluster, the updating device of configuration information and at least one subscription client;Server cluster is used for storage configuration information;Wherein the updating device of configuration information is used to monitor server cluster, judges that configuration information whether occurs in server cluster changes event;When occurring configuration information change event, the configuration information of renewal is obtained from server cluster;And the message for the configuration information for including updating is sent to each subscription client;And be additionally operable to confirm the configuration information whether each subscription client has successfully received renewal.The present invention confirms to subscribe to the configuration information whether client has successfully received renewal by the updating device of configuration information, it can determine to subscribe to whether client can be successfully updated configuration information in time, overcome defect of the prior art, effectively improve the reliability of configuration information update in distributed system.

Description

The update method of configuration information in distributed system and distributed system
Technical field
The present invention relates to field of computer technology, configuration information in more particularly to a kind of distributed system and distributed system Update method.
Background technology
In distributed system such as distributed real time computation system, each distributed component is often distributed in different servers In node, in order to can correctly cooperate between each distributed component, generally require to share some configuration informations, and need configuration Information can be changed dynamically and Fast synchronization.
In existing distributed system, the technology of the synchronous configuration information of each distributed component typically borrows ZooKeeper and carried The high availability and event notification mechanism of confession are realized.ZooKeeper is a reliable coordination system for being directed to large-scale distributed system Unite there is provided function include configuring maintenance, name Service, distributed synchronization and group service etc..ZooKeeper target is exactly The error-prone key service of packaged complexity, use is supplied to by the system of interface and performance efficiency easy to use, function-stable Family.Fig. 1 is the scene graph in existing distributed computing system using ZooKeeper renewal configuration informations.Pass through a client Configuration information is stored in a node server of ZooKeeper clusters by end (Client) connection ZooKeeper clusters (service)Or multiple node servers(service)On, as shown in figure 1, including three nodes with ZooKeeper clusters Server A, server B and server C, including six client (Client) customer end As, customer end B, client C, clients Exemplified by D, client E and client F, the more new technological process of configuration information is described.Specifically it may include steps of:1st, client E Configuration information is write into ZooKeeper clusters in server B and server C as configuration client.2nd, need to match somebody with somebody confidence Distributed component customer end A, customer end B, client C, client D and the client F of breath are connected respectively as client is subscribed to ZooKeeper clusters go to read and subscribe to this configuration information, the thing that so-called subscription is namely provided in itself using ZooKeeper Part informing mechanism monitors configuration information in server B and server C nodes in the ZooKeeper clusters for storing configuration information Change.3rd, the corresponding component for subscribing to configuration information can receive a node configuration information and change when configuration information is changed Change event, subscriber can be according to this event, i.e. goes on ZooKeeper to obtain newest node data configuration information. 4th, obtaining the client of new configuration information can upgrade in time and synchronous newest configuration information, then make corresponding change. Each client(Client)It is that the heartbeat mechanism provided by ZooKeeper is protected with the server node in ZooKeeper clusters Hold connection.
During the present invention is realized, inventor has found that prior art at least has problems with:Above-mentioned prior art Distributed system in configuration information renewal process in, ZooKeeper informing mechanism is disposable, after notifying once, The client of subscription can be cancelled, and the client subscribed to it is whether notified and update configuration information success or not no To guarantee.And only when subscription client does not receive notice for a long time, now need the client subscribed to go to subscribe to again, It is exactly again to the corresponding configuration node server registration action listeners of ZooKeeper.Therefore, match somebody with somebody in existing distributed system The update scheme reliability of confidence breath is relatively low.
The content of the invention
In order to solve problem of the prior art, the embodiments of the invention provide in a kind of distributed system and distributed system The update method of configuration information.The technical scheme is as follows:
On the one hand there is provided a kind of distributed system, the system includes configuration client, server cluster, with confidence The updating device of breath and at least one subscription client;The server cluster, for storage configuration information;The server set Group includes at least one server;
The configuration client, is communicated with each server in the server cluster, described for updating The configuration information in server cluster;
The updating device of the configuration information, for monitoring the server cluster, judges the server set Configuration information whether occurs in group and changes event;
The updating device of the configuration information, is additionally operable to when occurring configuration information change event, from the server set The configuration information of renewal is obtained in group;
The updating device of the configuration information, being additionally operable to send to each subscription client includes the configuration of the renewal The message of information;
The updating device of the configuration information, is additionally operable to confirm whether each subscription client has successfully received the renewal Configuration information;
Each subscription client, respectively the updating device with the configuration information be connected, described match somebody with somebody confidence for receiving The message for the configuration information including the renewal that the updating device of breath is sent.
On the other hand there is provided a kind of update method of configuration information in distributed system, the distributed system includes Configure client, server cluster, the updating device of configuration information and at least one subscription client;Methods described includes:
The configuration client updates the configuration information in the server cluster;
The updating device of the configuration information is monitored the server cluster, judge be in the server cluster No generation configuration information changes event;
When occurring configuration information change event, the updating device of the configuration information is obtained from the server cluster The configuration information of renewal;
The updating device of the configuration information includes the configuration information of the renewal to each subscription client transmission Message;
The updating device of the configuration information confirms whether each subscription client has successfully received the configuration of the renewal Information.
The update method of configuration information in the distributed system and distributed system of the embodiment of the present invention, when configuration client The configuration information in server cluster is updated, server cluster is monitored by the updating device of configuration information, service is judged Configuration information whether occurs in device cluster and changes event;When occurring configuration information change event, the updating device of configuration information The configuration information of renewal is obtained from server cluster;The message for the configuration information for including updating is sent to each subscription client; And confirm to subscribe to the configuration information whether client has successfully received renewal.In the technical scheme of the embodiment of the present invention, configuration information Updating device be also used for confirming to subscribe to whether client has successfully received the configuration information of renewal, so as to determine to order in time Read whether client can be successfully updated configuration information, overcome defect of the prior art, effectively improve distributed system The reliability of middle configuration information update.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, makes required in being described below to embodiment Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings Accompanying drawing.
Fig. 1 is the scene graph in existing distributed computing system using ZooKeeper renewal configuration informations.
The structural representation for the distributed system that Fig. 2 provides for one embodiment of the invention.
The structural representation for the distributed system that Fig. 3 provides for another embodiment of the present invention.
The structural representation for the distributed system that Fig. 4 provides for yet another embodiment of the invention.
Fig. 5 is configuration information update process schematic in distributed system provided in an embodiment of the present invention.
The flow chart of the update method of configuration information in the distributed system that Fig. 6 provides for one embodiment of the invention.
The flow chart of the update method of configuration information in the distributed system that Fig. 7 provides for another embodiment of the present invention.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention Formula is described in further detail.
The structural representation for the distributed system that Fig. 2 provides for one embodiment of the invention.As shown in Fig. 2 the present embodiment Distributed system can specifically include configuration client 20, server cluster 30, the updating device 40 of configuration information and at least one Individual subscription client 50.
Wherein server cluster 30 is used for storage configuration information;30 include at least one server in server cluster;Match somebody with somebody Put client 20 to be communicated with each server in server cluster 30, match somebody with somebody confidence for updating in server cluster 30 Breath;The configuration information in each or multiple servers can for example be updated in server cluster 30.In the present embodiment more New write-in or modification etc. operation can newly be included.
The updating device 40 of configuration information is connected with server cluster 30, and server cluster 30 is monitored, and judges clothes Whether occur configuration information in business device cluster 30 and change event;Specifically, the updating device 40 and server cluster of configuration information Each server communication in 30, is monitored to each server 31 in server cluster 30, judges whether sent out in each server Raw configuration information changes event.When occurring configuration information change event, the updating device 40 of configuration information matches somebody with somebody confidence from generation The configuration information that renewal is obtained in the server in the server cluster 30 of change event is ceased, and is sent to each subscription client 50 The message of configuration information including renewal.
Accordingly, each client 50 of subscribing to is connected with the updating device 40 of configuration information, and each client 50 of subscribing to is used to connect Receive the message of the configuration information for including updating of the transmission of updating device 40 of configuration information.The updating device 40 of configuration information with it is each Subscribe to client 50 to connect, the updating device 40 of configuration information confirms to subscribe to whether client 50 has successfully received configuration information more The configuration information for the renewal that new equipment 40 is sent.Each subscription client 50 in the present embodiment is equivalent to point in distributed system Cloth component, it is necessary to get the configuration information of renewal in time when each distributed component carries out business processing, therefore can also be by Computation module or processing assembly referred to as in distributed system.
The distributed system of the present embodiment, the configuration information in server cluster is updated when configuration client, by with confidence The updating device of breath is monitored server cluster, judges that configuration information whether occurs in server cluster changes event;When When generation configuration information changes event, the updating device of configuration information obtains the configuration information of renewal from server cluster;To It is each to subscribe to the message that client sends the configuration information for including updating;And confirm to subscribe to whether client has successfully received matching somebody with somebody for renewal Confidence ceases.In the technical scheme of the present embodiment, the updating device of configuration information is also used for confirming to subscribe to whether client is successfully received To the configuration information of renewal, so as to determine to subscribe to whether client can be successfully updated configuration information in time, overcome Defect of the prior art, effectively improves the reliability of configuration information update in distributed system.
Alternatively, the updating device 40 of configuration information, is additionally operable to from occurring configuration information and changing the server of event Obtain after the configuration information updated, and generate configuration information mark, the configuration information identifies objective to the subscription for unique mark The configuration information that family end 50 is sent.Now the updating device 40 of configuration information, includes specifically for being sent to subscription client 50 The message of configuration information and the configuration information mark of renewal, and set up configuration information mark in therein and subscribe to client 50 Mark mapping relations.
Accordingly, the side of client 50 is being subscribed to, is subscribing to client 50, the updating device 40 for receiving configuration information is sent The configuration information for including updating and configuration information mark message, and the configuration information update itself of the renewal in message Configuration information, and from message obtain configuration information mark, then to configuration information updating device 40 send include configure The response message of the mark of message identification and the subscription client 50.
Still optionally further, the updating device 40 of configuration information, being additionally operable to receive to subscribe to client 50 and send includes configuration The response message of the mark of message identification and the subscription client 50.And the mark of the subscription client 50 in response message The mapping relations of corresponding configuration information mark and the mark for subscribing to client 50 are found, configuration information mark is therefrom obtained;So The configuration information mark that the configuration information in the mapping relations being locally stored is identified and subscription client 50 is sent is compared afterwards Compared with whether both are identical for judgement, if identical, it is determined that subscribing to client 50 updates configuration information success, client is subscribed in otherwise determination It is unsuccessful that end 50 updates configuration information.If it is determined that subscribing to client 50 updates that configuration information is unsuccessful, now configuration information is more New equipment 40, is additionally operable to send the message of the configuration information for including updating and configuration information mark to subscription client 50 again. That is the distributed system of the present embodiment is provided with retransmission mechanism.
Still optionally further, the updating device 40 of configuration information, if being additionally operable in preset time period not receive subscription visitor During the response message that family end 50 is fed back, it is determined that subscribing to client 50 is unsuccessfully received configuration information;Now configuration information is more New equipment 40, is additionally operable to send the message of the configuration information for including updating and configuration information mark to subscription client 50 again. That is the distributed system of the present embodiment is provided with the scheme for postponing and retransmitting.
It is former that distributed system work is discussed in detail in following embodiments in a kind of specific workflow of distributed system Illustrate the technical side of the present invention to be subscribed to one exemplified by client 50 sends the configuration information updated in reason, the embodiment Case.
Configuration client 20 is monitored to each server in server cluster 30, judges whether sent out in each server Raw configuration information changes event.When occurring configuration information change event, the updating device 40 of configuration information matches somebody with somebody confidence from generation The configuration information of renewal is obtained in the server for ceasing change event, and generates configuration information mark, the configuration information, which is identified, to be used for The configuration information that unique mark is sent to the subscription client 50;Then the updating device 40 of configuration information to subscribe to client 50 Send the message of the configuration information for including updating and configuration information mark.The updating device 40 of configuration information sets up configuration information mark The mapping relations of the mark of knowledge and subscription client 50.
The configuration information for including updating and the configuration that the updating device 40 of configuration information is sent are received when subscribing to client 50 During the message of message identification, the configuration information of the configuration information update itself of the renewal in message, and obtained from message Configuration information is identified, and then being sent to the updating device 40 of configuration information includes configuration information and identify and the subscription client 50 The response message of mark.The mark of subscription client 50 of the updating device 40 of configuration information in response message finds correspondence Configuration information mark and subscribe to client 50 mark mapping relations, therefrom obtain configuration information mark;Then will be local The configuration information mark that configuration information mark and subscription client 50 in the mapping relations of storage are sent is compared, and judges two Whether person is identical, if identical, it is determined that subscribing to client 50 updates configuration information success, otherwise determines to subscribe to client 50 and update to match somebody with somebody Confidence breath is unsuccessful.If it is determined that subscribing to unsuccessful, the now weight of updating device 40 of configuration information that updates configuration information of client 50 The new message that the configuration information for including updating and configuration information mark are sent to subscription client 50.It follows that the present embodiment Distributed system update configuration information during provide configuration information retransmission mechanism, improve renewal configuration information Efficiency.
And if the updating device 40 of configuration information does not receive in preset time period and subscribes to the response that client 50 is fed back During message, it is determined that subscribing to client 50 is unsuccessfully received configuration information;Now the updating device 40 of configuration information is again to ordering Read the message that client 50 sends the configuration information for including updating and configuration information mark.Due to understanding, the distribution of the present embodiment Formula system provides the scheme for postponing and retransmitting, and improves the efficiency for updating configuration information.
The distributed system of the present embodiment, confirms to subscribe to whether client is successfully received by the updating device of configuration information To the configuration information of renewal, so as to determine to subscribe to whether client can be successfully updated configuration information in time, overcome Defect of the prior art, effectively improves the reliability of configuration information update in distributed system.And match somebody with somebody confidence updating During breath provide configuration information retransmission mechanism, can it is determined that subscribe to client receive not successfully renewal match somebody with somebody confidence During breath, the configuration information updated again to subscription client, and go to subscribe to again without subscribing to client, reduce subscription Client updates the complexity of configuration information, improves the efficiency for updating configuration information.Further, also configuration information is being updated Delay scheme is provided in scheme, after preset time period, if not receiving response message, sends and wraps to subscription client again The configuration information of renewal and the message of configuration information mark are included, reduces and subscribes to the complexity that client updates configuration information, carry The high efficiency for updating configuration information.
And in the prior art, can be to causing the substantial amounts of monitoring of data and reading to a node when subscriber is excessive Write, it is easy to cause that configuration information update postpones or the situation of failure occurs, and configuration component in the embodiment of the present invention and Confirm that component can be separated, and linear distribution formula extension can also be each carried out, so as to spread the work, it is to avoid will monitor with And reading writing working is supported on same node, timely and effectively configuration information can be updated.
The structural representation for the distributed system that Fig. 3 provides for another embodiment of the present invention.As shown in figure 3, the present embodiment Distributed system on the basis of the upper embodiment illustrated in fig. 2, the updating device of configuration information is carried out further more Specific description.The updating device 40 of the configuration information of the present embodiment as shown in Figure 3 includes configuration component 10 and confirmation group Part 11.Configuration component 10 is used to monitor server cluster 30, judges whether occur configuration information in server cluster 30 Change event;Configuration component 10 is additionally operable to, when occurring configuration information change event, obtain what is updated from server cluster 30 Configuration information;Configuration component 10 is additionally operable to send the message for the configuration information for including updating to subscription client 50;Confirm component 11 are used to confirm to subscribe to the configuration information whether client 50 has successfully received the renewal that configuration component 10 is sent.
It should be noted that multiple match somebody with somebody can also be included in treatment effeciency, the updating device 40 of configuration information in order to increase Put in component 10 and multiple confirmation components 11, the present embodiment and illustrated exemplified by one.And as shown in figure 3, the present embodiment The server cluster 30 of system in a distributed manner include at least one server 31;Exemplified by, fit end 20 and each service Device 31 is connected, and the configuration information in each server 31 can be updated.In the distributed system of the present embodiment, wherein configuring Configuration component 10 is monitored the server cluster 30 of storage configuration information in distributed system in the updating device 40 of information, One or multiple servers 31 can be included in the server cluster 30.Specifically, configuration component 10 and server cluster 30 In every server 31 connect, configuration component 10 can be monitored every server 31 in server cluster 30, with Judge that configuration information whether occurs in server cluster 30 changes event, wherein configuration information changes event and namely judges to service Whether the configuration information in device cluster 30 changes, and changes and changes event as configuration information.When generation configuration information During change event, configuration component 10 occurs to obtain in the server 31 of configuration information change event from server cluster 30 to be updated Configuration information;And the message for the configuration information for including updating is sent to subscription client 50.Subscription client in the present embodiment End 50 is each distributed component in distributed system, and each distributed component is to subscribe to client 50 to need in business processing Upgrade in time the configuration information, and carries out service computation, therefore can also computation module or processing assembly.Therefore, when with , it is necessary to which the configuration component is in time to the configuration information that the transmission of client 50 updates is subscribed to, for subscribing to when confidence breath changes Client 50 upgrades in time the configuration information in itself.
Confirmation component 11 in the present embodiment can be tracked with subscribing to logical 50 letter of client to subscribing to client 50, Confirm to subscribe to the configuration information whether client 50 has successfully received the renewal that configuration component 10 is sent.For example confirm that component 11 can be with Client 50 is subscribed in inquiry, confirms its configuration information for whether being successfully received the renewal of the transmission of configuration component 10.Or also may be used To arrange with subscribing to client 50, the configuration information that client 50 is successfully received the renewal of the transmission of configuration component 10 is being subscribed to When.To one confirmation of transmission of component 11 is confirmed, confirm that component 11 subscribes to client and is successfully received configuration component to inform The configuration information of 10 renewals sent.Or confirm component 11 can also employing mode realize to subscribe to client 50 tracking, Confirm to subscribe to the configuration information whether client 50 has successfully received the renewal that configuration component 10 is sent, will not be repeated here.
In the present embodiment, configuration component 10 is used to, to the configuration information that the transmission of client 50 updates is subscribed to, confirm component 11 For being tracked to subscribing to client 50, confirm to subscribe to whether client 50 has successfully received the renewal that configuration component 10 is sent Configuration information, configuration component 10 and confirmation component 11 can work simultaneously in a distributed manner, improve the work of configuration information update device Efficiency.
The updating device of the distributed system configuration information of the present embodiment, passes through the configuration of the updating device by configuration information Component is monitored server cluster, judges that configuration information whether occurs in server cluster changes event;When configuring When information changes event, configuration component obtains the configuration information of renewal from server cluster;Configuration component to subscribe to client Send the message for the configuration information for including updating;Confirm that component confirms to subscribe to whether client has successfully received configuration component transmission The configuration information of renewal.In the technical scheme of the present embodiment, confirm to order by the confirmation component of the updating device of configuration information The configuration information whether client has successfully received renewal is read, so as to determine to subscribe to whether client can succeed more in time New configuration information, overcomes defect of the prior art, effectively improves the reliability of configuration information update in distributed system.
And in the prior art, can be to causing the substantial amounts of monitoring of data and reading to a node when subscriber is excessive Write, it is easy to cause that configuration information update postpones or the situation of failure occurs, and configuration component in the embodiment of the present invention and Confirm that component can be separated, and linear distribution formula extension can also be each carried out, so as to spread the work, it is to avoid will monitor with And reading writing working is supported on same node, timely and effectively configuration information can be updated.
Still optionally further, on the basis of the technical scheme of above-described embodiment, configuration component 10 is additionally operable to generation configuration Message identification, configuration information identifies the configuration information sent for unique mark to subscription client 50;Configuration component 10 is specific Message for sending the configuration information for including updating and from configuration information mark to subscription client 50.
Configuration component 10 obtain configuration information after, to subscribe to the send configuration information of client 50 before, can be first The configuration information sent to the subscription client 50 generates a configuration information mark, and configuration information mark can be according to reality Border demand sets length, for example, can be 64, or 32 or other length etc..It is configured so that being somebody's turn to do for the transmission of component 10 The configuration information of renewal is exactly unique.
Still optionally further, on the basis of the technical scheme of above-described embodiment, configuration component 10 is with confirming that component 11 connects Connect, configuration component 10, which is additionally operable to send to confirmation component 11, includes configuration information mark.So, confirm that component 11 can be according to this The configuration information of the configuration information for the renewal that unique mark is sent to the subscription client 50 identifies to track the subscription client 50, confirm whether the subscription client 50 is successfully received the configuration information of the renewal of the transmission of configuration component 110.
It should be noted that in order to improve treatment effeciency, the more new clothes of the configuration information in distributed system shown in Fig. 3 It can also be multiple to put the configuration component 10 in 40, and so, configuration component 10 is also needed to the confirmation send configuration component of component 11 10 mark, so, can be to the configuration component 10 when subsequently confirming component 11 to 10 feedback response message of configuration component Identify corresponding configuration component and send response message.
Still optionally further, confirm component 11 be additionally operable to receive subscribe to client 50 send include configuration information identify Response message, the configuration information for subscribing to the transmission of client 50 is designated the message for subscribing to client 50 from reception configuration component transmission Middle acquisition;Confirm that component 11 identifies and subscribed to client 50 specifically for the configuration information sent according to configuration component 10 and sends Configuration information mark, confirm to subscribe to whether client 50 has successfully received the configuration information of renewal.
For example it can be seen from above-mentioned record, the matching somebody with somebody including renewal that configuration component 10 is sent is received when subscribing to client 50 After the message that confidence is ceased and configuration information is identified, configuration information mark can be got, is then fed back to confirmation component 11 The response message identified including the configuration information.So confirm that component 11 is received by two configuration information marks, one is to match somebody with somebody Put component 10 transmission, another be subscribe to client 50 send, now confirm component 11 can according to receive this two Individual configuration information identifies to judge to subscribe to the configuration information whether client 50 is successfully received renewal.For example confirm that component 11 has Body is used to judge that the configuration information that configuration information mark and subscription client 50 that configuration component 10 is sent are sent identifies whether phase Together, if identical, it is determined that subscribing to the configuration information that client 50 has successfully received the renewal of configuration component transmission;Otherwise, it is determined that order Read the configuration information of the failed renewal for receiving configuration component transmission of client 50.
Further, confirm that component 11 judges the configuration information mark of the transmission of configuration component 10 and subscribe to client 50 to send Configuration information when identifying whether identical, specifically can be in the following way:
Confirm that the configuration information that component 11 is sent to configuration component 10 identifies and subscribed to the configuration information that client 50 is sent Mark carries out XOR(exclusive OR;It is abbreviated as XOR)Operation, is confirmed value, and judges whether verification value is 0, if 0, determine the configuration information mark in the message that configuration component 10 is sent and subscribe to the configuration information for the return that client 50 is sent Mark is identical, now subscribes to client 50 and is successfully updated configuration information;Otherwise differ, now subscribe to client 50 failed more New configuration information.
It should be noted that when multiple subscription clients 50 subscribe to configuration information simultaneously, now being needed during configuration component 10 Will to each subscription client 50 be tracked, now configuration component 10 except to confirm the send configuration message identification of component 11 and Outside the mark of configuration component 10, the subscription client 50 of the configuration information for receiving the renewal is also sent to confirmation component 10 Mark, be easy to confirm component 11 track the subscription client 50.Configuration information mark, confirmation component 11 in component 11 is confirmed Mark and subscribe to client 50 mark can using map by the way of store.When subscribe to client 50 to confirm component 11 In the response message of feedback in addition to being identified including configuration information, yet include the mark for subscribing to client 50, so, true Recognize in component 11 can according to the configuration information mark of the mark and storage for subscribing to client 50, confirm the mark of component 11 with And the identity map of client 50 is subscribed to, the mark of the configuration information of the transmission of configuration component 10 is got, then again to configuration group The configuration information mark that the configuration information mark and subscription client 50 that part 10 is sent are sent carries out judgement processing.
Still optionally further, on the basis of the technical scheme of above-described embodiment, wherein confirming that component 11 is additionally operable to true When subscribing to the configuration information for the renewal that client 50 has successfully received configuration component transmission surely, sent to configuration component 10 and subscribe to client End 50 is successfully received the response message of configuration information.It is configured so that component 10 just can be learnt to be sent to and subscribes to client 50 The configuration information of renewal has sent success, subscribes to client 50 and has also been updated successfully, improves in distributed system and update The reliability of configuration information.
Or alternatively, on the basis of the technical scheme of above-described embodiment, confirm that component 11 is additionally operable to determine to subscribe to visitor When family end 50 receives the configuration information of the renewal of configuration component transmission not successfully, sent to configuration component 10 and subscribe to client 50 not It is successfully received the response message of configuration information;Now accordingly, configuration component 10 be additionally operable to receive confirm component 11 send out The subscription client 50 sent is unsuccessfully received after the response message of configuration information, and being sent again to subscription client 50 is included more The message of new configuration information and configuration information mark.For example confirm the configuration information mark that component 11 is sent to configuration component 10 With subscribe to client 50 send configuration information mark carry out xor operation be confirmed value not for 0 when, can be to configuration component 10 Send and subscribe to the response message that client 50 is unsuccessfully received configuration information;Now accordingly, configuration component 10 is again to ordering Read the message that client 50 sends the configuration information for including updating and configuration information mark.
In the distributed system of prior art in the renewal process of configuration information, ZooKeeper informing mechanism is once Property, after notifying once, the client of subscription can be cancelled, and whether the client subscribed to is notified and updates with confidence Breath success or not cannot be guaranteed.And only when subscription client does not receive notice for a long time, now need the visitor subscribed to Family end is gone to subscribe to again, that is, again to the corresponding configuration node server registration action listeners of ZooKeeper.Thus may be used Know, in the update scheme of existing configuration information, informing mechanism is disposable, is not successfully received for the first time when subscribing to client To renewal configuration information when, do not support retransmit, and need subscribe to client again subscription procedure it is extremely complex, it is less efficient. And the technical scheme of above-described embodiment is used, the retransmission mechanism of configuration information, energy are provided during configuration information is updated Enough when it is determined that subscribing to the configuration information for the renewal that client receives configuration component transmission not successfully, again to subscription client hair The raw configuration information updated, and go to subscribe to again without subscribing to client, reduce subscription client and update answering for configuration information Polygamy, improves the efficiency for updating configuration information.
Still optionally further, on the basis of the technical scheme of above-described embodiment, if wherein configuration component 10 is additionally operable to The success of subscription client 50 or be unsuccessfully received configuration information for confirming that component 11 is sent are not received in preset time period Response message when, it is determined that subscribe to client 50 be unsuccessfully received configuration information;Now configuration component 10 be additionally operable to again to Subscribe to the message that client 50 sends the configuration information for including updating and configuration information mark.
By using such scheme, the renewal configuration information scheme that the present invention is provided additionally provides delay scheme, if configuration Component does not receive the success of subscription client or be unsuccessfully received with confidence for confirming that component is sent in preset time period During the response message of breath, it is determined that subscribing to client is unsuccessfully received configuration information;Now configuration component is again to subscription client End sends the message of the configuration information for including updating and configuration information mark.Compared with prior art, it is not required that subscribe to client Configuration information is subscribed at end again, and directly after preset time period, if not receiving response message, again to subscription client hair The configuration information including renewal and the message of configuration information mark are sent, reduces and subscribes to the complexity that client updates configuration information Property, improve the efficiency for updating configuration information.
All technical schemes of above-described embodiment can be combined using combinable mode, and the formation present invention's can Embodiment is selected, is no longer illustrated one by one herein.
The technical scheme of above-described embodiment, confirms to subscribe to whether client has successfully received matching somebody with somebody for renewal by confirming component Confidence ceases, and so as to determine to subscribe to whether client can be successfully updated configuration information in time, overcomes in the prior art Defect, effectively improve the reliability of configuration information update in distributed system.And during configuration information is updated , can be it is determined that subscribe to client receives matching somebody with somebody for the renewal that configuration component is sent not successfully there is provided the retransmission mechanism of configuration information When confidence ceases, the configuration information updated again to subscription client, and go to subscribe to again without subscribing to client, reduce The complexity that client updates configuration information is subscribed to, the efficiency for updating configuration information is improved.Further, also configuration is being updated Delay scheme is provided in information scheme, after preset time period, if not receiving response message, again to subscription client hair The configuration information including renewal and the message of configuration information mark are sent, reduces and subscribes to the complexity that client updates configuration information Property, improve the efficiency for updating configuration information.
And in the prior art, can be to causing the substantial amounts of monitoring of data and reading to a node when subscriber is excessive Write, it is easy to cause that configuration information update postpones or the situation of failure occurs, and configuration component in the embodiment of the present invention and Confirm that component can be separated, and linear distribution formula extension can also be each carried out, so as to spread the work, it is to avoid will monitor with And reading writing working is supported on same node, timely and effectively configuration information can be updated.
The structural representation for the distributed system that Fig. 4 provides for yet another embodiment of the invention.As shown in figure 4, the present embodiment Distributed system on the basis of above-mentioned Fig. 2 and embodiment illustrated in fig. 3, with one specifically application scenarios introduce the present invention Technical scheme.
As shown in figure 4, the server cluster 30 of the present embodiment can be realized using ZooKeeper clusters 30 ', should ZooKeeper clusters 30 ' are the DDM and system coordination framework of a High Availabitity.Based on to Paxos algorithms Realize, the framework is ensure that the strong consistency of data in distributed environment, as long as the server no more than half works as machine(If Half that the number of servers of normal service is not enough, then original cluster will likely be divided into what two information can not be unanimously Zookeeper is serviced), the service just can normally run, therefore ensure that using Zookeeper the reliable memory of configuration information. Now accordingly, user can write configuration information by configuring client 20 clothes of storage configuration information on ZooKeeper Business device node, or change are stored in the configuration information on this server node.
The updating device 40 of configuration information in the present embodiment can be realized using Storm streaming computings platform, Storm The Spout interfaces (namely data source reading interface) that streaming computing platform is provided realize the use of ConfigSpout components 10 ' In the function of realizing configuration component 10, the data for monitoring the node of storage configuration information in ZooKeeper clusters change thing Part, and read in real time newest configuration information and configuration information be packaged as one can sequence object, then utilize Storm The stream data interface that streaming computing platform is provided, configuration information as entitled config_stream stream is sent, example Such as config_stream includes configuration information and configuration information mark.Confirm that component 11 can use Storm streaming computings Acker components 11 ' are designed in platform to realize, are responsible for configuration information update and are successfully confirmed and notified when updating failure Configuration information is carried out overtime repeating transmission by ConfigSpout components 10 ', and subscribing to client 50 can be put down using Storm streaming computings The Bolt components 50 ' designed in platform are realized, illustrate the technology of the present invention in Fig. 4 exemplified by including three Bolt components 50 ' Scheme.Bolt components 50 ' is subscribe to the distributed computing components of configuration information, and Storm streaming computings platform is responsible for The fault-tolerant and distributed function of ConfigSpout components 10 ', Acker components 11 ' and Bolt components 50 ' etc..
The Bolt components 50 ' (distributed computing components interface) of configuration information are ordered in the way of AllGrouping (broadcast) The config_stream of ConfigSpout components 10 ', and the ConfigSpout provided using Storm streaming computings platform are provided The real-time forwarding capability of component 10 ' to Bolt components 50 ' causes subscriber to obtain newest configuration information and timely in real time Update the configuration of oneself.
Due to ConfigSpout components 10 ', Bolt components 50 ' and Acker components 11 ' are all that Storm streaming computings are put down The component of platform Plays, therefore can all be extended with distributed linear, then the heartbeat provided by Storm streaming computings platform Mechanism.And also have its processor in Storm streaming computing platforms, for when some component stops offer service, Storm to flow The processor in formula calculating platform can this component of pull-up again accordingly, so as to carry out fault-tolerant processing.
When Bolt components 50 ', which update, completes configuration, it is necessary to which sending one to Acker components 11 ' confirms what is be updated successfully Configuration information mark can be included in response message, the response message.Acker components 11 ' can carry out true according to certain algorithm Recognize the calculating of information, when Acker components 11 ', which have received Bolt components 50 ', updates the confirmation for completing configuration, be notified that The currently transmitted configuration information of ConfigSpout components 10 ', Bolt components 50 ' are updated over completing, if configurable one In the section time, ConfigSpout components 10 ', which never have, to be received the config update that Acker components 11 ' send over and successfully believes Newest configuration information be resend portion by breath, the then meeting of ConfigSpout components 10 '.
In the present embodiment, ConfigSpout components 10 ' can be to multiple send configuration information of Bolt components 50 ', just as one The structure of individual Tuple trees.By taking configuration information update process schematic in the distributed system shown in Fig. 5 as an example, Fig. 5 with ConfigSpout components 10 ' are to exemplified by three send configuration information of Bolt components 50 '.Acker components 11 ' are born in the present embodiment Each Tuple for including configuration information that duty tracking ConfigSpout components 10 ' are sent.When a tuple quilt When ConfigSpout components 10 ' are created, the spout-tuple-id i.e. configuration information that it can be endowed one 64 is identified Carrying is sent to Bolt components 50 ' in Tuple.ConfigSpout components 10 ' send out the spout-tuple-id of 64 simultaneously Acker components 11 ' are given, Acker components 11 ' are exactly to go tracking to include with this using this spout-tuple-id to match somebody with somebody confidence Bolt components 50 ' associated the Tuple of breath, because Bolt components 50 ' can give Acker components after the completion of configuration information is updated 11 ' send 64 in a response message, and the message that carrying reception ConfigSpout components 10 ' are sent in the response message The spout-tuple-id of position.
It should be noted that ConfigSpout components 10 ' still send the mark of the ConfigSpout components 10 ' To Acker components 11 ', one of spout-tuple-id to a pair of a values can be so stored in Acker components 11 ' Mapping.This first value to value is the id for the ConfigSpout components 10 ' for creating this tuple, and this is for completing Message is sent when handling tuple, wherein the process being updated to a subscription configuration information of client 50 is one Individual tuple.Second value is the ackval " of one 64, and ack val are an expressions of whole tuple state, and it is The tupleidspout-tuple-id that simply the corresponding Bolt components 50 ' of spout-tuple-id are replied is configuration information The tupleidspout-tuple-id that mark and ConfigSpout components 10 ' are sent is configuration information mark XOR together (XOR).When Acker components 11 ' find that ack val become 0, Acker components 11 ' and determine that spout-tuple-id is corresponding to match somebody with somebody Confidence breath Tuple is completed by the processing of Bolt components 50 ', and Acker components 11 ' can just notify Config Spout groups The corresponding Bolt components 50 ' of the spout-tuple-id of part 10 ' have been updated over configuration information success.After having handled, Acker components 11 ' discovery ack val can not notify spout-tuple-id pairs of Config Spout components 10 ' for 0, Acker components 11 ' The renewal configuration information of Bolt components 50 ' answered is unsuccessful, and ConfigSpout components 10 ' resend newest configuration information It is a to Bolt components 50 '.The mechanism of repeating transmission configuration information is supported i.e. in this embodiment scheme.ConfigSpout components 10 ' are also During any message for not receiving Acker components 11 ' in preset time period, by newest configuration information resend to Bolt components 50 ' are a.Support delay is laid equal stress on to send out the mechanism of configuration information i.e. in this embodiment scheme.
The distributed system of the present embodiment, confirms to subscribe to client by the confirmation component in the updating device of configuration information Whether end has successfully received the configuration information of renewal, so as to determine to subscribe to whether client can be successfully updated configuration in time Information, overcomes defect of the prior art, effectively improves the reliability of configuration information update in distributed system.And The retransmission mechanism of configuration information is provided during updating configuration information, can be it is determined that subscription client receives match somebody with somebody not successfully During the configuration information for the renewal for putting component transmission, the configuration information updated again to subscription client, and without subscribing to visitor Family end is gone to subscribe to again, reduces and subscribes to the complexity that client updates configuration information, improves the efficiency for updating configuration information. Further, delay scheme is also provided in configuration information scheme is updated, after preset time period, is disappeared if not receiving response Breath, again to the message that configuration information and configuration information are identified that client transmission includes updating is subscribed to, reduces subscription client End updates the complexity of configuration information, improves the efficiency for updating configuration information.And in the prior art, when subscriber is excessive When, can be to causing the substantial amounts of monitoring of data and read-write to a node, it is easy to cause configuration information update to postpone or lose Situation about losing occurs, and the configuration component and confirmation component in the embodiment of the present invention can be separated, and can also each enter line Property distributed extension, so as to spread the work, it is to avoid will monitor and reading writing working is supported on same node, Neng Gouji When effectively configuration information is updated.
The flow chart of the update method of configuration information in the distributed system that Fig. 6 provides for one embodiment of the invention.This reality Applying the distributed system of example includes configuration client, server cluster, the updating device of configuration information and at least one subscription visitor Family end, specifically may be referred to any described distributed systems of above-mentioned Fig. 2-Fig. 4.As shown in fig. 6, the distributed system of the present embodiment The update method of configuration information, specifically may include steps of in system:
100th, configuration client updates the configuration information in server cluster;
Renewal in the present embodiment includes changing the configuration information in server cluster, or is write in server cluster New configuration information.
101st, the updating device of configuration information is monitored server cluster, judges whether match somebody with somebody in server cluster Confidence ceases change event;
The update method of configuration information in the distributed system of the present embodiment, for each distribution in distributed system Subscription client in formula component such as the present embodiment carry out the renewal of configuration information with it is synchronous.The wherein updating device of configuration information Specifically the Servers-all in server cluster is monitored, judges whether occur in any server in server cluster Configuration information changes event.It is to refer to that configuration information sends change that configuration information in the present embodiment, which changes event, specifically may be used Think that new write-in configuration information or configuration information occur modification etc. and changed.
102nd, when occurring configuration information change event, the updating device of configuration information obtains renewal from server cluster Configuration information;
When configuration information, which is sent, to be changed, configuration information change occurs from server cluster for the updating device of configuration information Server in obtain the configuration information of renewal.
103rd, the updating device of configuration information sends the message for the configuration information for including updating to each subscription client;
Subscription client in the present embodiment is the distributed component in distributed system, and each distributed component carries out real , it is necessary to get newest configuration information in time during the business processing of border.Therefore when when configuration information transmission change, configuration information Updating device get after the configuration information of renewal, it is necessary to include the configuration information of renewal to subscribing to client and send in time Message.
104th, the updating device of configuration information confirms whether each subscription client has successfully received the configuration information of renewal.
The update method of the configuration information of the present embodiment, by using the above method realize the renewal of configuration information with it is above-mentioned Relevant apparatus embodiment realizes that the realization mechanism of the renewal of configuration information is identical, and the record of above-described embodiment is may be referred in detail, It will not be repeated here.
The update method of the configuration information of the present embodiment, is carried out by the updating device by configuration information to server cluster Monitor, judge that configuration information whether occurs in server cluster changes event;When occurring configuration information change event, with confidence The updating device of breath obtains the configuration information of renewal from server cluster;The updating device of configuration information is sent out to client is subscribed to Send the message of the configuration information including renewal;And confirm to subscribe to the configuration information whether client has successfully received renewal.This implementation Example technical scheme in, confirmed by the updating device of configuration information subscribe to client whether have successfully received renewal match somebody with somebody confidence Breath, so as to determine to subscribe to whether client can be successfully updated configuration information in time, overcomes of the prior art lack Fall into, effectively improve the reliability of configuration information update in distributed system.
Alternatively, on the basis of the technical scheme of above-described embodiment, wherein the updating device of configuration information includes configuration Component and confirmation component.Accordingly, in above-described embodiment " updating device of configuration information enters step 101 to server cluster Row is monitored, and judges configuration information change event whether occurs in server cluster ", it can specifically include:Configuration component is to service Device cluster is monitored, and judges that configuration information whether occurs in server cluster changes event.
Accordingly, " when occurring configuration information and changing event, the updating device of configuration information is from server set for step 102 The configuration information of renewal is obtained in group ", it can specifically include:When occurring configuration information and changing event, configuration component is from service The configuration information of renewal is obtained in device cluster.
Further accordingly, " updating device of configuration information is sent to each subscription client includes matching somebody with somebody for renewal to step 103 Confidence breath message ", can specifically include:Configuration component includes disappearing for the configuration information of renewal to each subscription client transmission Breath ".
Further accordingly, " updating device of configuration information confirms whether each subscription client has successfully received to step 1034 The configuration information for the renewal that configuration component is sent, can specifically include:Configuration component confirms whether each subscription client is successfully received The configuration information of the renewal sent to configuration component.
Still optionally further, on the basis of the technical scheme of above-described embodiment, wherein " configuration component is objective to subscribing to for step Family end sends the message for the configuration information for including updating " before, it can also include:Configuration component generation configuration information mark, matches somebody with somebody Putting message identification is used for unique mark to the configuration information for subscribing to client transmission.
Now accordingly, step " configuration component sends the message for the configuration information for including updating to client is subscribed to ", tool Body can include configuration component includes the message of the configuration information and configuration information mark updated to client transmission is subscribed to.
Still optionally further, on the basis of the technical scheme of above-described embodiment, " configuration component generates configuration information to step After mark ", it can also include:Configuration component is sent to confirmation component includes configuration information mark.
Still optionally further, on the basis of the technical scheme of above-described embodiment, step " configuration component to subscribe to client Send the message of the configuration information for including updating and configuration information mark " after, it can also comprise the following steps:
(1)Confirm that component is received and subscribe to the response message identified including configuration information that client is sent, subscription client The configuration information that end is sent, which is designated, subscribes to what client was obtained from the message that configuration component is sent is received;
(2)Confirm that the configuration information that component is sent according to configuration component identifies and subscribed to the configuration information mark that client is sent Know, confirm to subscribe to the configuration information whether client has successfully received renewal.
For example confirm that the configuration information that component specifically may determine that configuration component is sent identifies and subscribed to what client was sent Configuration information identify whether it is identical, if identical, it is determined that subscribe to client have successfully received configuration component transmission renewal match somebody with somebody confidence Breath;Otherwise, it is determined that subscribe to the configuration information that client receives the renewal of configuration component transmission not successfully.
Further, on the basis of the technical scheme of above-described embodiment, the following two kinds situation can also be included:
If the firstth, confirm that component determines to subscribe to the configuration information for the renewal that client has successfully received configuration component transmission, Confirm that component is sent to configuration component and subscribe to the response message that client is successfully received configuration information;
If the second, confirming, component determines to subscribe to the configuration information for the renewal that client receives configuration component transmission not successfully When, sent to configuration component and subscribe to the response message that client is unsuccessfully received configuration information;
Now accordingly, configuration component is unsuccessfully received with confidence in the subscription client for receiving confirmation component transmission After the response message of breath, the message of the configuration information for including updating and configuration information mark is sent to subscription client again.
Two kinds of situations arranged side by side when the first above-mentioned situation and second of situation.Above-mentioned second of situation, which is provided, matches somebody with somebody confidence The retransmission mechanism of breath, improves the efficiency of configuration information update.
Further, on the basis of the technical scheme of above-described embodiment, the scheme of above-described embodiment can also be included such as Lower step:
(a)If configuration component do not received in preset time period confirm component send subscription client success or not When being successfully received the response message of configuration information, it is determined that subscribing to client is unsuccessfully received configuration information;
(b)Configuration component is sent to subscription client again includes the configuration information of renewal and disappearing for configuration information mark Breath.
Such scheme provides the delay of configuration information and retransmission mechanism, improves the renewal efficiency of configuration information.
Above-mentioned all optional technical schemes, can be combined using any combinable mode, form the present invention's Alternative embodiment, this is no longer going to repeat them.
The update method of the configuration information of above-described embodiment, by using the above method realize the renewal of configuration information with it is upper State relevant apparatus embodiment and realize that the realization mechanism of the renewal of configuration information is identical, the note of above-described embodiment is may be referred in detail Carry, will not be repeated here.
The update method of the configuration information of above-described embodiment, by the confirmation component in the updating device of configuration information come really Recognize and subscribe to whether client has successfully received the configuration information of renewal, so as to determine to subscribe to client in time whether can be into Work(updates configuration information, overcomes defect of the prior art, and effectively improve configuration information update in distributed system can By property.And the retransmission mechanism of configuration information is provided during configuration information is updated, can be it is determined that subscribing to client During the configuration information of the failed renewal for receiving configuration component transmission, the configuration information updated again to subscription client, And go to subscribe to again without subscribing to client, reduce and subscribe to the complexity that client updates configuration information, improve renewal and match somebody with somebody The efficiency of confidence breath.Further, delay scheme is also provided in configuration information scheme is updated, after preset time period, If not receiving response message, the message of the configuration information for including updating and configuration information mark is sent to subscription client again, Reduce and subscribe to the complexity that client updates configuration information, improve the efficiency for updating configuration information.
The flow chart of the update method of configuration information in the distributed system that Fig. 7 provides for another embodiment of the present invention.Such as Shown in Fig. 7, the update method of configuration information is by above-mentioned Fig. 5 and its follow-up alternative embodiment in the distributed system of the present embodiment The update method application of configuration information introduces the technical scheme of the embodiment of the present invention in a distributed system, specifically.Such as Fig. 6 institutes Show, the update method of configuration information, specifically may include steps of in the distributed system of the present embodiment:
200th, configuration client updates the configuration information in server cluster;
Wherein server cluster includes at least one server;Configuration client can update each in server cluster Configuration information in platform or multiple servers.Renewal in the present embodiment can include new write-in or modification etc. operation.
201st, configuration component is monitored to server cluster, judges configuration information change whether occurs in server cluster Event;When occurring configuration information change event, step 202 is performed;Otherwise continue to monitor;
In the present embodiment, configuration component can be specifically monitored to each server in server cluster, judge each clothes Whether occur configuration information in business device and change event.
202nd, configuration component obtains the configuration information of renewal from server cluster;Perform step 203;
Specifically, configuration component can obtain what is updated from the server for occurring configuration information change event monitored Configuration information.
203rd, configuration component is to be sent to the configuration information generation configuration information mark for subscribing to client;Perform step 204;
In the present embodiment, the configuration information identifies the configuration information sent for unique mark to the subscription client.Should Configuration information mark could be arranged to 64 or 32 or 16 etc. according to the actual requirements.
204th, configuration component includes the message of the configuration information and configuration information mark updated to client transmission is subscribed to; Perform step 205;
205th, configuration component to confirm component send configuration component mark, configuration information mark and the subscription client mark Know;Perform step 206;
The mark and configuration information of the subscription client are identified for being tracked to subscribing to client, to determine to subscribe to visitor Whether family end has successfully received configuration information, and is successfully updated configuration information.Configuration component mark confirms component for the ease of follow-up To corresponding configuration component feedback response message.
Wherein step 205 and step 204 can be not limited in sequence.
206th, confirm that component sets up configuration component mark, configuration information mark and subscribes to the mapping pass of the mark of client System;Perform step 207;
It should be noted that when only one of which subscribes to client subscription configuration information, configuration component can not be to confirmation Component sends the mark for subscribing to client, because only that it is not in not know which is subscribed to after client that one, which is subscribed to client, Continue to confirmation component feedback message.Because, can be according to step when there is multiple subscription clients in order to improve treatment effeciency 205 and 206 perform.
207th, subscribe to client receive configuration component transmission include update configuration information and configuration information mark During message, the configuration information of the configuration information update itself of the renewal in message, and include configuration to confirming that component is sent The feedback information of the configuration information of message identification and subscription client identification;Perform 208;
208th, confirm that component finds corresponding configuration component mark, configuration information according to subscription client identification and identifies and order The mapping relations of the mark of client are read, and obtain the configuration information mark that corresponding configuration component is sent in mapping relations, and Configuration information mark is obtained from the feedback information for subscribing to client;Perform step 209;
209th, confirm that the configuration information that component judges that configuration component is sent identifies and subscribed to the configuration information of client feedback Identify whether it is identical, if when identical, perform step 210;If otherwise differ, step 211 is performed;
210th, confirm that component determines that subscribing to client updates configuration information success, performs step 212;
211st, confirm that component determines that subscription client renewal configuration information is unsuccessful, perform step 213;
212nd, confirm that component identifies to send to corresponding configuration component according to configuration component in mapping relations and subscribe to client Configuration information success is updated, is terminated.
213rd, confirm that component identifies to send to corresponding configuration component according to configuration component in mapping relations and subscribe to client Update configuration information unsuccessful, perform step 214;
214th, configuration component sends what the configuration information and configuration information for including updating were identified to subscription client again Message, performs step 207.
Also include in above-described embodiment:If configuration component does not receive the subscription for confirming that component is sent in preset time period When client is successful or is unsuccessfully received the response message of configuration information, it is determined that subscribing to client is unsuccessfully received configuration Information;Now configuration component sends the message of the configuration information for including updating and configuration information mark to subscription client again. Due to understanding, the scheme for postponing and retransmitting is additionally provided in the configuration information update scheme of the distributed system of the present embodiment, is carried The high efficiency for updating configuration information.
The update method of configuration information in the distributed system of the present embodiment, by the updating device of configuration information really Recognize component to confirm to subscribe to the configuration information whether client has successfully received renewal, so as to determine to subscribe to client in time Whether configuration information can be successfully updated, overcome defect of the prior art, effectively improved and match somebody with somebody confidence in distributed system Cease the reliability updated.And update configuration information during provide configuration information retransmission mechanism, can it is determined that When subscribing to the configuration information for the renewal that client receives configuration component transmission not successfully, updated again to subscription client Configuration information, and go to subscribe to again without subscribing to client, reduce and subscribe to the complexity that client updates configuration information, improve Update the efficiency of configuration information.Further, delay scheme is also provided in configuration information scheme is updated, in preset time After section, if not receiving response message, the configuration information and configuration information for including updating to client transmission is subscribed to again are identified Message, reduce subscribe to client update configuration information complexity, improve update configuration information efficiency.
It should be noted that:Above-described embodiment provide configuration information updating device update configuration information when, only with The division progress of above-mentioned each functional module is for example, in practical application, as needed can distribute above-mentioned functions by not Same functional module is completed, i.e., the internal structure of device is divided into different functional modules, to complete whole described above Or partial function.In addition, the updating device for the configuration information that above-described embodiment is provided and the update method of configuration information are implemented Example belongs to same design, and it implements process and refers to embodiment of the method, repeats no more here.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware To complete, the hardware of correlation can also be instructed to complete by program, described program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and Within principle, any modification, equivalent substitution and improvements made etc. should be included in the scope of the protection.

Claims (16)

1. a kind of distributed system, it is characterised in that the system includes configuration client, server cluster, configuration information Updating device and at least one subscription client;
The server cluster, for storage configuration information;The server cluster includes at least one server;
The configuration client, is communicated with each server in the server cluster, for updating the service The configuration information in device cluster;
The updating device of the configuration information, for monitoring the server cluster, judges in the server cluster Whether occur configuration information and change event;
The updating device of the configuration information, is additionally operable to when occurring configuration information change event, from the server cluster Obtain the configuration information updated;
The updating device of the configuration information, being additionally operable to send to each subscription client includes the configuration information of the renewal Message;
The updating device of the configuration information, is additionally operable to confirm whether each subscription client has successfully received matching somebody with somebody for the renewal Confidence ceases;
Each subscription client, respectively the updating device with the configuration information be connected, for receiving the configuration information The message for the configuration information including the renewal that updating device is sent.
2. system according to claim 1, it is characterised in that the updating device of the configuration information include configuration component and Confirm component;
The configuration component, for monitoring the server cluster, judges whether match somebody with somebody in the server cluster Confidence ceases change event;
The configuration component, is additionally operable to, when occurring configuration information change event, obtain what is updated from the server cluster Configuration information;
The configuration component, is additionally operable to send the message for the configuration information for including the renewal to each subscription client;
The confirmation component, for confirming whether each subscription client is had successfully received described in the configuration component transmission more New configuration information.
3. system according to claim 2, it is characterised in that the configuration component, is additionally operable to generation configuration information mark, The configuration information identifies the configuration information sent for unique mark to the subscription client;
The configuration component, includes the configuration information of the renewal and the configuration specifically for being sent to the subscription client The message of message identification.
4. system according to claim 3, it is characterised in that the configuration component, is additionally operable to the confirmation component hair The configuration information is sent to identify.
5. system according to claim 4, it is characterised in that the confirmation component, is additionally operable to receive the subscription client What end was sent includes the response message that configuration information is identified, and the configuration information that the subscription client is sent is designated described Subscribe to what client was obtained from the message that the configuration component is sent is received;
The confirmation component, specifically for the configuration information mark sent according to the configuration component and the subscription client The configuration information mark that end is sent, confirms whether the subscription client has successfully received the configuration information of the renewal.
6. system according to claim 5, it is characterised in that the confirmation component, specifically for judging that the configuration component is sent out Send the configuration information mark and it is described subscription client send the configuration information identify whether it is identical, if identical, really The fixed subscription client has successfully received the configuration information for the renewal that the configuration component is sent;Otherwise, it is determined that described Subscribe to the configuration information that client receives the renewal that the configuration component is sent not successfully.
7. system according to claim 6, it is characterised in that the confirmation component, is additionally operable to it is determined that described subscribe to visitor When family end has successfully received the configuration information for the renewal that the configuration component is sent, described subscribe to is sent to the configuration component Client is successfully received the response message of the configuration information;
Or, the confirmation component is additionally operable to determine that the subscription client receives the institute that the configuration component is sent not successfully When stating the configuration information of renewal, send the subscription client to the configuration component and be unsuccessfully received the configuration information Response message;Now accordingly, the configuration component, is additionally operable to receiving the subscription client that the confirmation component is sent End is unsuccessfully received after the response message of the configuration information, and being sent again to the subscription client includes the renewal The message of configuration information and configuration information mark.
8. system according to claim 7, it is characterised in that the configuration component, if being additionally operable in preset time period The subscription client success of the confirmation component transmission is not received or is unsuccessfully received the sound of the configuration information When answering message, determine that the subscription client is unsuccessfully received the configuration information;
The configuration component, being additionally operable to send to the subscription client again includes the configuration information of the renewal and described matches somebody with somebody Put the message of message identification.
9. the update method of configuration information in a kind of distributed system, it is characterised in that the distributed system includes configuration visitor Family end, server cluster, the updating device of configuration information and at least one subscription client;Methods described includes:
The configuration client updates the configuration information in the server cluster;
The updating device of the configuration information is monitored the server cluster, judges whether sent out in the server cluster Raw configuration information changes event;
When occurring configuration information change event, the updating device of the configuration information obtains renewal from the server cluster Configuration information;
The updating device of the configuration information includes disappearing for the configuration information of the renewal to each subscription client transmission Breath;
The updating device of the configuration information confirms whether each subscription client has successfully received the configuration information of the renewal.
10. method according to claim 9, it is characterised in that the updating device of the configuration information includes configuration component With confirmation component;
The updating device of the configuration information is monitored the server cluster, judges whether sent out in the server cluster Raw configuration information changes event, specifically includes:The configuration component is monitored the server cluster, judges the service Configuration information whether occurs in device cluster and changes event;
When occurring configuration information change event, the updating device of the configuration information obtains renewal from the server cluster Configuration information, specifically include:When occurring configuration information change event, the configuration component is obtained from the server cluster Take the configuration information of renewal;
The updating device of the configuration information sends the message for the configuration information for including the renewal to each subscription client, Specifically include:The configuration component sends the message for the configuration information for including the renewal to each subscription client;
The updating device of the configuration information confirms whether each subscription client has successfully received what the configuration component was sent The configuration information of the renewal, is specifically included:It is described that the configuration component confirms whether each subscription client has successfully received The configuration information for the renewal that configuration component is sent.
11. method according to claim 10, it is characterised in that the configuration component includes institute to client transmission is subscribed to Before the message for the configuration information for stating renewal, methods described also includes:
Configuration component generation configuration information mark, the configuration information is identified for unique mark to the subscription client The configuration information sent;
The configuration component sends the message for the configuration information for including the renewal to client is subscribed to, including:The configuration group Part is sent to the subscription client includes the configuration information of the renewal and the message of configuration information mark.
12. method according to claim 11, it is characterised in that after the configuration component generation configuration information mark, Methods described also includes:
The configuration component sends the configuration information to the confirmation component and identified.
13. method according to claim 12, it is characterised in that the configuration component sends to the subscription client and wrapped Include after the configuration information of the renewal and the message of configuration information mark, methods described also includes:
It is described to confirm that component receives the response message that configuration information is identified that includes for subscribing to client transmission, the subscription visitor The configuration information that family end is sent is designated the subscription client from the message that the configuration component is sent is received Obtain;
What the configuration information mark for confirming that component is sent according to the configuration component was sent with the subscription client The configuration information mark, confirms whether the subscription client has successfully received the configuration information of the renewal.
14. method according to claim 13, it is characterised in that what the confirmation component was sent according to the configuration component Whether the configuration information mark that the configuration information mark and the subscription client are sent, confirm the subscription client The configuration information of the renewal is had successfully received, is specifically included:
What the configuration information mark for confirming that component judges that the configuration component is sent was sent with the subscription client The configuration information identifies whether identical, if identical, determines that the subscription client has successfully received what the configuration component was sent The configuration information of the renewal;Otherwise, it is determined that the client of subscribing to receives the described of the configuration component transmission not successfully The configuration information of renewal.
15. method according to claim 14, it is characterised in that methods described also includes:
If described confirm that component determines that the subscription client has successfully received the configuration for the renewal that the configuration component is sent During information, the response message that the subscription client is successfully received the configuration information is sent to the configuration component;
Or, if described confirm that component determines that the subscription client receives the renewal that the configuration component is sent not successfully Configuration information when, to the configuration component send it is described subscribe to client and be unsuccessfully received the response of the configuration information disappear Breath;
Now accordingly, the configuration component is not successfully received in the subscription client for receiving the confirmation component transmission To after the response message of the configuration information, being sent again to the subscription client includes configuration information and the institute of the renewal State the message of configuration information mark.
16. method according to claim 15, it is characterised in that methods described also includes:
If the configuration component does not receive the subscription client success that the confirmation component is sent in preset time period Or when being unsuccessfully received the response message of the configuration information, determine that the subscription client is unsuccessfully received described match somebody with somebody Confidence ceases;
The configuration component is sent to the subscription client again includes the configuration information and the configuration information of the renewal The message of mark.
CN201310687405.2A 2013-12-12 2013-12-12 The update method of configuration information in distributed system and distributed system Active CN104092718B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310687405.2A CN104092718B (en) 2013-12-12 2013-12-12 The update method of configuration information in distributed system and distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310687405.2A CN104092718B (en) 2013-12-12 2013-12-12 The update method of configuration information in distributed system and distributed system

Publications (2)

Publication Number Publication Date
CN104092718A CN104092718A (en) 2014-10-08
CN104092718B true CN104092718B (en) 2017-10-24

Family

ID=51640398

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310687405.2A Active CN104092718B (en) 2013-12-12 2013-12-12 The update method of configuration information in distributed system and distributed system

Country Status (1)

Country Link
CN (1) CN104092718B (en)

Families Citing this family (46)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105743671B (en) * 2014-12-10 2020-07-14 华为技术有限公司 Capacity expansion method, controller and system
CN105791000A (en) * 2014-12-26 2016-07-20 阿尔卡特朗讯 Method and equipment for configuring application
CN104954482A (en) * 2015-06-29 2015-09-30 上海瀚之友信息技术服务有限公司 Configuration management system and method
CN106411684B (en) * 2015-07-30 2020-06-16 中兴通讯股份有限公司 Message processing method and device
CN105204949B (en) * 2015-08-27 2021-06-08 威盛电子股份有限公司 Method and device for actively triggering system broadcast in encryption process of mobile phone secure digital card
CN105323151B (en) * 2015-11-16 2018-09-14 东软集团股份有限公司 A kind of Message Processing reliability method for tracing and device
CN105867837A (en) * 2015-12-02 2016-08-17 乐视体育文化产业发展(北京)有限公司 Method, equipment and system for updating configurations of clients in distributed high-speed cache systems
CN105871584A (en) * 2015-12-02 2016-08-17 乐视体育文化产业发展(北京)有限公司 Method, device and system for updating client configuration in key value pair database
CN105515872B (en) * 2015-12-23 2019-05-28 北京奇虎科技有限公司 The update method of configuration information, apparatus and system
CN105630994A (en) * 2015-12-25 2016-06-01 浪潮电子信息产业股份有限公司 Data processing method, device and system based on storm
CN107357555B (en) * 2016-05-09 2020-11-17 阿里巴巴集团控股有限公司 Configuration pushing method, device and system
EP3458959B1 (en) * 2016-05-17 2023-03-22 AB Initio Technology LLC Reconfigurable distributed processing
CN107451147B (en) * 2016-05-31 2020-07-31 北京京东尚科信息技术有限公司 Method and device for dynamically switching kafka clusters
CN106060138A (en) * 2016-06-06 2016-10-26 北京小米移动软件有限公司 Method and apparatus for updating data
CN106453512A (en) * 2016-09-05 2017-02-22 努比亚技术有限公司 Redis cluster information monitoring device and method
CN106412029A (en) * 2016-09-13 2017-02-15 乐视控股(北京)有限公司 Configuration information receiving method and device, and configuration information transmitting method and device
CN106572173B (en) * 2016-11-07 2020-06-09 阿里巴巴(中国)有限公司 Configuration information updating method, device and system
CN106502915A (en) * 2016-12-05 2017-03-15 广州唯品会信息科技有限公司 Method for testing software and system
CN106656219A (en) * 2016-12-16 2017-05-10 四川九洲电器集团有限责任公司 Parameter injection method and equipment
CN108984544B (en) * 2017-05-31 2021-04-30 北京京东尚科信息技术有限公司 Method and device for modifying configuration information of distributed system
CN107391276B (en) * 2017-07-05 2018-09-28 腾讯科技(深圳)有限公司 Distributed monitor method, interception control device and system
CN107947960B (en) * 2017-10-13 2021-01-15 用友网络科技股份有限公司 Configuration information pushing method and system and configuration information receiving method and system
CN107769970A (en) * 2017-10-20 2018-03-06 北京集奥聚合科技有限公司 The processing method and system of configuration information in a kind of distributed system
CN107733715A (en) * 2017-10-26 2018-02-23 苏州蜗牛数字科技股份有限公司 The management system and method for configuration information in a kind of distributed system
CN108170763B (en) * 2017-12-25 2021-07-27 江南大学 Low-delay distributed computing consensus algorithm
CN110580767A (en) * 2018-06-11 2019-12-17 山东新北洋信息技术股份有限公司 configuration management method and device for vending machine
CN109087107B (en) * 2018-07-04 2020-11-17 恒生电子股份有限公司 Real-time monitoring method and system based on distributed memory database and electronic equipment
CN109086390B (en) * 2018-07-27 2022-03-25 北京中关村科金技术有限公司 Method for realizing real-time monitoring of data consistency
CN109240608B (en) * 2018-08-22 2021-08-31 郑州云海信息技术有限公司 Configuration information synchronization method and device
CN109150662B (en) * 2018-08-30 2020-08-21 百度在线网络技术(北京)有限公司 Message transmission method, distributed system, device, medium, and unmanned vehicle
CN109582381A (en) * 2018-10-12 2019-04-05 中国建设银行股份有限公司 File type configuration information synchronization system, method and storage medium
CN110166528B (en) * 2019-04-16 2022-03-18 平安科技(深圳)有限公司 Method and device for preventing node change notification from being lost and computer equipment
CN110493326B (en) * 2019-08-02 2021-11-12 泰华智慧产业集团股份有限公司 Zookeeper-based cluster configuration file management system and method
CN110635953A (en) * 2019-10-17 2019-12-31 厦门网宿有限公司 Configuration information management method and device
CN110798349B (en) * 2019-10-28 2023-02-28 国家计算机网络与信息安全管理中心 Configuration distribution and receiving method, equipment and computer readable storage medium
CN111193789B (en) * 2019-12-25 2023-07-11 微民保险代理有限公司 Subscription information pushing method, device, computer equipment and readable storage medium
CN111163159B (en) * 2019-12-27 2023-07-14 中国平安人寿保险股份有限公司 Message subscription method, device, server and computer readable storage medium
CN111224826B (en) * 2020-01-07 2023-04-28 深圳市网心科技有限公司 Configuration updating method, device, system and medium based on distributed system
JP7436525B2 (en) * 2020-01-22 2024-02-21 ファナック株式会社 Industrial machinery control equipment
CN111371898B (en) * 2020-03-13 2022-07-08 北京锐安科技有限公司 Message monitoring method, device, equipment and storage medium
CN111857800A (en) * 2020-07-01 2020-10-30 北京达佳互联信息技术有限公司 Dynamic component configuration method and device, electronic equipment and storage medium
CN111884844A (en) * 2020-07-20 2020-11-03 中国建设银行股份有限公司 Message service access method and device based on zookeeper
CN113805910A (en) * 2020-11-26 2021-12-17 北京沃东天骏信息技术有限公司 Method and system for sharing data in application
CN112532450B (en) * 2020-11-30 2022-08-23 中科美络科技股份有限公司 Dynamic updating method and system for data stream distribution process configuration
CN112822036A (en) * 2020-12-28 2021-05-18 苏宁消费金融有限公司 Configuration data synchronization method of distributed system
CN116126552A (en) * 2022-12-26 2023-05-16 国家气象信息中心(中国气象局气象数据中心) Mass meteorological observation data processing method and device based on Storm

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101499995A (en) * 2008-01-29 2009-08-05 华为技术有限公司 Service scheduling method, system and apparatus for service scheduling
CN201886473U (en) * 2010-02-08 2011-06-29 阿里巴巴集团控股有限公司 Configuration file-updating system, configuration server and application servers
CN102394901A (en) * 2011-06-23 2012-03-28 北京新媒传信科技有限公司 Server cluster system and updating method of monitoring policies in same
CN102916974A (en) * 2012-11-07 2013-02-06 曙光信息产业股份有限公司 Cluster configuration updating method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7617292B2 (en) * 2001-06-05 2009-11-10 Silicon Graphics International Multi-class heterogeneous clients in a clustered filesystem

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101499995A (en) * 2008-01-29 2009-08-05 华为技术有限公司 Service scheduling method, system and apparatus for service scheduling
CN201886473U (en) * 2010-02-08 2011-06-29 阿里巴巴集团控股有限公司 Configuration file-updating system, configuration server and application servers
CN102394901A (en) * 2011-06-23 2012-03-28 北京新媒传信科技有限公司 Server cluster system and updating method of monitoring policies in same
CN102916974A (en) * 2012-11-07 2013-02-06 曙光信息产业股份有限公司 Cluster configuration updating method

Also Published As

Publication number Publication date
CN104092718A (en) 2014-10-08

Similar Documents

Publication Publication Date Title
CN104092718B (en) The update method of configuration information in distributed system and distributed system
CN106502769B (en) Distributed transaction processing method, apparatus and system
CN111489256B (en) Cross-chain processing method, device and system for multi-chain block chain system
CN105095022A (en) Data backup method and device
CN102739775A (en) Method for monitoring and managing Internet of Things data acquisition server cluster
CN102255974A (en) Cloud storage method for cloud computing server
CN103488546A (en) Backup and recovery method capable of supporting online concurrency of multi-level data and database
CN107517227B (en) Session implementation method and device for distributed consistency system
WO2010062384A1 (en) Link data transmission method, node and system
CN101447856A (en) High-capacity file transmission method
CN110704250B (en) Hot backup device of distributed system
CN102438042B (en) Dynamic parameter synchronizing method and system of multipoint access device
CN110011840A (en) Condition processing method, device and the controller of controller
CN110677282A (en) Hot backup method of distributed system and distributed system
CN116599972A (en) Edge cloud aggregation and dispersion method oriented to high-mobility environment
CN109947844B (en) Medical data management system based on medical block chain
JP2003337717A (en) Fault recovery synchronizing system of online transaction process
WO2019019607A1 (en) Data backup method, device and system
CN102255716B (en) A kind of method and system of the backup between equipment to protocol status
WO2015101026A1 (en) Distributed flow processing system fault tolerance method, nodes and system
CN110063050B (en) Service scheduling method and system
CN104301240B (en) Data transmission method and system
CN110716827B (en) Hot backup method suitable for distributed system and distributed system
US7756975B1 (en) Methods and systems for automatically discovering information about a domain of a computing device
CN114090342A (en) Storage disaster tolerance link management method, message execution node and storage control cluster

Legal Events

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