CN104601354B - A kind of business diary storage method, apparatus and system - Google Patents
A kind of business diary storage method, apparatus and system Download PDFInfo
- Publication number
- CN104601354B CN104601354B CN201310530737.XA CN201310530737A CN104601354B CN 104601354 B CN104601354 B CN 104601354B CN 201310530737 A CN201310530737 A CN 201310530737A CN 104601354 B CN104601354 B CN 104601354B
- Authority
- CN
- China
- Prior art keywords
- server
- log
- target
- master
- standby
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 230000005540 biological transmission Effects 0.000 claims description 9
- 238000000151 deposition Methods 0.000 claims description 8
- 230000004083 survival effect Effects 0.000 claims description 5
- 238000005259 measurement Methods 0.000 claims description 3
- 230000003111 delayed effect Effects 0.000 claims 1
- 230000007246 mechanism Effects 0.000 description 6
- 230000000694 effects Effects 0.000 description 4
- 230000002688 persistence Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
Abstract
A kind of business diary storage method, it include: the existing state for receiving the inquiry request inquiry target master log cache server of service server, if existing state is available mode, the existing state is then sent to the service server, so that business diary is sent to the target master log cache server by the service server, if existing state is down state, then determine the target of cache business journal file for log buffer server, and the mark for log buffer server is sent to the service server, so that business diary file is sent to the target for log buffer server by the service server.Above-mentioned business diary storage method, apparatus and system can be reduced the quantity of all standby log buffer servers to the maximum number for wanting the possible delay machine of same time master log cache server.
Description
Technical field
The present invention relates to field of communication technology more particularly to a kind of business diary storage methods, apparatus and system.
Background technique
As Internet service providers, carrying out analysis to operation log is that optimization improves the most important ring of service.For
The effect for farthest guaranteeing analysis optimization, runs the reliable storage of log, does not lose data, it is very important.
In the prior art, operation system sends identical operation log simultaneously and is given to master log caching reception server, standby
Log buffer receives server, and master log caching receives server, standby log buffer receives server difference real-time reception operation
Log is simultaneously buffered in local.Log Data File is periodically sent to archiving server.In this way, archiving server receives two parts of days
Will data file, and only need to save portion therein, abandon another Log Data File.
Above in the prior art, operation log is being solved to archiving server by two parts of operation logs of transmission and is reliably being entered
The problem of library, will put into log buffer at double and receive server, when in face of magnanimity operation log storage, required machine cost
Greatly.
Summary of the invention
In view of this, the present invention provides a kind of business diary storage method, apparatus and system, standby log buffer can be reduced
The quantity of server.
A kind of business diary storage method, in log routing server, comprising:
Obtain the existing state of each master log cache server and each standby log buffer server;
The inquiry request of service server is received, the inquiry request is for requesting inquiry target master log cache server
Existing state;
If the existing state is available mode, the existing state of the target master log cache server is sent to
The service server, so that business diary is sent to the target master log cache server by the service server;
If the existing state is down state, cache business day is determined in available standby log buffer server
The mark of the standby log buffer server is sent to the business service for log buffer server by the target of will file
Device, so that business diary file is sent to the target for log buffer server by the service server.
A kind of business diary storage method, in log routing server, comprising:
Obtain the existing state of each master log cache server and each standby log buffer server;
The routing inquiry request of application server is received, includes service identification in the routing inquiry request;
Master log cache server corresponding with the service identification is obtained according to scheduled routing rule;
The corresponding master log is cached if being that can be used if the existing state of the corresponding master log cache server
Server is as target journaling cache server;Otherwise a standby log buffer is obtained out of available standby log buffer server
Server is as the target journaling cache server;
The mark of the target journaling cache server is sent to the application server, so that the application server
Business diary file is sent to the target journaling cache server.
A kind of business diary storage device, comprising:
State acquiring unit, for obtaining the survival shape of each master log cache server and each standby log buffer server
State;
Receiving unit, for receiving the inquiry request of service server, the inquiry request is for requesting inquiry target master
The existing state of log buffer server;
First transmission unit, if being available mode for the existing state, by the target master log buffer service
The existing state of device is sent to the service server, so that business diary is sent to the target master by the service server
Log buffer server;And
Second transmission unit, if being down state for the existing state, in available standby log buffer service
Determine the target of cache business journal file for log buffer server in device;The mark of the standby log buffer server is sent out
It send to the service server, so that business diary file is sent to the target for log buffer clothes by the service server
Business device.
A kind of business diary storage system, comprising:
Log routing server, master log cache server and standby log buffer server;
The log routing server, for obtaining depositing for each master log cache server and each standby log buffer server
State living receives the inquiry request of service server, and the inquiry request is for requesting inquiry target master log cache server
Existing state the existing state of the target master log cache server is sent out if the existing state is available mode
The service server is given, so that business diary is sent to the target master log buffer service by the service server
Device determines cache business log text if the existing state is down state in available standby log buffer server
For the target of part for log buffer server, marking the target for log buffer server is occupied state, and by the standby day
The mark of will cache server is sent to the service server, so that business diary file is sent to by the service server
The target is for log buffer server;
The master log cache server, the business diary text sent for receiving and caching the service server
Part;The standby log buffer server, the business diary file sent for receiving and caching the service server.
A kind of business diary storage system, comprising:
Log routing server, master log cache server and standby log buffer server;
The log routing server, for obtaining depositing for each master log cache server and each standby log buffer server
State living receives the routing inquiry request of service server, includes service identification in the routing inquiry request, according to scheduled
Routing rule obtains master log cache server corresponding with the service identification, if the corresponding master log cache server
Existing state be available then using the corresponding master log cache server as target journaling cache server;Otherwise from can
A standby log buffer server is obtained in the standby log buffer server used as the target journaling cache server, by institute
The mark for stating target journaling cache server is sent to the service server, so that the service server is literary by business diary
Part is sent to the target journaling cache server;
The master log cache server, the business diary text sent for receiving and caching the service server
Part;The standby log buffer server, the business diary file sent for receiving and caching the service server.
According to above-mentioned log storing method, apparatus and system, it is arranged without each master log cache server is directed to again
One standby log buffer server, the quantity of all standby log buffer servers only need same time master log buffer service
The maximum number of the possible delay machine of device.By taking 100 master log cache servers 101 as an example, according to statistic record, this number difference is not
Mostly at 3 or so.Therefore, using above-mentioned technical solution, it is slow that standby log can be substantially reduced compared to traditional back mechanism
The quantity for depositing server, cuts operating costs.
For above and other objects, features and advantages of the invention can be clearer and more comprehensible, preferred embodiment is cited below particularly,
And cooperate institute's accompanying drawings, it is described in detail below.
Detailed description of the invention
Fig. 1 is the structural schematic diagram for the business diary storage system that first embodiment provides.
Fig. 2 is the flow chart for the business diary storage method that second embodiment provides.
Fig. 3 is the flow chart for the business diary storage method that 3rd embodiment provides.
Fig. 4 is the flow chart for the business diary storage method that fourth embodiment provides.
Fig. 5 is the structural block diagram for the business diary storage device that the 5th embodiment provides.
Fig. 6 is the structural block diagram for the business diary storage device that sixth embodiment provides.
Specific embodiment
Further to illustrate that the present invention is the technical means and efficacy realizing predetermined goal of the invention and being taken, below in conjunction with
Attached drawing and preferred embodiment, to specific embodiment, structure, feature and its effect according to the present invention, detailed description is as follows.
First embodiment of the invention provides a kind of business diary storage system.Above-mentioned business is an Internet application journey
The set of sequence or multiple internet applications.And internet application refers to answering with client-server architecture
Use program.Above-mentioned client can be independent application program, be also possible to the Web page application program based on browser.
Refering to fig. 1, business diary storage system provided in this embodiment includes following server: master log cache server
101, standby log buffer server 102, log storage server 103 and log routing server 104.
Service server (not shown) can generate log during providing network service.Log generally can be reserved in text
May include a plurality of record in part, in file, may include following field in every record: traffic ID, master log cache server ID,
Log generation time and daily record data.It may require that after the generation log of service server and send it to master log buffer service
Device 101 is cached.
The business diary file that 101 real-time reception service server of master log cache server is sended over by network,
Then it is cached to local.Cache-time is usually 1 day.After past 1 day, log storage server is sent by business diary file
103 persistences.Since single machine process performance is limited, in order to meet the performance requirement of massive logs storage, it will usually in system
The middle multiple master log cache servers 101 of deployment.
Standby log buffer server 102 is used for when master log cache server 101 services unavailable, and temporary takeover can not
The log buffer of master log cache server 101 is put in storage work, after the master log cache server 101 is working properly,
The business diary file cached is re-write into the master log cache server 101 again.
Log storage server 103 is for receiving the business day cached that master log cache server 101 sends over
Will file, and the persistence business diary file.
Log routing server 104 is used to manage master log cache server 101 by heartbeat and standby log buffer takes
The existing state of business device 102.
In an example, log routing server 104 obtains each active/standby log buffer server by heartbeat signal
Existing state.That is, can be to log route service at interval of a period of time (heart beat cycle) each active/standby log buffer server
Device 104 sends a heartbeat signal.This heartbeat signal can not include any significant data, may include making an appointment
Any data can also include any other data.
Specifically, in a heart beat cycle, if receiving master log cache server 101 or standby log buffer service
The heartbeat signal of device 102 then marks the survival of corresponding master log cache server 101 or standby log buffer server 102
State is available;If the heartbeat for not receiving some master log cache server 101 or standby log buffer server 102 is believed
Number, then it is unavailable for marking the existing state of corresponding master log cache server 101 or standby log buffer server 102.
Certainly, this implementation is not limited to by the way of above-mentioned heartbeat signal.For example, it is also possible to be by log route service
State of the device 104 at interval of each active/standby log buffer server of a period of time active inquiry.Or use heartbeat and active inquiry
Combination etc., those of ordinary skill in the art can flexibly use suitable scheme in conjunction with specific situation.
Service server determines the journal file which master log cache server be sent to according to scheduled rule
101, service server can inquire the existing state of the master log cache server 101 to log routing server 104 at this time.
Correspondingly, log routing server 104 receives the inquiry request of service server.If the master log of inquiry caches clothes
Business device 101 existing state be it is available, then can return to expression the available information of server;It otherwise, can be from available standby log
One is obtained in cache server 102, and is identified and return to service server.Above-mentioned available standby log buffer service
Device 102 refers to the standby log buffer server 102 in available and idle state.
If service server, which receives, indicates the available signal of master log cache server 101, directly log can be sent out
Master log cache server 101 is given to be stored.It, can if receiving the mark of the standby log buffer server 102 of return
Log is sent to this for log buffer server 102.
It is appreciated that the existing state of master log cache server 101 and standby log buffer server 102 can become
Change, when a master log cache server 101 existing state from it is unavailable switch to available after, log routing server 104
Its existing state can be notified to corresponding standby log buffer server 102, or notify all standby log buffer servers
102。
Correspondingly, standby log buffer server 102 sends the journal file of caching a to master log cache server
101.It specifically, may include following letter in every record in the journal file stored in standby log buffer server 102
Breath: traffic ID, master log cache server ID, log generation time and daily record data.Therefore, every is recorded, standby day
Will cache server 102 can be appreciated which master log cache server 101 it corresponds to.In the master log cache server
When 101 recovery existing state, log received in certain time can be sent a to the master log cache server 101.
It thereby may be ensured that the log in master log cache server 101 is complete.
According to the log storage system of the present embodiment, it is arranged one without each master log cache server 101 is directed to again
Standby log buffer server 102, the quantity of all standby log buffer servers 102 only need same time master log caching clothes
The maximum number for the possible delay machine of device 101 of being engaged in.By taking 100 master log cache servers 101 as an example, according to statistic record, this number
Mesh is almost at 3 or so.Therefore, using the technical solution of the present embodiment, can significantly subtract compared to traditional back mechanism
The quantity of few standby log buffer server, cuts operating costs.
Second embodiment of the invention provides a kind of business diary storage method, referring to Fig.2, the above method includes:
Step 201, the existing state for obtaining each master log cache server and each standby log buffer server;
Refering to fig. 1, log routing server 104 obtains each 101 He of master log cache server in log storage system
The existing state of each standby log buffer server 102, existing state includes available mode and down state.
In an example, log routing server 104 obtains each active/standby log buffer server by heartbeat signal
Existing state.That is, can be to log route service at interval of a period of time (heart beat cycle) each active/standby log buffer server
Device 104 sends a heartbeat signal.This heartbeat signal can not include any significant data, may include making an appointment
Any data can also include any other data.In a heart beat cycle, if log routing server 104 receives one
The heartbeat signal of a active/standby log buffer server, then mark corresponding active/standby log buffer server existing state be can
With;Otherwise it is available for marking the existing state of corresponding active/standby log buffer server.
Certainly, this implementation is not limited to by the way of above-mentioned heartbeat signal.For example, it is also possible to be by log route service
State of the device 104 at interval of each active/standby log buffer server of a period of time active inquiry.Or use heartbeat and active inquiry
Combination etc., those of ordinary skill in the art can flexibly use suitable scheme in conjunction with specific situation.
Step 202, the inquiry request for receiving service server, the inquiry request is for requesting inquiry target master log caching
The existing state of server;
Log routing server 104 receives the inquiry request of service server, and the inquiry request is for requesting inquiry target
The existing state of master log cache server.Business diary file is preserved on the service server, it can be by arranging in advance
A certain specific business diary file is sent to specific master log cache server by the service server, that is, send industry
The target master log cache server 101 of business journal file is pre-set in systems, or passes through what presetting rule was distributed.
If step 203, the existing state are available mode, the existing state of the target master log cache server is sent out
The service server is given, so that business diary file is sent to the target master log cache server by the service server;
If the existing state that log routing server 104 inquires the target master log cache server is available mode,
The existing state of the target master log cache server 101 is then sent to the service server, notifies the service server should
Target master log cache server operates normally at present, and business diary file can be sent to the target master log buffer service
Device.Further, after preset time period, such as after 24 hours, the target master log cache server 101 is by the business diary
File is stored in log storage server 103 with persistence.
If step 204, the existing state are down state, caching is determined in available standby log buffer server
The mark for log buffer server is sent to business clothes for log buffer server by the target of business diary file
Business device, so that business diary file is sent to the target for log buffer server by the service server.
If the existing state that log routing server 104 inquires the target master log cache server 101 is unavailable
State then inquires the existing state of standby log buffer server, is true in available standby log buffer server in existing state
The target of cache business journal file is determined for log buffer server.And the identity for log buffer server is sent
To the service server, so that business diary file is sent to the target for the progress of log buffer server by the service server
Caching.
One standby 102 synchronization of log buffer server can be serviced only for a master log cache server 101, this
When, after a standby log buffer server 102 is distributed to a master log cache server 101, the target can be marked standby
Log buffer server 102 is occupied state, avoids target for log buffer server 102 while caching different business diaries
File.
Certainly, standby 102 synchronization of log buffer server may be that multiple master log cache servers 101 take
Business, at this point, need not mark the target for log buffer server 102 be occupied state.But guarantee standby log buffer server 102
Pressure in controlled range, can recorde its burden master log cache server 101 quantity, thereby may be ensured that more
Equally loaded between a standby log buffer server 102.
According to the log storage system of the present embodiment, it is arranged one without each master log cache server 101 is directed to again
Standby log buffer server 102, the quantity of all standby log buffer servers 102 only need same time master log caching clothes
The maximum number for the possible delay machine of device 101 of being engaged in.By taking 100 master log cache servers 101 as an example, according to statistic record, this number
Mesh is almost at 3 or so.Therefore, using the technical solution of the present embodiment, can significantly subtract compared to traditional back mechanism
The quantity of few standby log buffer server, cuts operating costs.
3rd embodiment provides a kind of business diary storage method, similar to the method for Fig. 2 refering to Fig. 3, difference
Be in, further includes:
Step S301, when the existing state for detecting the target master log cache server reverts to available mode,
Then notify the standby log buffer server that the business diary file of caching is sent to the target master log caching clothes
Business device.
As described above, log routing server 104 can be slow to some master log by heartbeat signal or active inquiry
It, can be by its state notifying for log buffer server 102 when depositing server 101 and switching to available mode from down state.Accordingly
Ground, the log that standby log buffer server 102 can be backed up are sent to corresponding master log cache server 101.
Further, if standby log buffer server 102 services for a master log cache server 101, at this time
Illustrate that standby log buffer server 102 again is at idle state again, it can be marked for available mode.
According to the log storing method of the present embodiment, the method in addition to having the advantages that the first implementation is all, also in Lord's Day
After will cache server 101 reverts to available mode, restore normal log buffer mechanism, the processing effect of log buffer can be promoted
Rate.
Fourth embodiment provides a kind of business diary storage method, refering to Fig. 4 comprising following steps:
Step 401, the existing state for obtaining each master log cache server and each standby log buffer server;
Log routing server 104 obtains each master log cache server 101 and each standby log in log storage system
The existing state of cache server 102, existing state include available mode and down state.
In an example, log routing server 104 obtains each active/standby log buffer server by heartbeat signal
Existing state.That is, can be to log route service at interval of a period of time (heart beat cycle) each active/standby log buffer server
Device 104 sends a heartbeat signal.This heartbeat signal can not include any significant data, may include making an appointment
Any data can also include any other data.In a heart beat cycle, if log routing server 104 receives one
The heartbeat signal of a active/standby log buffer server, then mark corresponding active/standby log buffer server existing state be can
With;Otherwise it is available for marking the existing state of corresponding active/standby log buffer server.
Certainly, this implementation is not limited to by the way of above-mentioned heartbeat signal.For example, it is also possible to be by log route service
State of the device 104 at interval of each active/standby log buffer server of a period of time active inquiry.Or use heartbeat and active inquiry
Combination etc., those of ordinary skill in the art can flexibly use suitable scheme in conjunction with specific situation.
Step 402, the routing inquiry request for receiving service server, the interior routing inquiry request includes service identification;
Log routing server 104 receives the request that service server determines log buffer server, which asks
Comprising service identification in asking.
Step 403 obtains master log cache server corresponding with the service identification according to scheduled routing rule;
Log routing server 104 obtains master log caching corresponding with the service identification according to scheduled routing rule
Server 101.
If the existing state of step 404, the corresponding master log cache server be it is available, by the corresponding master log
Cache server obtains a standby log as target journaling cache server, otherwise out of available standby log buffer server
Cache server is as the target journaling cache server;
If the existing state of the corresponding master log cache server 101 be it is available, log routing server is right by this
The master log cache server 101 answered is used as target journaling cache server, if the corresponding master log cache server 101
Existing state be it is unavailable, log routing server 104 obtains one out of available standby log buffer server 102 then for day
Will cache server 102 is used as the target journaling cache server.
It is appreciated that after choosing an available standby log buffer server 102 for main log buffer server 101.
If standby 102 synchronization of log buffer server is only that a master log cache server 101 services according to setting, then inciting somebody to action
After one standby log buffer server 102 returns to service server as target journaling cache server, it can be marked to account for
Use state.Further, master log cache server 101 and the corresponding relationship of standby log buffer server 102 can also be deposited
Storage is in a list.Corresponding to each corresponding relationship, also recordable time started and end time.
The mark of the target journaling cache server is sent to the service server by step 405, so that the business service
Business diary file is sent to the target journaling cache server by device.
The mark of the target journaling cache server is sent to the service server by log routing server 104, so that
Business diary file is sent to target journaling caching according to the mark of the target journaling cache server by the service server
Server.Further, after preset time period, such as after 24 hours, the target master log cache server is by the business day
Will file is stored in log storage server with persistence.
After master log cache server 101 reverts to available mode, log routing server 104 can also notify standby day
Will cache server 102 names standby log buffer server 102 that the log of caching is sent to corresponding master log buffer service
Device 101.
In an example, in the log stored in standby log buffer server 102, every record includes following field:
Traffic ID, master log cache server ID, log generation time and daily record data.Therefore, every is recorded, standby log is slow
Depositing server 102 can be appreciated which master log cache server 101 it corresponds to.It is extensive in the master log cache server 101
When multiple existing state, log received in certain time can be sent a to the master log cache server 101.So as to
To guarantee that the log in master log cache server 101 is complete.
In another example, in the log stored in standby log buffer server 102, every record may not include Lord's Day
Will cache server ID.At this point, log routing server 104 can directly indicate standby log buffer according to above-mentioned map listing
Which master log cache server 101 log in some period is sent in by server 102.
In the embodiment of the present invention, log routing server is according to each master log cache server and each standby log buffer service
The existing state of device determines an available master log cache server or standby log buffer server conduct for service server
Its target journaling cache server for sending business diary file, thus relative to traditional for a master log cache server
The system structure of configuration one standby log buffer server, the quantity of all standby log buffer servers 102 only needs same
The maximum number of the possible delay machine of time master log cache server 101, saves machine cost.
5th embodiment provides a kind of business diary storage device, can be used in log routing server shown in FIG. 1.
Refering to Fig. 5, the device of the present embodiment includes: state acquiring unit 51, receiving unit 52, the first transmission unit 53 and second
Transmission unit.
State acquiring unit 51 is used to obtain the survival shape of each master log cache server and each standby log buffer server
State.In an example, state acquiring unit 51 is used in a measurement period, if receiving each master log cache server
With the heartbeat signal of each standby log buffer server, then master log cache server or standby corresponding with the heartbeat signal is marked
The existing state of log buffer server is available mode;Otherwise corresponding master log cache server or standby log buffer are marked
The existing state of server is down state.
Receiving unit 52 is used to receive the inquiry request of service server, and the inquiry request is for requesting inquiry target master
The existing state of log buffer server;
If the first transmission unit 53 is available mode for the existing state, by the target master log buffer service
The existing state of device is sent to the service server, so that business diary is sent to the target master by the service server
Log buffer server;
If the second transmission unit 54 is down state for the existing state, in available standby log buffer service
Determine the target of cache business journal file for log buffer server in device;The mark of the standby log buffer server is sent out
It send to the service server, so that business diary file is sent to the target for log buffer clothes by the service server
Business device.
The other details of device about the present embodiment also see Fig. 2 and related description.
According to the log storage system of the present embodiment, it is arranged one without each master log cache server 101 is directed to again
Standby log buffer server 102, the quantity of all standby log buffer servers 102 only need same time master log caching clothes
The maximum number for the possible delay machine of device 101 of being engaged in.By taking 100 master log cache servers 101 as an example, according to statistic record, this number
Mesh is almost at 3 or so.Therefore, using the technical solution of the present embodiment, can significantly subtract compared to traditional back mechanism
The quantity of few standby log buffer server, cuts operating costs.
Sixth embodiment provides a kind of business diary storage device, can be used in log routing server shown in FIG. 1.
Refering to Fig. 6, the device of the present embodiment is similar to device shown in fig. 5, the difference is that, further includes: notification unit 61 with
And marking unit 62.
Wherein, notification unit 61 be used for when detect that the existing state of the target master log cache server reverts to can
When with state, then notify the standby log buffer server that the business diary file of caching is sent to the target Lord's Day
Will cache server.
Marking unit 62 is used for after the mark of the standby log buffer server to be sent to the service server also
Marking corresponding standby log buffer server is occupied state;And in the standby log buffer server by the business diary
It for log buffer server is available mode that file, which is sent to after the target master log cache server and marks the target,.
As described above, log routing server 104 can be slow to some master log by heartbeat signal or active inquiry
It, can be by its state notifying for log buffer server 102 when depositing server 101 and switching to available mode from down state.Accordingly
Ground, the log that standby log buffer server 102 can be backed up are sent to corresponding master log cache server 101.
Further, if standby log buffer server 102 services for a master log cache server 101, at this time
Illustrate that standby log buffer server 102 again is at idle state again, it can be marked for available mode.
According to the log storage of the present embodiment, the device in addition to having the advantages that the 5th implementation is all, also in Lord's Day
After will cache server 101 reverts to available mode, restore normal log buffer mechanism, the processing effect of log buffer can be promoted
Rate.
In addition, the embodiment of the present invention also provides a kind of computer readable storage medium, it is executable to be stored with computer
Instruction, above-mentioned computer readable storage medium is, for example, nonvolatile memory such as CD, hard disk or flash memory.It is above-mentioned
Computer executable instructions for allow computer or similar arithmetic unit complete above-mentioned business diary storage method, dress
It sets and system.
The above described is only a preferred embodiment of the present invention, be not intended to limit the present invention in any form, though
So the present invention has been disclosed as a preferred embodiment, and however, it is not intended to limit the invention, any technology people for being familiar with this profession
Member, without departing from the scope of the present invention, when the technology contents using the disclosure above are modified or are modified
It is right according to the technical essence of the invention for the equivalent embodiment of equivalent variations, but without departing from the technical solutions of the present invention
Any simple modification, equivalent change and modification made by above embodiments, all of which are still within the scope of the technical scheme of the invention.
Claims (11)
1. a kind of business diary storage method, in log routing server characterized by comprising
Obtain the existing state of each master log cache server and each standby log buffer server;
The inquiry request of service server is received, the inquiry request is used to request depositing for inquiry target master log cache server
State living;
If the existing state is available mode, the existing state of the target master log cache server is sent to described
Service server, so that business diary is sent to the target master log cache server by the service server;
If the existing state is down state, cache business log text is determined in available standby log buffer server
The target is sent to the business service for log buffer server for the mark of log buffer server by the target of part
Device, so that business diary file is sent to the target for log buffer server by the service server;
Wherein, the quantity of the standby log buffer server is less than the quantity of the master log cache server.
2. the method according to claim 1, wherein each master log cache server of the acquisition and each standby log
The existing state of cache server includes:
In a measurement period, if receiving the heartbeat letter of each master log cache server and each standby log buffer server
Number, then marking the existing state of master log cache server corresponding with the heartbeat signal or standby log buffer server to be can
Use state;Otherwise marking the existing state of corresponding master log cache server or standby log buffer server is unavailable shape
State.
3. the method according to claim 1, wherein further include: it is taken when detecting that the target master log caches
The existing state of business device is when reverting to available mode, then notifies the target for log buffer server by the business of caching
Journal file is sent to the target master log cache server.
4. according to the method described in claim 3, it is characterized by further comprising: by the target for log buffer server
Mark be sent to after the service server also mark the target for log buffer server be occupied state;And institute
It states after the business diary file is sent to the target master log cache server for log buffer server by target and marks
The target is available mode for log buffer server.
5. a kind of business diary storage method, in log routing server characterized by comprising
Obtain the existing state of each master log cache server and each standby log buffer server;
The routing inquiry request of application server is received, includes service identification in the routing inquiry request;
Master log cache server corresponding with the service identification is obtained according to scheduled routing rule;
By the corresponding master log buffer service if being that can be used if the existing state of the corresponding master log cache server
Device is as target journaling cache server;Otherwise a standby log buffer service is obtained out of available standby log buffer server
Device is as the target journaling cache server;
The mark of the target journaling cache server is sent to the application server, so that the application server is by industry
Business journal file is sent to the target journaling cache server;
Wherein, the quantity of the standby log buffer server is less than the quantity of the master log cache server.
6. a kind of business diary storage device characterized by comprising
State acquiring unit, for obtaining the existing state of each master log cache server and each standby log buffer server;
Receiving unit, for receiving the inquiry request of service server, the inquiry request is for requesting inquiry target master log
The existing state of cache server;
First transmission unit, if being available mode for the existing state, by the target master log cache server
Existing state is sent to the service server, so that business diary is sent to the target master log by the service server
Cache server;
Second transmission unit, if being down state for the existing state, in available standby log buffer server
Determine the target of cache business journal file for log buffer server;The target is sent out for the mark of log buffer server
It send to the service server, so that business diary file is sent to the target for log buffer clothes by the service server
Business device;
Wherein, the quantity of the standby log buffer server is less than the quantity of the master log cache server.
7. device according to claim 6, which is characterized in that the state acquiring unit is used for: in a measurement period
It is interior, if receiving the heartbeat signal of each master log cache server and each standby log buffer server, label and the heartbeat
The existing state of the corresponding master log cache server of signal or standby log buffer server is available mode;Otherwise label corresponds to
Master log cache server or the existing state of standby log buffer server be down state.
8. device according to claim 6 or 7, which is characterized in that described device further include:
Notification unit, for when the existing state for detecting the target master log cache server reverts to available mode,
Then notify the target that the business diary file of caching is sent to the target master log for log buffer server and is delayed
Deposit server.
9. device according to claim 8, which is characterized in that described device further include:
Marking unit, for also being marked after the target is sent to the service server for the mark of log buffer server
Remember the target for log buffer server be occupied state;And in the target for log buffer server by the business
It for log buffer server is available shape that journal file, which is sent to after the target master log cache server and marks the target,
State.
10. a kind of business diary storage system characterized by comprising
Log routing server, master log cache server and standby log buffer server;
The log routing server, for obtaining the survival shape of each master log cache server and each standby log buffer server
State, receives the inquiry request of service server, and the inquiry request is used to request depositing for inquiry target master log cache server
The existing state of the target master log cache server is sent to by state living if the existing state is available mode
The service server, so that business diary is sent to the target master log cache server by the service server, if
The existing state is down state, then the mesh of cache business journal file is determined in available standby log buffer server
Standby log buffer server is marked, marking the target for log buffer server is occupied state, and by the target for log
The mark of cache server is sent to the service server, so that business diary file is sent to institute by the service server
Target is stated for log buffer server;
The master log cache server, the business diary file sent for receiving and caching the service server;
The standby log buffer server, the business diary file sent for receiving and caching the service server;
Wherein, the quantity of the standby log buffer server is less than the quantity of the master log cache server.
11. a kind of business diary storage system characterized by comprising
Log routing server, master log cache server and standby log buffer server;
The log routing server, for obtaining the survival shape of each master log cache server and each standby log buffer server
State receives the routing inquiry request of service server, includes service identification in the routing inquiry request, according to scheduled routing
Rule master log cache server corresponding with the service identification, if the corresponding master log cache server is deposited
State living is available then using the corresponding master log cache server as target journaling cache server;Otherwise from available
A standby log buffer server is obtained in standby log buffer server as the target journaling cache server, by the mesh
The mark of mark log buffer server is sent to the service server, so that the service server sends out business diary file
Give the target journaling cache server;
The master log cache server, the business diary file sent for receiving and caching the service server;
The standby log buffer server, the business diary file sent for receiving and caching the service server;
Wherein, the quantity of the standby log buffer server is less than the quantity of the master log cache server.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310530737.XA CN104601354B (en) | 2013-10-31 | 2013-10-31 | A kind of business diary storage method, apparatus and system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310530737.XA CN104601354B (en) | 2013-10-31 | 2013-10-31 | A kind of business diary storage method, apparatus and system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN104601354A CN104601354A (en) | 2015-05-06 |
| CN104601354B true CN104601354B (en) | 2019-05-17 |
Family
ID=53126880
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201310530737.XA Active CN104601354B (en) | 2013-10-31 | 2013-10-31 | A kind of business diary storage method, apparatus and system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN104601354B (en) |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106897288B (en) * | 2015-12-18 | 2021-01-08 | 阿里巴巴集团控股有限公司 | Service providing method and system for database |
| CN106776130B (en) * | 2016-11-30 | 2020-07-28 | 华为技术有限公司 | A log recovery method, storage device and storage node |
| CN107562796A (en) * | 2017-08-02 | 2018-01-09 | 上海斐讯数据通信技术有限公司 | A kind of magnanimity mobile terminal measures statistical method and device online |
| CN108197015A (en) * | 2017-12-29 | 2018-06-22 | 天脉聚源(北京)科技有限公司 | The method and device of daily record data is written in a manner of message |
| CN110990193A (en) * | 2019-11-13 | 2020-04-10 | 上海易点时空网络有限公司 | Log backup method, device and system |
| CN116257497A (en) * | 2021-12-10 | 2023-06-13 | 青岛海尔科技有限公司 | Method and device for caching logs, server, storage medium |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101110609A (en) * | 2007-08-23 | 2008-01-23 | 华为技术有限公司 | Method and system for realizing communication between main and standby modules |
| CN101876924A (en) * | 2009-04-30 | 2010-11-03 | 升东网络科技发展(上海)有限公司 | Database fault automatic detection and transfer method |
| CN102891873A (en) * | 2011-07-21 | 2013-01-23 | 腾讯科技(深圳)有限公司 | Method for storing log data and log data storage system |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8126848B2 (en) * | 2006-12-07 | 2012-02-28 | Robert Edward Wagner | Automated method for identifying and repairing logical data discrepancies between database replicas in a database cluster |
-
2013
- 2013-10-31 CN CN201310530737.XA patent/CN104601354B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101110609A (en) * | 2007-08-23 | 2008-01-23 | 华为技术有限公司 | Method and system for realizing communication between main and standby modules |
| CN101876924A (en) * | 2009-04-30 | 2010-11-03 | 升东网络科技发展(上海)有限公司 | Database fault automatic detection and transfer method |
| CN102891873A (en) * | 2011-07-21 | 2013-01-23 | 腾讯科技(深圳)有限公司 | Method for storing log data and log data storage system |
Also Published As
| Publication number | Publication date |
|---|---|
| CN104601354A (en) | 2015-05-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104601354B (en) | A kind of business diary storage method, apparatus and system | |
| CA3168289C (en) | Method and system for monitoring microservices | |
| JP6044539B2 (en) | Distributed storage system and method | |
| US8949420B2 (en) | Content pre-fetching and preparation | |
| CN106161523B (en) | A kind of data processing method and equipment | |
| US20090198787A1 (en) | Data streaming to multiple browser windows | |
| CN103577500B (en) | Distributed file system carries out the method and the distributed file system of data processing | |
| CN106933547B (en) | Global information acquisition and processing method, device and updating system | |
| CN109710614A (en) | A kind of method and device of real-time data memory and inquiry | |
| KR101545626B1 (en) | System for interoperation between dds and dbms | |
| CN109542595B (en) | Data acquisition method, device and system | |
| US9195611B2 (en) | Efficiently updating and deleting data in a data storage system | |
| CN104865953B (en) | A kind of vehicle data treating method and apparatus | |
| KR102166098B1 (en) | Server system for providing current data and past data to clients | |
| CN113886494B (en) | Instant messaging message storage method, device, equipment and computer readable medium | |
| CN108322358B (en) | Method and device for sending, processing and consuming multi-live distributed messages in different places | |
| JP2020500345A5 (en) | ||
| CN103870570A (en) | A Method of HBase Data Availability and Persistence Based on Remote Log Backup | |
| US9727375B1 (en) | Systems and methods for run time migration | |
| CN108809855A (en) | Information management method, device and electronic equipment | |
| CN110740155B (en) | Request processing method and device in distributed system | |
| CN105610947A (en) | Method, device and system for realizing high-available distributed queue service | |
| CN106569936A (en) | Method and system for acquiring scrolling log in real time | |
| CN113407356B (en) | Data processing method, device, electronic equipment and storage medium | |
| CN113220473B (en) | Data storage method and system |
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 |