Summary of the invention
The embodiment of the invention provides a kind of distributed apparatus, in order to the configuration restore process that solves the distributed apparatus that exists in the prior art long problem consuming time.
Accordingly, the embodiment of the invention also provides a kind of configuration recovery method of distributed apparatus.
The technical scheme that the embodiment of the invention provides is as follows:
A kind of configuration recovery method of distributed apparatus comprises: when warm start, obtain the local configuration file of preserving; Whether the relatively more local configuration file of preserving is consistent with the configuration file of master control borad; When the configuration file of preserving in this locality was consistent with the configuration file of master control borad, the configuration file of preserving according to this locality was configured recovery; When the configuration file of preserving in this locality and the configuration file of master control borad were inconsistent, the request master control borad issued configuration file, preserves the configuration file that issues, and is configured recovery according to the configuration file that issues; Configuration result is reported master control borad.
A kind of configuration recovery method of distributed apparatus, comprise: when warm start, judge whether to receive the request of business board, if receive the request of business board, then configuration file is handed down to described business board, and receive the configuration result of described business plate report, if do not receive the request of business board, then receive the configuration result of described business plate report; Determine that according to the configuration result that receives configuration restore finishes.
A kind of distributed apparatus comprises:
Master control borad, be used for when described distributed apparatus warm start, judge whether to receive the request of business board, if receive the request of business board, then configuration file is handed down to described business board, and receive the configuration result of described business plate report, if do not receive the request of business board, then receive the configuration result of described business plate report; Determine that according to the configuration result that receives the configuration restore of described distributed apparatus finishes;
Business board, be used for when described distributed apparatus warm start, whether the relatively more local configuration file of preserving is consistent with the configuration file of described master control borad, and when the configuration file of this locality preservation was consistent with the configuration file of master control borad, the configuration file of preserving according to this locality carried out the configuration restore of this business board; When the configuration file of preserving in this locality and the configuration file of master control borad were inconsistent, the request master control borad issued configuration file, preserves the configuration file that issues, and carries out the configuration restore of this business board according to the configuration file that issues; Configuration result is reported master control borad.
The technical scheme that the embodiment of the invention provides is carried out the configuration restore process that differentiation is arranged according to the different Starting mode of distributed apparatus, for the warm start mode, when the configuration file that business board is preserved in this locality is consistent with the configuration file of described master control borad, the configuration file of preserving according to this locality carries out the configuration restore of this business board, when the configuration file of preserving in this locality and the configuration file of master control borad are inconsistent, the request master control borad issues configuration file, and carries out the configuration restore of this business board based on the configuration file that issues.Because when the configuration file of business board preservation is consistent with the configuration file of master control borad, business board need not to wait for that master control borad issues configuration file successively, make the configuration restore process of each business board to carry out concurrently, thereby saved the time that distributed apparatus is finished the required cost of configuration restore.
Embodiment
The inventor finds in implementing existing distributed device configuration recovery scheme process, prior art master control borad when each the startup all will be handed down to configuration file each business board, when more or configuration file was big when the business board number, it was consuming time longer to finish whole configuration restore process.
The embodiment of the invention proposes when distributed apparatus starts, and carries out the configuration restore process that differentiation is arranged according to different Starting mode.For the cold start-up mode, business board is preserved the configuration file that master control borad issues, and is configured recovery according to the configuration file that issues; For the warm start mode, behind the current one-shot during parameter value of unmodified current configuration parameter of user or current configuration parameter, the configuration file that business board is preserved according to this locality is configured recovery, omit master control borad configuration file is handed down to the step of business board, proposed feasible solution for shortening the time that the distributed apparatus configuration restore consumes.
Be explained in detail to the main realization principle of embodiment of the invention technical scheme, embodiment and to the beneficial effect that should be able to reach below in conjunction with each accompanying drawing.
Please refer to accompanying drawing 1, the distributed apparatus that the embodiment of the invention provides comprises master control borad and business board, wherein:
Master control borad, be used for when the Starting mode of described distributed apparatus is warm start, judge whether to receive the request of business board, if receive the request of business board, then configuration file is handed down to described business board, and receive the configuration result of each business plate report, if do not receive the request of business board, then receive the configuration result of described business plate report; Determine that according to the configuration result that receives the configuration restore of described distributed apparatus finishes;
Business board, be used for when the Starting mode of described distributed apparatus is warm start, whether the relatively more local configuration file of preserving is consistent with the configuration file of master control borad, when the configuration file of preserving in this locality was consistent with the configuration file of master control borad, the configuration file of preserving according to this locality carried out the configuration restore of this business board; When the configuration file of preserving in this locality and the configuration file of master control borad were inconsistent, the request master control borad issued configuration file, the configuration file that storage issues, and carry out the configuration restore of this business board based on the configuration file that issues; The configuration result that obtains is reported master control borad.
Alternatively, described master control borad also is used for when described distributed apparatus cold start-up configuration file being handed down to each business board; Receive the configuration result of each business plate report; Determine that according to the configuration result that receives described distributed apparatus configuration restore finishes;
Accordingly, described business board also is used for receiving the configuration file that master control borad issues when described distributed apparatus cold start-up, preserves the configuration file that issues; Be configured recovery based on the configuration file that issues; Configuration result is reported master control borad.
Alternatively, described master control borad also is used for after described distributed apparatus configuration restore is finished, and whether the monitoring local profile is updated, and is local profile when being updated in monitoring result, and the configuration file after upgrading is handed down to each business board;
Accordingly, described business board also is used for after described distributed apparatus configuration restore is finished, and receives and preserve the configuration file that master control borad issues.
Wherein, the concrete mode that business board request master control borad issues configuration file includes but not limited to: business board sends update request to master control borad, for example can carry described update request based on the RPC message.
The main realization principle process of the embodiment of the invention is as follows:
The principle flow chart of the configuration restore process of master control borad in the distributed apparatus that accompanying drawing 2 provides for the embodiment of the invention.
When step 201, master control borad started at distributed apparatus, the Starting mode of judging described distributed apparatus was warm start or cold start-up, when the Starting mode of distributed apparatus is cold start-up, enter step 202, when the Starting mode of described distributed apparatus is warm start, enter step 203;
Step 202 issues configuration file to each business board, enters step 203;
Step 203 is waited for receiving the message that business board is sent, if receive the message that business board is sent, then enters step 204;
Step 204, whether the message that determining step 203 receives is update request, if enter step 205, otherwise enter step 206;
Step 205 sends configuration file to the business board that sends described update request, enters step 203;
Step 206, whether the message that determining step 203 receives is configuration result, if enter step 207;
Alternatively, judging message that step 203 receives when step 206 is not update request and when being not configuration result, can abandon this message, perhaps determines to occur unusual, and the configuration restore flow process finishes.
Step 207 judges whether to receive the configuration result that each business board feeds back, if enter step 208, otherwise return step 203;
Alternatively, in step 207, judge whether to have received the configuration result that each business board feeds back, business board can carry this business board when sending configuration result sign for the ease of master control borad.
Step 208 is confirmed to receive the configuration result that each business board feeds back, and the config update of described distributed apparatus completes successfully, and the configuration restore flow process finishes.
Alternatively, after step 208, promptly described distributed apparatus configuration restore also comprises after finishing:
Whether the local configuration file of preserving of master control borad monitoring is updated (whether the more incident of new configuration file has promptly taken place), and monitoring configuration file when being updated, configuration file after upgrading is handed down to each business board preserves, the incident of described more new configuration file is meant that the user is by revising order and revise current configuration parameter or current configuration parameter value and follow-uply by hold-over command amended current configuration parameter or current configuration parameter value being saved in the configuration file of master control borad.
Step 204 and step 206 are in order to identify update request and configuration result from the message that receives, therefore the judgement of step 204 and step 206 order also can be exchanged, promptly judging whether to be configuration result earlier, is not further to judge whether to be update request during for configuration result in judgement.
The embodiment of the invention is when the distributed apparatus warm start, master control borad is according to the request of business board, configuration file is handed down to business board, when not receiving the request of business board, need not configuration file is handed down to business board, rather than master control borad directly is handed down to configuration file each business board during as the distributed formula device start of prior art, finishes the spent time of config update process thereby shortened, and has saved the transfer resource between master control borad and the business board.
The principle flow chart of the configuration restore process of business board in the distributed apparatus that accompanying drawing 3 provides for the embodiment of the invention.
When step 301, business board start at distributed apparatus, judge that the Starting mode of distributed apparatus is warm start or cold start-up, when the Starting mode of distributed apparatus is cold start-up, enter step 302, when the Starting mode of distributed apparatus is warm start, enter step 303;
Step 302 wait for to receive master control borad and issues configuration file, after receiving the configuration file that master control borad issues, enters step 307;
Step 303 reads the configuration file of preserving in the local internal memory of this business board, enters step 304;
Step 304, whether the configuration file that reads in the comparison step 303 is consistent with the configuration file of master control borad, if enter step 305, otherwise enter step 306;
Alternatively, in order to improve the efficient of comparison, whether the configuration file that reads in can a comparison step 303 is consistent with the specific field in the configuration file of master control borad, described specific field correspondence when the incident of new configuration file more takes place is upgraded, and for example this specific field is the version identifier of configuration file.
Step 305, the configuration file that reads according to step 303 carries out the configuration restore of this business board, after this business board configuration restore success, enters step 308;
Step 306 sends update request to master control borad, enters step 302;
Alternatively, each business board can be carried at the sign of this business board and send to master control borad in the update request, so that master control borad can send configuration file targetedly.
Step 307 is preserved the configuration file that master control borad issues, and carries out the configuration restore of this business board according to the configuration file that the master control borad that receives issues, and after this business board configuration restore success, enters step 308;
Step 308 reports master control borad with configuration result.
Alternatively, business board also can receive the configuration file that master control borad issues in the running after configuration restore is finished, and upgrades the local configuration file of preserving according to the configuration file that master control borad issues.
The embodiment of the invention is when the distributed apparatus warm start, and business board judges whether and need issue configuration file to the master control borad request; Master control borad is not as prior art configuration file to be handed down to each business board, but only configuration file is handed down to the business board of filing a request.The business board that issues configuration file to the master control borad request can not be configured renewal process according to the configuration file that preserve this locality, therefore make the config update process of each business board to carry out concurrently, finish the required consumed time of whole distributed apparatus config update process thereby shortened; In addition, because master control borad need not configuration file is handed down to each business board, therefore also saved the transfer resource between master control borad and the business board.The config update scheme that the embodiment of the invention provides is larger distributed apparatus, and promptly effect is better under the more situation of business board number.
One of ordinary skill in the art will appreciate that all or part of step that realizes in the foregoing description method is to instruct relevant hardware to finish by program, this program can be stored in the computer read/write memory medium, as: ROM/RAM, magnetic disc, CD etc.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.