CN106959866A - A kind of log collection client and its upgrade method - Google Patents

A kind of log collection client and its upgrade method Download PDF

Info

Publication number
CN106959866A
CN106959866A CN201610011466.0A CN201610011466A CN106959866A CN 106959866 A CN106959866 A CN 106959866A CN 201610011466 A CN201610011466 A CN 201610011466A CN 106959866 A CN106959866 A CN 106959866A
Authority
CN
China
Prior art keywords
finger daemon
daemon
upgrading
log collection
under
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.)
Granted
Application number
CN201610011466.0A
Other languages
Chinese (zh)
Other versions
CN106959866B (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610011466.0A priority Critical patent/CN106959866B/en
Priority to PCT/CN2016/112854 priority patent/WO2017118334A1/en
Publication of CN106959866A publication Critical patent/CN106959866A/en
Application granted granted Critical
Publication of CN106959866B publication Critical patent/CN106959866B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of log collection client and its upgrade method, this method sends heartbeat request to configuration server first, receive the heartbeat request response that configuration server is returned, the upgrade command carried in then being responded according to heartbeat request, download upgrade file and suspend transmission heartbeat request, and stop collecting new daily record data, the daily record data write-in local file sent will be collected but has not been completed, record current schedules point, upgraded using the upgrade file of download, and check whether and upgrade successfully, the daily record data for writing local file is sent to data server if upgrading successfully, and since the progress point of record collector journal data, started working with the version after upgrading, otherwise the version returning back to before upgrading is operated.Log collection client of the present invention includes heartbeat request module, upgrading respond module and upgrading and checks module.Data Collection, can rollback automatically during new edition program exception without loss in escalation process of the present invention.

Description

A kind of log collection client and its upgrade method
Technical field
The invention belongs to field of computer technology, more particularly to a kind of log collection client and its upgrading Method.
Background technology
With the development of electronic information technology, the big data epoch have arrived.Daily record is that a kind of distribution is wide General and important data resource, system monitoring, operation audit, data analysis can be completed based on daily record Deng work.Log collection client is the program operated on device operating system, can be according to collection Configuration is sent to log services end after reading specified log file contents, processing.
In order to evade known procedure bug potential risk, provide more preferable functional experience, client journey Sequence generally requires to upgrade to higher version.But under practical business scene, daily record exists all the time Produce, client-side program upgrading will unavoidably change executable file and restart process, therefore rising The loss of log collection progress is easily caused during level.
Prior art mainly has in the industry two classes on the problem of log collection client is upgraded is solved Scheme.Scheme one is cold upgrading, such as Logstash (1.5.4 versions), fluentd (2.2.1 versions) Etc. log collection software of increasing income, its program version escalation process is divided into three steps:
The legacy version process that control script stops being currently running is performed in equipment;
Redaction program file is installed to equipment by modes such as yum or tar bags;
Control script startup redaction process is performed in equipment and upgrading is completed.
Scheme two is the heat upgrading of dual program file, and this kind of client software can run two journeys in equipment Preface part, corresponds to two processes respectively:One is log collection process, and the process installs SIGTERM Signal and the preparation operation that configuration processor is exited in signal process function;Another is finger daemon, The version for being responsible for downloading new program file and completing from the old to the new switches.Its escalation process includes four steps:
Finger daemon detected in a poll new client-side program installation kit can use, and by its Download to the machine;
Finger daemon sends SIGTERM signals to log collection process;
Generally, log collection process is after SIGTERM signals are received, and standard is exited in completion Standby operation and log collection progress are to actively exiting after locally.If exiting for log collection process is dynamic Make time-out (such as process receives SIGTERM one minute afters and do not complete to exit preparation operation), keep Shield process, which will send SIGKILL, forces end log to collect process operation.
Finger daemon detects legacy version log collection process and had dropped out, and starts redaction program and completes Upgrading.
But existing cold upgrading scheme, it is necessary to manually participate in escalation process, O&M cost is high, and It can force to kill the loss that old process causes log collection progress, program version liter in program escalation process Level has an impact to the integrality of Data Collection;If redaction program file is unavailable (as sent out after starting Raw crash), also without automatic version rollback mechanism.In the existing hot upgrading scheme of dual program, daily record Collection procedure is combined with demons, is supported in automation mechanized operation, but escalation process, finger daemon By signal and log collection process one-way communication, log collection process is receiving SIGTERM signals Afterwards, if the short time can not normally exit (persistence for not completing log collection progress such as), keep Shield process can send SIGKILL signals again and be forced to terminate its operation after a time out.It is so new Version program can not obtain the log collection progress before upgrading after starting, cause the loss of Data Collection. And after finger daemon sends SIGTERM, legacy version log collection process is normally exited, still When the new capture program of subsequent start-up can not normally start, log collection is interrupted, it is necessary to which artificial O&M is situated between Enter.
The content of the invention
It is an object of the invention to provide a kind of log collection client and its upgrade method, pass through one way sequence File, the mode of two process operation complete program itself upgrading, solve in escalation process and are likely to occur Data loss problem and upgrading failure when version rollback problem.
To achieve these goals, technical solution of the present invention is as follows:
A kind of log collection client side upgrading method, applied to log collection client, methods described bag Include:
Heartbeat request is sent to configuration server, the heartbeat request response that configuration server is returned is received;
The upgrade command carried in being responded according to heartbeat request, downloads upgrade file and suspends transmission heartbeat Request, and stop collecting new daily record data, the daily record data collected but do not complete transmission is write Enter local file, record current schedules point, upgraded using the upgrade file of download;
Check whether and upgrade successfully, send the daily record data for writing local file if upgrading successfully To data server, and the collector journal data since the progress point of record, opened with the version after upgrading Beginning work, the version otherwise returning back to before upgrading is operated.
Wherein, after the log collection client terminal start-up, establishment has finger daemon and the progress of work, then It is described to send heartbeat request to configuration server, including:
The progress of work periodically sends to configuration server and carried in heartbeat request, the heartbeat request current The version number of log collection client and the IP address of host, so that configuration server is in no liter The heartbeat request response of sky is sent in the case of level API request, in the case where there is upgrading API request The heartbeat request response for carrying upgrade command is sent, the upgrade command includes log collection to be upgraded visitor The version number at family end and its download address.
Further, the log collection client side upgrading method is carried out using the upgrade file downloaded Before upgrading, also include:
The progress of work is given notice the signal SIGUSR1 of updating operation to finger daemon.
Further, the finger daemon has following global state:
A, DAEMON_INIT, finger daemon are ready to carry out initial work;
B, DAEMON_INIT_FAIL, finger daemon initialization perform failure;
C, DAEMON_NORMAL, finger daemon initialization run succeeded, and start to guard work Make;
D, DAEMON_UPDATE, finger daemon are ready to carry out program upgrade job;
E, DAEMON_UPDATE_FAIL, finger daemon configuration processor upgrade job failure.
Further, it is described to be upgraded using the upgrade file downloaded, including:
It is DAEMON_UPDATE that finger daemon, which receives and set after SIGUSR1 signals global state,;
Finger daemon detects current global state for DAEMON_UPDATE in circulation is guarded When, upgraded using the upgrade file of download;
Finger daemon sends SIGKILL signals to the progress of work, and the progress of work is exited.
Further, it is described to be upgraded using the upgrade file downloaded, also including step:
The log collection client-side program after upgrading is performed, the finger daemon under redaction and work is created Process;
Finger daemon loop cycle detection global state under redaction;
If the progress of work under redaction is exited extremely after starting, global state is caused to be changed into DAEMON_UPDATE_FAIL, then send notification signal SIGUSR2 to guarding under original version Process, encloses startup failed message;
If it was found that state remains the progress of work under redaction in DAEMON_INIT, cycle period There is not abnormal generation, then send notification signal SIGUSR2 and start success message under original version Finger daemon.
Further, described check whether upgrades successfully, including:
Finger daemon loop cycle under original version checks the notice of the finger daemon under redaction Signal SIGUSR2;
If the SIGUSR2 of the finger daemon in cycle period not under redaction, original version Under finger daemon think to start redaction time-out and to process group where finger daemon under redaction Finger daemon under transmission SIGKILL orders, the operation of end new procedures, subsequent original version is again Start the progress of work and the state to before upgrading that retracts;
If receiving the SIGUSR2 signals of the finger daemon under redaction in cycle period and obtaining To failed message is started, then the finger daemon under original version is to process where finger daemon under redaction Group sends SIGKILL orders, terminates the finger daemon weight under the operation of new procedures, subsequent original version It is new to start the progress of work and the state to before upgrading that retracts;
If receiving the SIGUSR2 signals of the finger daemon under redaction in cycle period and obtaining To success message is started, then the finger daemon under original version is exited, and is upgraded successfully.
The invention allows for a kind of log collection client, the log collection client includes:
Heartbeat request module, for sending heartbeat request to configuration server, receives configuration server and returns The heartbeat request response returned;
Upgrading respond module, for the upgrade command carried in being responded according to heartbeat request, downloads upgrading File simultaneously suspends transmission heartbeat request and stops collecting new daily record data, will collect but has not completed The daily record data write-in local file of transmission, is recorded current schedules point, is entered using the upgrade file of download Row upgrading;
Upgrading checks module, is upgraded successfully for checking whether, will be write if upgrading successfully local The daily record data of file is sent to data server, and the collector journal data since the progress point of record, Started working with the version after upgrading, the version otherwise returning back to before upgrading is operated.
Further, after the log collection client terminal start-up, establishment has finger daemon and the progress of work, The heartbeat request module performs following operation when sending heartbeat request to configuration server:
The progress of work periodically sends to configuration server and carried in heartbeat request, the heartbeat request current The version number of log collection client and the IP address of host, so that configuration server is in no liter The heartbeat request response of sky is sent in the case of level API request, in the case where there is upgrading API request The heartbeat request response for carrying upgrade command is sent, the upgrade command includes log collection to be upgraded visitor The version number at family end and its download address.
Further, it is described upgrading respond module using download upgrade file upgraded before, Also perform following operation:
The progress of work is given notice the signal SIGUSR1 of updating operation to finger daemon.
Further, the finger daemon has following global state:
A, DAEMON_INIT, finger daemon are ready to carry out initial work;
B, DAEMON_INIT_FAIL, finger daemon initialization perform failure;
C, DAEMON_NORMAL, finger daemon initialization run succeeded, and start to guard work Make;
D, DAEMON_UPDATE, finger daemon are ready to carry out program upgrade job;
E, DAEMON_UPDATE_FAIL, finger daemon configuration processor upgrade job failure.
Further, the upgrading respond module is held when being upgraded using the upgrade file downloaded The following operation of row:
It is DAEMON_UPDATE that finger daemon, which receives and set after SIGUSR1 signals global state,;
Finger daemon detects current global state for DAEMON_UPDATE in circulation is guarded When, upgraded using the upgrade file of download;
Finger daemon sends SIGKILL signals to the progress of work, and the progress of work is exited.
Further, the upgrading respond module using the upgrade file downloaded when being upgraded, also Perform following operation:
The log collection client-side program after upgrading is performed, the finger daemon under redaction and work is created Process;
Finger daemon loop cycle detection global state under redaction;
If the progress of work under redaction is exited extremely after starting, global state is caused to be changed into DAEMON_UPDATE_FAIL, then send notification signal SIGUSR2 to guarding under original version Process, encloses startup failed message;
If it was found that state remains the progress of work under redaction in DAEMON_INIT, cycle period There is not abnormal generation, then send notification signal SIGUSR2 and start success message under original version Finger daemon.
Further, the upgrading checks that module is checking whether that when upgrading successfully, execution is following to be operated:
Finger daemon loop cycle under original version checks the notice of the finger daemon under redaction Signal SIGUSR2;
If the SIGUSR2 of the finger daemon in cycle period not under redaction, original version Under finger daemon think to start redaction time-out and to process group where finger daemon under redaction Finger daemon under transmission SIGKILL orders, the operation of end new procedures, subsequent original version is again Start the progress of work and the state to before upgrading that retracts;
If receiving the SIGUSR2 signals of the finger daemon under redaction in cycle period and obtaining To failed message is started, then the finger daemon under original version is to process where finger daemon under redaction Group sends SIGKILL orders, terminates the finger daemon weight under the operation of new procedures, subsequent original version It is new to start the progress of work and the state to before upgrading that retracts;
If receiving the SIGUSR2 signals of the finger daemon under redaction in cycle period and obtaining To success message is started, then the finger daemon under original version is exited, and is upgraded successfully.
A kind of log collection client and its upgrade method proposed by the present invention, escalation process is without artificial O&M is intervened, father and son's process two-way communication in escalation process, consensus rear execution updating operation, Data are not lost before and after upgrading;If new procedures start exception, finger daemon can quickly be found simultaneously certainly It is dynamic to perform version rollback operation.
Brief description of the drawings
Fig. 1 is log collection client side upgrading method flow chart of the present invention;
Fig. 2 is original version client operational flow diagram of the present invention;
Fig. 3 is redaction client operational flow diagram of the present invention;
Fig. 4, log collection client terminal structure schematic diagram of the present invention.
Embodiment
Technical solution of the present invention is described in further details with reference to the accompanying drawings and examples, it is real below Apply example and do not constitute limitation of the invention.
Log system generally comprises log collection client Client, Yi Jiyong on host In the configuration server ConfigServer for managing the log collection client run on all hosts, And receive the data server DataServer for the daily record data that log collection client is collected.Place Main frame is exactly to be fitted with log collection on the equipment that log system wants log, each host Client.
After the log collection client terminal start-up of host, there are two processes to bring into operation, one is to guard Process DaemonProcess, one is progress of work WorkerProcess.Visitor is collected in starting log During the end of family, parent process DaemonProcess is first created, then calling system calls fork, create son Process WorkerProcess.Subprocess WorkerProcess is specified according to the collection of user configuration collection Log file contents are simultaneously sent to data server by network, while subprocess WorkerProcess Heartbeat request is also sent to configuration server by timing (such as 1 minute), passes through heartbeat request Response contents receive the instruction of configuration server.Parent process DaemonProcess is finger daemon, It can restart subprocess after finding that WorkerProcess is surprisingly exited, find Client edition upgradings Triggering upgrading flow during instruction.
As shown in figure 1, a kind of log collection client side upgrading method of the present embodiment, is received applied to daily record Collect client, including:
Step S1, to configuration server send heartbeat request, receive configuration server return heartbeat Request response.
After Client starts on host, WorkerProcess is sent for every 1 minute to ConfigServer Heartbeat request, request content includes present procedure fileversion number v_1 and host ip_1. When not having updating operation, ConfigServer returns to empty content in the response of heartbeat request and given WorkerProcess。
Assuming that there is new Client version v_2 for host ip_1, operation maintenance personnel passes through the API that upgrades Request is sent to ConfigServer, ConfigServer sets place after upgrading API request is received Main frame ip_1 state:Current version v_1, version v_2 to be upgraded.
Then ConfigServer returns to upgrade command in the response of heartbeat request, and upgrade command includes The md5sum of v_2 version numbers, v_2 programs upgrade file (HTTP download address) and executable file.
Step S2, responded according to heartbeat request in the upgrade command that carries, pause sends heartbeat request And stop collecting new daily record data, the daily record data collected is write into local file, record is worked as Preceding progress point, downloads upgrade file and starts upgrading.
For ease of description, version v_1 log collection client is referred to as ClientV1 by the present embodiment, Its corresponding two process is WorkerProcessV1 and DaemonProcessV1.Version will be upgraded to This v_2 log collection client is referred to as ClientV2, and its corresponding two process is WorkerProcessV2 and DaemonProcessV2.
Then after ClientV1 operations, WorkerProcessV1 has found there is liter in the response of heartbeat request During level instruction, updating operation is begun preparing for:
Upgrade file download to the machine, after decompression and executable file md5sum is verified.
Stop reading new daily record data.
The daily record data read in internal memory completes to write local file BuffeFile after parsing, write-in BuffeFil daily record data is to have collected but do not completed the daily record data sent, BufferFile meetings DataServer is sent to by ClientV2 after the completion of upgrading.Writing BufferFile can greatly reduce The long problem of update time caused by network forward delay interval.
Record progress point CheckPoint.Log collection has progress, and CheckPoint preserves the shape State simultaneously can be persisted to file.Content includes:Log Directory, journal file name, journal file signature, The position that journal file is currently collected.
WorkerProcessV1 sends SIGUSR1 to DaemonProcessV1, notifies updating operation.
The present embodiment defines 5 kinds of global states, for representing for DaemonProcess processes DaemonProcess process status, be respectively:
1、DAEMON_INIT
DaemonProcess is ready to carry out initial work.
2、DAEMON_INIT_FAIL
DaemonProcess initialization performs failure.
3、DAEMON_NORMAL
DaemonProcess initialization runs succeeded, and starts to guard work.
4、DAEMON_UPDATE
DaemonProcess is ready to carry out program upgrade job.
5、DAEMON_UPDATE_FAIL
The upgrade job of DaemonProcess configuration processors fails.
DaemonProcess processes have following signal process function simultaneously:
1), DaemonProcess SIGCHLD signal process functions.
SIGCHLD signals show that its subprocess WorkerProcess is exited extremely, if global state is DAEMON_INIT, then state change is DAEMON_INIT_FAIL.
2), DaemonProcess SIGUSR1 signal process functions.
The self-defined SIGUSR1 of the present embodiment is that WorkerProcess is sent to DaemonProcess use To notify the signal of updating operation, DaemonProcess receives setting global state after the signal and is DAEMON_UPDATE。
3), DaemonProcess SIGUSR2 signal process functions
The self-defined SIGUSR2 of the present embodiment is that the new edition DaemonProcess of starting and upgrading is sent to Old edition DaemonProcess signal.If the subsidiary message DaemonStartSuccess (new editions of signal This DaemonProcess, WorkerProcess start successfully), then DaemonProcess is actively moved back Go out;If signal message be DaemonStartFail (redaction DaemonProcess or WorkerProcess starts failure), then setting DaemonProcess global states are DAEMON_UPDATE_FAIL。
4th, SIGKILL, sends after SIGKILL to process, and the process for receiving the signal terminates fortune OK.
So that after WorkerProcessV1 sends SIGUSR1 to DaemonProcessV1, DaemonProcessV1 handles SIGUSR1 signals, into interruption, and signal process function is by the overall situation State is set to DAEMON_UPDATE.
As shown in Fig. 2 ClientV1 is upon actuation, setting DaemonProcessV1 is DAEMON_INIT states, and SIGCHLD signals are installed, subsequent fork goes out WorkerProcessV1 carries out log collection circulation, and DaemonProcessV1 installs SIGUSR1 letters Number, setting state is DAEMON_NORMAL.When ConfigServer please in the heartbeat of return Ask response in carry upgrade command after, WorkerProcessV1 send SIGUSR1 to DaemonProcessV1, DaemonProcessV1 detect current global state in circulation is guarded For DAEMON_UPDATE, start upgrading.
DaemonProcessV1 sends SIGKILL to WorkerProcessV1, now WorkerProcessV1 memory queue is empty, and subsequent WorkerProcessV1 is exited, no data Lose.
DaemonProcessV1 installs SIGUSR2 signals:If install failure, current shape is set State is DAEMON_NORMAL and performs rollback, and fork goes out WorkerProcessV1 fortune again OK, terminate updating operation and return to state before upgrading;If SIGUSR2 is installed successfully, fork One subprocess, performs redaction program file ClientV2 under subprocess current process space, and Start the cycle over and detect whether to upgrade successfully.
Step S3, check whether and upgrade successfully, the day of local file will be write if upgrading successfully Will data are sent to data server, and the collector journal data since the progress point of record, to upgrade Version afterwards is started working, the version otherwise returning back to before upgrading.
As shown in figure 3, after redaction program file ClientV2 is performed, DaemonProcessV2 Perform initial work.
Setting current state is DAEMON_INIT.
SIGUSR2 signals, SIGCHLD signals are installed.
DaemonProcessV2fork goes out WorkerProcessV2 execution, and enters the circulation of 5 seconds Wait, DaemonProcessV2 detection global states:
If it was found that state is changed into DAEMON_INIT_FAIL, (WorkerProcessV2 is different after starting Often exit, interrupt processing SIGCHLD signals cause global state to change), then sending signal SIGUSR2 encloses message DaemonStartFail to DaemonProcessV1.
If it was found that state remains DAEMON_INIT, WorkerProcessV2 does not have different in 5 seconds Often occur, then send SIGUSR2 signals and message DaemonStartSuccess to DaemonProcessV1。
Map interlinking 2, and DaemonProcessV1 waits 15 seconds, inspection comes from DaemonProcessV2 signal.Divide three kinds of situations:
If the not SIGUSR2 from DaemonProcessV2, DaemonProcessV1 in 15 seconds Think to start redaction time-out and send SIGKILL lives to process group where DaemonProcessV2 Order, terminates the operation of new procedures, and subsequent DaemonProcessV1 restarts WorkerProcessV1 And the state to before upgrading that retracts.
If receiving SIGUSR2 signals in 15 seconds and obtaining message DaemonStartFail, DaemonProcessV1 sends SIGKILL orders to process group where DaemonProcessV2, Terminate the operation of new procedures, subsequent DaemonProcessV1 restartings WorkerProcessV1 is simultaneously Retract the state to before upgrading.That is DaemonProcessV1 will clear up ClientV2 process group and return Fall back on V1 version works.
If receiving SIGUSR2 signals in 15 seconds and obtaining message DaemonStartSuccess, DaemonProcessV1 performs exit and exited, i.e. DaemonProcessV1 will after signal is received Actively exit, after DaemonProcessV1 is exited, DaemonProcessV2 and WorkerProcessV2 is completely taken over, and upgrading is completed, and hereafter only two processes of V2 versions are in machine Run on device, escalation process successfully terminates.
Disposed using the log collection client of the present invention on ten tens of thousands of servers, pass through upgrading API can complete the upgrading of all machine client releases at 10 minutes.The client of single machine Upgrading can typically be completed in 5 seconds, during Data Collection without loss, can during new edition program exception With automatic rollback.
As shown in figure 4, a kind of log collection client of the present embodiment, including heartbeat request module, liter Level respond module and upgrading check module.The log collection client of the present embodiment is arranged on host, Collection for carrying out daily record data, the upgrading of completion program is interacted with configuration server.
Wherein, heartbeat request module, for sending heartbeat request to configuration server, receives configuration clothes The heartbeat request response that business device is returned;Upgrading respond module, for being carried in being responded according to heartbeat request Upgrade command, download upgrade file and simultaneously suspend and send heartbeat request and stop collecting new daily record data, The daily record data write-in local file sent will be collected but do not completed, recorded current schedules point, adopt Upgraded with the upgrade file of download;Upgrading checks module, is upgraded successfully for checking whether, such as Fruit is upgraded successfully, and the daily record data for writing local file is sent into data server, and from record Progress point starts collector journal data, is started working, otherwise return back to before upgrading with the version after upgrading Version be operated.
After the present embodiment log collection client terminal start-up, establishment has finger daemon and the progress of work, below Illustrate that each module is operated done in escalation process respectively.
Heartbeat request module performs following operation when sending heartbeat request to configuration server:
The progress of work periodically sends to configuration server and carried in heartbeat request, the heartbeat request current The version number of log collection client and the IP address of host, so that configuration server is in no liter The heartbeat request response of sky is sent in the case of level API request, in the case where there is upgrading API request The heartbeat request response for carrying upgrade command is sent, the upgrade command includes log collection to be upgraded visitor The version number at family end and its download address.
In the present embodiment, upgrading respond module using the upgrade file downloaded before being upgraded, also Perform following operation:
The progress of work is given notice the signal SIGUSR1 of updating operation to finger daemon.
In the present embodiment, upgrading respond module is performed when being upgraded using the upgrade file downloaded Following operation:
It is DAEMON_UPDATE that finger daemon, which receives and set after SIGUSR1 signals global state,;
Finger daemon detects current global state for DAEMON_UPDATE in circulation is guarded When, upgraded using the upgrade file of download;
Finger daemon sends SIGKILL signals to the progress of work, and the progress of work is exited.
In the present embodiment, upgrading respond module is also held when being upgraded using the upgrade file downloaded The following operation of row:
The log collection client-side program after upgrading is performed, the finger daemon under redaction and work is created Process;
Finger daemon loop cycle detection global state under redaction;
If the progress of work under redaction is exited extremely after starting, global state is caused to be changed into DAEMON_UPDATE_FAIL, then send notification signal SIGUSR2 to guarding under original version Process, encloses startup failed message;
If it was found that state remains the progress of work under redaction in DAEMON_INIT, cycle period There is not abnormal generation, then send notification signal SIGUSR2 and start success message under original version Finger daemon.
In the present embodiment, upgrading checks that module is checking whether that when upgrading successfully, execution is following to be operated:
Finger daemon loop cycle under original version checks the notice of the finger daemon under redaction Signal SIGUSR2;
If the SIGUSR2 of the finger daemon in cycle period not under redaction, original version Under finger daemon think to start redaction time-out and to process group where finger daemon under redaction Finger daemon under transmission SIGKILL orders, the operation of end new procedures, subsequent original version is again Start the progress of work and the state to before upgrading that retracts;
If receiving the SIGUSR2 signals of the finger daemon under redaction in cycle period and obtaining To failed message is started, then the finger daemon under original version is to process where finger daemon under redaction Group sends SIGKILL orders, terminates the finger daemon weight under the operation of new procedures, subsequent original version It is new to start the progress of work and the state to before upgrading that retracts;
If receiving the SIGUSR2 signals of the finger daemon under redaction in cycle period and obtaining To success message is started, then the finger daemon under original version is exited, and is upgraded successfully.
The above embodiments are merely illustrative of the technical solutions of the present invention rather than is limited, and is not carrying on the back In the case of from spirit of the invention and its essence, those of ordinary skill in the art work as can be according to the present invention Various corresponding changes and deformation are made, but these corresponding changes and deformation should all belong to institute of the present invention Attached scope of the claims.

Claims (14)

1. a kind of log collection client side upgrading method, applied to log collection client, its feature It is that methods described includes:
Heartbeat request is sent to configuration server, the heartbeat request response that configuration server is returned is received;
The upgrade command carried in being responded according to heartbeat request, downloads upgrade file and suspends transmission heartbeat Request, and stop collecting new daily record data, the daily record data collected but do not complete transmission is write Enter local file, record current schedules point, upgraded using the upgrade file of download;
Check whether and upgrade successfully, send the daily record data for writing local file if upgrading successfully To data server, and the collector journal data since the progress point of record, opened with the version after upgrading Beginning work, the version otherwise returning back to before upgrading is operated.
2. log collection client side upgrading method according to claim 1, it is characterised in that After the log collection client terminal start-up, establishment has finger daemon and the progress of work, described to be taken to configuration Business device sends heartbeat request, including:
The progress of work periodically sends to configuration server and carried in heartbeat request, the heartbeat request current The version number of log collection client and the IP address of host, so that configuration server is in no liter The heartbeat request response of sky is sent in the case of level API request, in the case where there is upgrading API request The heartbeat request response for carrying upgrade command is sent, the upgrade command includes log collection to be upgraded visitor The version number at family end and its download address.
3. log collection client side upgrading method according to claim 2, it is characterised in that The log collection client side upgrading method is also wrapped before being upgraded using the upgrade file downloaded Include:
The progress of work is given notice the signal SIGUSR1 of updating operation to finger daemon.
4. log collection client side upgrading method according to claim 3, it is characterised in that The finger daemon has following global state:
A, DAEMON_INIT, finger daemon are ready to carry out initial work;
B, DAEMON_INIT_FAIL, finger daemon initialization perform failure;
C, DAEMON_NORMAL, finger daemon initialization run succeeded, and start to guard work Make;
D, DAEMON_UPDATE, finger daemon are ready to carry out program upgrade job;
E, DAEMON_UPDATE_FAIL, finger daemon configuration processor upgrade job failure.
5. log collection client side upgrading method according to claim 4, it is characterised in that It is described to be upgraded using the upgrade file downloaded, including:
It is DAEMON_UPDATE that finger daemon, which receives and set after SIGUSR1 signals global state,;
Finger daemon detects current global state for DAEMON_UPDATE in circulation is guarded When, upgraded using the upgrade file of download;
Finger daemon sends SIGKILL signals to the progress of work, and the progress of work is exited.
6. log collection client side upgrading method according to claim 5, it is characterised in that It is described to be upgraded using the upgrade file downloaded, also including step:
The log collection client-side program after upgrading is performed, the finger daemon under redaction and work is created Process;
Finger daemon loop cycle detection global state under redaction;
If the progress of work under redaction is exited extremely after starting, global state is caused to be changed into DAEMON_UPDATE_FAIL, then send notification signal SIGUSR2 to guarding under original version Process, encloses startup failed message;
If it was found that state remains the progress of work under redaction in DAEMON_INIT, cycle period There is not abnormal generation, then send notification signal SIGUSR2 and start success message under original version Finger daemon.
7. log collection client side upgrading method according to claim 6, it is characterised in that Described check whether upgrades successfully, including:
Finger daemon loop cycle under original version checks the notice of the finger daemon under redaction Signal SIGUSR2;
If the SIGUSR2 of the finger daemon in cycle period not under redaction, original version Under finger daemon think to start redaction time-out and to process group where finger daemon under redaction Finger daemon under transmission SIGKILL orders, the operation of end new procedures, subsequent original version is again Start the progress of work and the state to before upgrading that retracts;
If receiving the SIGUSR2 signals of the finger daemon under redaction in cycle period and obtaining To failed message is started, then the finger daemon under original version is to process where finger daemon under redaction Group sends SIGKILL orders, terminates the finger daemon weight under the operation of new procedures, subsequent original version It is new to start the progress of work and the state to before upgrading that retracts;
If receiving the SIGUSR2 signals of the finger daemon under redaction in cycle period and obtaining To success message is started, then the finger daemon under original version is exited, and is upgraded successfully.
8. a kind of log collection client, it is characterised in that the log collection client includes:
Heartbeat request module, for sending heartbeat request to configuration server, receives configuration server and returns The heartbeat request response returned;
Upgrading respond module, for the upgrade command carried in being responded according to heartbeat request, downloads upgrading File simultaneously suspends transmission heartbeat request and stops collecting new daily record data, will collect but has not completed The daily record data write-in local file of transmission, is recorded current schedules point, is entered using the upgrade file of download Row upgrading;
Upgrading checks module, is upgraded successfully for checking whether, will be write if upgrading successfully local The daily record data of file is sent to data server, and the collector journal data since the progress point of record, Started working with the version after upgrading, the version otherwise returning back to before upgrading is operated.
9. log collection client according to claim 8, it is characterised in that the daily record Collect after client terminal start-up, establishment has a finger daemon and the progress of work, the heartbeat request module to When configuration server sends heartbeat request, following operation is performed:
The progress of work periodically sends to configuration server and carried in heartbeat request, the heartbeat request current The version number of log collection client and the IP address of host, so that configuration server is in no liter The heartbeat request response of sky is sent in the case of level API request, in the case where there is upgrading API request The heartbeat request response for carrying upgrade command is sent, the upgrade command includes log collection to be upgraded visitor The version number at family end and its download address.
10. log collection client according to claim 9, it is characterised in that the upgrading Respond module performs following operation before being upgraded using the upgrade file downloaded, also:
The progress of work is given notice the signal SIGUSR1 of updating operation to finger daemon.
11. log collection client according to claim 10, it is characterised in that described to keep Shield process has following global state:
A, DAEMON_INIT, finger daemon are ready to carry out initial work;
B, DAEMON_INIT_FAIL, finger daemon initialization perform failure;
C, DAEMON_NORMAL, finger daemon initialization run succeeded, and start to guard work Make;
D, DAEMON_UPDATE, finger daemon are ready to carry out program upgrade job;
E, DAEMON_UPDATE_FAIL, finger daemon configuration processor upgrade job failure.
12. log collection client according to claim 11, it is characterised in that the liter Level respond module performs following operation when being upgraded using the upgrade file downloaded:
It is DAEMON_UPDATE that finger daemon, which receives and set after SIGUSR1 signals global state,;
Finger daemon detects current global state for DAEMON_UPDATE in circulation is guarded When, upgraded using the upgrade file of download;
Finger daemon sends SIGKILL signals to the progress of work, and the progress of work is exited.
13. log collection client according to claim 12, it is characterised in that the liter Level respond module performs following operation when being upgraded using the upgrade file downloaded, also:
The log collection client-side program after upgrading is performed, the finger daemon under redaction and work is created Process;
Finger daemon loop cycle detection global state under redaction;
If the progress of work under redaction is exited extremely after starting, global state is caused to be changed into DAEMON_UPDATE_FAIL, then send notification signal SIGUSR2 to guarding under original version Process, encloses startup failed message;
If it was found that state remains the progress of work under redaction in DAEMON_INIT, cycle period There is not abnormal generation, then send notification signal SIGUSR2 and start success message under original version Finger daemon.
14. log collection client according to claim 13, it is characterised in that the liter Level checks that module is checking whether that when upgrading successfully, execution is following to be operated:
Finger daemon loop cycle under original version checks the notice of the finger daemon under redaction Signal SIGUSR2;
If the SIGUSR2 of the finger daemon in cycle period not under redaction, original version Under finger daemon think to start redaction time-out and to process group where finger daemon under redaction Finger daemon under transmission SIGKILL orders, the operation of end new procedures, subsequent original version is again Start the progress of work and the state to before upgrading that retracts;
If receiving the SIGUSR2 signals of the finger daemon under redaction in cycle period and obtaining To failed message is started, then the finger daemon under original version is to process where finger daemon under redaction Group sends SIGKILL orders, terminates the finger daemon weight under the operation of new procedures, subsequent original version It is new to start the progress of work and the state to before upgrading that retracts;
If receiving the SIGUSR2 signals of the finger daemon under redaction in cycle period and obtaining To success message is started, then the finger daemon under original version is exited, and is upgraded successfully.
CN201610011466.0A 2016-01-08 2016-01-08 Log collection client and upgrading method thereof Active CN106959866B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201610011466.0A CN106959866B (en) 2016-01-08 2016-01-08 Log collection client and upgrading method thereof
PCT/CN2016/112854 WO2017118334A1 (en) 2016-01-08 2016-12-29 Log collection client and updating method therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610011466.0A CN106959866B (en) 2016-01-08 2016-01-08 Log collection client and upgrading method thereof

Publications (2)

Publication Number Publication Date
CN106959866A true CN106959866A (en) 2017-07-18
CN106959866B CN106959866B (en) 2020-12-01

Family

ID=59274159

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610011466.0A Active CN106959866B (en) 2016-01-08 2016-01-08 Log collection client and upgrading method thereof

Country Status (2)

Country Link
CN (1) CN106959866B (en)
WO (1) WO2017118334A1 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108363610A (en) * 2018-02-09 2018-08-03 华为技术有限公司 A kind of control method and equipment of virtual machine monitoring plug-in unit
CN109257218A (en) * 2018-09-19 2019-01-22 上海电子信息职业技术学院 One kind being based on snmp protocol network system isolated island self-healing method
CN109361542A (en) * 2018-10-29 2019-02-19 北京奇艺世纪科技有限公司 The fault handling method of client, device, system, terminal and server
CN109542750A (en) * 2018-11-26 2019-03-29 深圳天源迪科信息技术股份有限公司 Distributed information log system
CN111596940A (en) * 2020-05-19 2020-08-28 杭州视联动力技术有限公司 Version upgrading method and device, electronic equipment and storage medium
CN112596941A (en) * 2020-12-28 2021-04-02 凌云光技术股份有限公司 Tool result judgment method and device of industrial image processing software
CN112905230A (en) * 2021-03-16 2021-06-04 深圳市麦谷科技有限公司 Application program management method and device, terminal equipment and storage medium
CN113329046A (en) * 2020-02-28 2021-08-31 珠海格力电器股份有限公司 Data transmission method, system and storage medium
CN115361435A (en) * 2022-07-13 2022-11-18 阿里巴巴(中国)有限公司 Data processing method
CN117056288A (en) * 2023-08-17 2023-11-14 齐鲁空天信息研究院 Method and system for searching and downloading server file

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110045971B (en) * 2018-01-16 2023-03-24 浙江宇视科技有限公司 System upgrade recovery method and device
CN110879713B (en) * 2018-09-06 2023-06-20 山东华软金盾软件股份有限公司 Android terminal strong encryption plug-in thermal update management method
CN112181443B (en) * 2019-07-01 2023-04-07 中国移动通信集团浙江有限公司 Automatic service deployment method and device and electronic equipment
CN111124465B (en) * 2019-11-28 2023-06-20 武汉虹信技术服务有限责任公司 Cross-network C/S program remote upgrading method and system
CN111061499B (en) * 2019-12-31 2023-06-13 上海赫千电子科技有限公司 ECU updating method and system based on file system
CN113329044A (en) * 2020-02-28 2021-08-31 北京京东振世信息技术有限公司 Monitoring agent program upgrading method and upgrading device
CN111385296B (en) * 2020-03-04 2022-06-21 深信服科技股份有限公司 Business process restarting method, device, storage medium and system
CN114584464B (en) * 2022-03-07 2024-06-18 浪潮云信息技术股份公司 Cloud platform full-automatic management log acquisition method and terminal
CN115509559B (en) * 2022-09-30 2023-09-01 广州朗桥维视通信技术有限公司 Zero-contact deployment system and method
CN115576792A (en) * 2022-11-24 2023-01-06 北京宝兰德软件股份有限公司 Log collection system and method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145973A (en) * 2007-10-23 2008-03-19 华为技术有限公司 Software upgrade method and device
CN103064860A (en) * 2011-10-21 2013-04-24 阿里巴巴集团控股有限公司 Database high availability implementation method and device
US20140047427A1 (en) * 2012-08-13 2014-02-13 International Business Machines Corporation Concurrent embedded application update and migration
CN103677870A (en) * 2012-09-10 2014-03-26 腾讯科技(深圳)有限公司 System upgrading method and system upgraded by means of method
CN105187262A (en) * 2015-10-27 2015-12-23 上海斐讯数据通信技术有限公司 Router upgrading method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1276348C (en) * 2003-01-15 2006-09-20 联想(北京)有限公司 Automatic upgrading method for diskfree working station
CN101719165B (en) * 2010-01-12 2014-12-17 浪潮电子信息产业股份有限公司 Method for realizing high-efficiency rapid backup of database

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145973A (en) * 2007-10-23 2008-03-19 华为技术有限公司 Software upgrade method and device
CN103064860A (en) * 2011-10-21 2013-04-24 阿里巴巴集团控股有限公司 Database high availability implementation method and device
US20140047427A1 (en) * 2012-08-13 2014-02-13 International Business Machines Corporation Concurrent embedded application update and migration
CN103677870A (en) * 2012-09-10 2014-03-26 腾讯科技(深圳)有限公司 System upgrading method and system upgraded by means of method
CN105187262A (en) * 2015-10-27 2015-12-23 上海斐讯数据通信技术有限公司 Router upgrading method and system

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108363610A (en) * 2018-02-09 2018-08-03 华为技术有限公司 A kind of control method and equipment of virtual machine monitoring plug-in unit
CN109257218B (en) * 2018-09-19 2021-08-06 上海电子信息职业技术学院 Island self-healing method of network system based on SNMP protocol
CN109257218A (en) * 2018-09-19 2019-01-22 上海电子信息职业技术学院 One kind being based on snmp protocol network system isolated island self-healing method
CN109361542A (en) * 2018-10-29 2019-02-19 北京奇艺世纪科技有限公司 The fault handling method of client, device, system, terminal and server
CN109361542B (en) * 2018-10-29 2021-10-15 北京奇艺世纪科技有限公司 Client fault processing method, device, system, terminal and server
CN109542750A (en) * 2018-11-26 2019-03-29 深圳天源迪科信息技术股份有限公司 Distributed information log system
CN113329046A (en) * 2020-02-28 2021-08-31 珠海格力电器股份有限公司 Data transmission method, system and storage medium
CN111596940A (en) * 2020-05-19 2020-08-28 杭州视联动力技术有限公司 Version upgrading method and device, electronic equipment and storage medium
CN111596940B (en) * 2020-05-19 2023-04-07 杭州视联动力技术有限公司 Version upgrading method and device, electronic equipment and storage medium
CN112596941A (en) * 2020-12-28 2021-04-02 凌云光技术股份有限公司 Tool result judgment method and device of industrial image processing software
CN112596941B (en) * 2020-12-28 2023-10-03 凌云光技术股份有限公司 Tool result judging method and device of industrial image processing software
CN112905230A (en) * 2021-03-16 2021-06-04 深圳市麦谷科技有限公司 Application program management method and device, terminal equipment and storage medium
CN115361435A (en) * 2022-07-13 2022-11-18 阿里巴巴(中国)有限公司 Data processing method
CN117056288A (en) * 2023-08-17 2023-11-14 齐鲁空天信息研究院 Method and system for searching and downloading server file

Also Published As

Publication number Publication date
WO2017118334A1 (en) 2017-07-13
CN106959866B (en) 2020-12-01

Similar Documents

Publication Publication Date Title
CN106959866A (en) A kind of log collection client and its upgrade method
US8146060B2 (en) Data processing system and method for execution of a test routine in connection with an operating system
US6167358A (en) System and method for remotely monitoring a plurality of computer-based systems
CN105518629B (en) Cloud deployment base structural confirmation engine
US7703091B1 (en) Methods and apparatus for installing agents in a managed network
CN101799751B (en) Method for building monitoring agent software of host machine
CN104205109B (en) The worker process of continuation and elasticity
CN106557384A (en) Based on the data processing method of Linux, device and system
CN110895488B (en) Task scheduling method and device
CN110895487B (en) Distributed task scheduling system
CN106980493B (en) Firmware management method and device
CN111917833B (en) Application method, device and system of client program in cloud environment
KR20040047209A (en) Method for automatically recovering computer system in network and recovering system for realizing the same
CN110895486B (en) Distributed task scheduling system
CN108762886A (en) The fault detect restoration methods and system of virtual machine
CN105512000A (en) Method and device for collecting abnormal information of operating system, and computer
CN112732412B (en) Service configuration file processing method and device, storage medium and electronic equipment
CN111245917B (en) Katalon-based work order entry device and implementation method thereof
TWI740886B (en) Log collection client terminal and its upgrading method
CN110895485A (en) Task scheduling system
CN117724803A (en) Cloud service deployment method, device and platform
CN112948008A (en) Ironic based physical bare computer management method
CN107657053A (en) A kind of reptile implementation method and device
CN117215818A (en) Cloud edge collaboration-based lightweight application collaboration method for Internet of things
CN111782236A (en) System software upgrading method and device, storage medium and all-in-one machine equipment

Legal Events

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