WO2017118334A1 - 一种日志收集客户端及其升级方法 - Google Patents

一种日志收集客户端及其升级方法 Download PDF

Info

Publication number
WO2017118334A1
WO2017118334A1 PCT/CN2016/112854 CN2016112854W WO2017118334A1 WO 2017118334 A1 WO2017118334 A1 WO 2017118334A1 CN 2016112854 W CN2016112854 W CN 2016112854W WO 2017118334 A1 WO2017118334 A1 WO 2017118334A1
Authority
WO
WIPO (PCT)
Prior art keywords
daemon
upgrade
version
log collection
collection client
Prior art date
Application number
PCT/CN2016/112854
Other languages
English (en)
French (fr)
Inventor
唐恺
Original Assignee
阿里巴巴集团控股有限公司
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 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2017118334A1 publication Critical patent/WO2017118334A1/zh

Links

Images

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

Definitions

  • the invention belongs to the technical field of computers, and in particular relates to a log collection client and an upgrade method thereof.
  • Logs are a widely distributed and important data resource. Based on logs, system monitoring, operational auditing, and data analysis can be completed.
  • the log collection client is a program running on the device operating system. The content of the specified log file can be read according to the collection configuration and sent to the log server after processing.
  • client programs In order to avoid the potential risks of known bugs and provide a better functional experience, client programs often need to be upgraded to a higher version.
  • the log is generated every moment, and the client program upgrade is inevitably required to replace the executable file and restart the process. Therefore, the log collection progress is easily lost during the upgrade process.
  • Solution 1 is a cold upgrade, such as Logstash (version 1.5.4), fluentd (2.2.1 version) and other open source log collection software.
  • the program version upgrade process is divided into three steps:
  • Solution 2 is a dual program file hot upgrade. This type of client software runs two program files on the device, corresponding to two processes: one is the log collection process, the process installs the SIGTERM signal and executes the program exit in the signal processing function. The preparation process; the other is the daemon, responsible for downloading new program files and completing the old to new version switch.
  • the upgrade process consists of four steps:
  • the daemon detects that a new client program installation package is available in a poll and downloads it to the machine;
  • the daemon sends a SIGTERM signal to the log collection process
  • the log collection process After receiving the SIGTERM signal, the log collection process completes the exit preparation operation and records. The log collection progresses to the local state and then voluntarily quits. If the log collection process exits timeout (for example, if the process does not complete the exit preparation operation one minute after the process accepts SIGTERM), the daemon will issue SIGKILL to force the end of the log collection process to run.
  • the daemon detects that the old version of the log collection process has exited, starts the new version of the program, and completes the upgrade.
  • the existing cold upgrade solution requires manual participation in the upgrade process, high operation and maintenance costs, and the process of upgrading the system will force the killing of the old process, resulting in the loss of the log collection progress.
  • the program version upgrade has an impact on the integrity of the data collection;
  • the new version of the program file is not available (such as crash after startup), and there is no automatic version fallback mechanism.
  • the log collector is combined with the daemon to support the automation operation.
  • the daemon communicates with the log collection process by one-way communication.
  • the daemon After the log collection process receives the SIGTERM signal, If you can't exit normally in a short time (such as not completing the log collection progress), the daemon will issue a SIGKILL signal again after the timeout and be forced to terminate its operation. After the new version of the program is started, the log collection progress before the upgrade cannot be obtained, resulting in loss of data collection. After the SIGTERM is issued by the daemon, the old version of the log collection process exits normally, but when the new collection program that is subsequently started cannot be started normally, the log collection is interrupted, and manual operation and maintenance intervention is required.
  • the object of the present invention is to provide a log collection client and an upgrade method thereof, which can complete the program self-upgrade by means of a single program file and a dual-process operation, and solve the data loss problem that may occur during the upgrade process and the version return when the upgrade fails.
  • Treatment can complete the program self-upgrade by means of a single program file and a dual-process operation, and solve the data loss problem that may occur during the upgrade process and the version return when the upgrade fails.
  • a log collection client upgrade method is applied to a log collection client, and the method includes:
  • the server sends a heartbeat request, including:
  • the work process periodically sends a heartbeat request to the configuration server, where the heartbeat request carries the version number of the current log collection client and the IP address of the host, so that the configuration server sends an empty heartbeat request response without upgrading the API request.
  • the heartbeat request response carrying the upgrade command is sent in the case of upgrading the API request, and the upgrade command includes a version number of the log collection client to be upgraded and a download address thereof.
  • the method further includes:
  • the worker process issues a signal SIGUSR1 to the daemon to notify the upgrade operation.
  • daemon has the following global state:
  • the upgrading is performed by using the downloaded upgrade file, including:
  • the global state is set to DAEMON_UPDATE
  • the daemon uses the downloaded upgrade file to upgrade;
  • the daemon sends a SIGKILL signal to the worker process and the worker process exits.
  • the upgrading by using the downloaded upgrade file further includes the following steps:
  • the daemon cycle under the new version periodically detects the global state
  • the notification signal SIGUSR2 is sent to the daemon under the original version, and a startup failure message is attached;
  • the notification signal SIGUSR2 and the startup success message are sent to the daemon under the original version.
  • the daemon cycle under the original version periodically checks the notification signal SIGUSR2 from the daemon under the new version;
  • the daemon in the original version recognizes To start the new version timeout and send the SIGKILL command to the process group where the new version of the daemon is located, the new program is finished running, and then the daemon under the original version restarts the work process and rolls back to the pre-upgrade state;
  • the daemon in the original version sends a SIGKILL command to the process group in the new version of the daemon to end the running of the new program. Then the daemon in the original version restarts the worker process and rolls back to the pre-upgrade state;
  • the present invention also provides a log collection client, and the log collection client includes:
  • a heartbeat request module configured to send a heartbeat request to the configuration server, and receive a heartbeat request response returned by the configuration server;
  • the upgrade response module is configured to download the upgrade file according to the upgrade instruction carried in the heartbeat request response, suspend the sending of the heartbeat request, stop collecting the new log data, and write the log data that has been collected but not completed to the local file, and record the current progress. Point, use the downloaded upgrade file to upgrade;
  • the upgrade check module is used to check whether the upgrade is successful. If the upgrade is successful, the log data written to the local file is sent to the data server, and the log data is collected from the recorded progress point to start working with the upgraded version, otherwise the rollback is performed. Work until the pre-upgrade version.
  • a daemon process and a work process are created.
  • the heartbeat request module sends a heartbeat request to the configuration server, the following operations are performed:
  • the work process periodically sends a heartbeat request to the configuration server, where the heartbeat request carries the version number of the current log collection client and the IP address of the host, so that the configuration server sends an empty heartbeat request response without upgrading the API request.
  • the heartbeat request response carrying the upgrade command is sent in the case of upgrading the API request, and the upgrade command includes a version number of the log collection client to be upgraded and a download address thereof.
  • the upgrade response module performs the following operations before upgrading by using the downloaded upgrade file:
  • the worker process issues a signal SIGUSR1 to the daemon to notify the upgrade operation.
  • daemon has the following global state:
  • the global state is set to DAEMON_UPDATE
  • the daemon uses the downloaded upgrade file to upgrade;
  • the daemon sends a SIGKILL signal to the worker process and the worker process exits.
  • the daemon cycle under the new version periodically detects the global state
  • the notification signal SIGUSR2 is sent to the daemon under the original version, and a startup failure message is attached;
  • the notification signal SIGUSR2 and the startup success message are sent to the daemon under the original version.
  • the upgrade check module checks whether the upgrade is successful, the following operations are performed:
  • the daemon cycle under the original version periodically checks the notification signal SIGUSR2 from the daemon under the new version;
  • the daemon in the original version thinks that the new version is timed out and sends a SIGKILL command to the process group of the daemon under the new version, ending the running of the new program, and then the original The daemon under the version restarts the worker process and rolls back to the pre-upgrade state;
  • the daemon in the original version sends a SIGKILL command to the process group in the new version of the daemon to end the running of the new program. Then the daemon in the original version restarts the worker process and rolls back to the pre-upgrade state;
  • the invention provides a log collection client and an upgrade method thereof.
  • the upgrade process does not require manual operation and maintenance intervention.
  • the parent and child processes in the upgrade process communicate in two directions, and the upgrade operation is performed after the negotiation.
  • the data is not lost before and after the upgrade; if the new program starts abnormally
  • the daemon can quickly discover and automate version rollback operations.
  • FIG. 1 is a flowchart of a method for upgrading a log collection client according to the present invention
  • FIG. 3 is a flow chart of running a new version of the client of the present invention.
  • FIG. 4 is a schematic structural diagram of a log collection client according to the present invention.
  • the log system generally includes a log collection client Client installed on the host machine, a configuration server ConfigServer for managing the log collection client running on all the hosts, and a data server DataServer receiving the log data collected by the client.
  • the host machine is the device that the log system records, and the log collection client is installed on each host.
  • the daemon Process daemonProcess After the host's log collection client is started, two processes start running, one is the daemon Process daemonProcess, and the other is the worker process WorkerProcess.
  • the child process WorkerProcess collects the specified log file content according to the user's collection configuration and sends it to the data server through the network.
  • the child process WorkerProcess also sends a heartbeat request to the configuration server through timing (for example, 1 minute), and accepts the configuration server through the response content of the heartbeat request. Instructions.
  • the parent process DaemonProcess is a daemon process. After the worker process is unexpectedly exited, the child process is restarted. When the client version upgrade command is found, the upgrade process is triggered.
  • a log collection client upgrade method is applied to the log collection client, and includes:
  • Step S1 Send a heartbeat request to the configuration server, and receive a heartbeat request response returned by the configuration server.
  • the WorkerProcess After the Client starts on the host, the WorkerProcess sends a heartbeat request to the ConfigServer every 1 minute.
  • the request includes the current program file version number v_1 and the host ip_1.
  • ConfigServer returns empty content to WorkerProcess in the response of the heartbeat request.
  • the ConfigServer sets the state of the host ip_1: the current version v_1 and the upgrade version v_2.
  • ConfigServer returns an upgrade command in response to the heartbeat request, and the upgrade command includes a v_2 version number, a v_2 program upgrade file (HTTP download address), and an executable file md5sum.
  • Step S2 Suspend the sending of the heartbeat request according to the upgrade instruction carried in the heartbeat request response, stop collecting the new log data, write the collected log data to the local file, record the current progress point, and download the upgrade file to start the upgrade.
  • the log collection client of version v_1 is called ClientV1
  • the corresponding two processes are WorkerProcessV1 and DaemonProcessV1.
  • the log collection client that is upgraded to version v_2 is called ClientV2, and the corresponding two processes are WorkerProcessV2 and DaemonProcessV2.
  • WorkerProcessV1 starts to prepare for the upgrade operation when it finds that there is an upgrade command in the response of the heartbeat request:
  • the log data read in the memory is parsed and written to the local file BuffeFile.
  • the log data written to BuffeFil is the log data that has been collected but not sent.
  • the BufferFile will be sent to the DataServer by ClientV2 after the upgrade is completed. Writing BufferFile can greatly reduce the long upgrade time caused by network transmission delay.
  • the content includes: the log directory, the log file name, the log file signature, and the location where the log file is currently collected.
  • the DaemonProcess initialization succeeds and starts to guard the work.
  • the DaemonProcess process has the following signal handlers:
  • the SIGCHLD signal indicates that its child process WorkerProcess exits abnormally. If the global state is DAEMON_INIT, the state changes to DAEMON_INIT_FAIL.
  • the custom SIGUSR1 is a signal sent by the WorkerProcess to the DaemonProcess to notify the upgrade operation. After receiving the signal, the DaemonProcess sets the global state to DAEMON_UPDATE.
  • the custom SIGUSR2 in this embodiment is a signal sent by the new DaemonProcess upgraded to the old DaemonProcess. If the signal comes with the message DaemonStartSuccess (new version DaemonProcess, WorkerProcess started successfully), then DaemonProcess voluntarily exits; if the signal message is DaemonStartFail (new version DaemonProcess or WorkerProcess failed to start), set the DaemonProcess global state to DAEMON_UPDATE_FAIL.
  • DaemonProcessV1 processes the SIGUSR1 signal and enters the interrupt.
  • the signal handler sets the global state to DAEMON_UPDATE.
  • DaemonProcessV1 As shown in Figure 2, after ClientV1 starts, set DaemonProcessV1 to DAEMON_INIT state, and install SIGCHLD signal, then fork out WorkerProcessV1 for log collection loop, DaemonProcessV1 installs SIGUSR1 signal, and sets the state to DAEMON_NORMAL. After ConfigServer carries the upgrade command in the returned heartbeat request response, WorkerProcessV1 sends SIGUSR1 to DaemonProcessV1. DaemonProcessV1 detects the current global state as DAEMON_UPDATE in the daemon loop and starts the upgrade.
  • DaemonProcessV1 sends SIGKILL to WorkerProcessV1. At this time, the memory queue of WorkerProcessV1 is empty, and then WorkerProcessV1 exits without data loss.
  • DaemonProcessV1 installs SIGUSR2 signal: If the installation fails, set the current state to DAEMON_NORMAL and perform rollback, re-fork out WorkerProcessV1, end the upgrade operation and restore to the pre-upgrade state; if SIGUSR2 is successfully installed, fork a child process, in the child process Execute the new version of the program file ClientV2 in the current process space, and start loop detection to see if the upgrade is successful.
  • Step S3 Check whether the upgrade is successful. If the upgrade is successful, the log data written to the local file is sent to the data server, and the log data is collected from the recorded progress point, and the upgraded version starts to work, otherwise it is rolled back to the pre-upgrade. version of.
  • DaemonProcessV2 performs the initialization work.
  • DaemonProcessV2fork executes WorkProcessV2 and enters a 5 second loop wait. DaemonProcessV2 detects the global status:
  • DaemonProcessV1 If there is no SIGUSR2 from DaemonProcessV2 within 15 seconds, DaemonProcessV1 considers that the new version is timed out and sends a SIGKILL command to the process group where DaemonProcessV2 is located, ending the running of the new program, then DaemonProcessV1 restarts WorkerProcessV1 and rolls back to the pre-upgrade state.
  • DaemonProcessV1 sends a SIGKILL command to the process group where DaemonProcessV2 is located, ending the running of the new program, and then DaemonProcessV1 restarts WorkerProcessV1 and rolls back to the pre-upgrade state. That is, DaemonProcessV1 will clean up the process group of ClientV2 and fall back to the V1 version.
  • DaemonProcessV1 executes exit exit, that is, DaemonProcessV1 will actively exit after receiving the signal. After DaemonProcessV1 exits, DaemonProcessV2 and WorkerProcessV2 are completely taken over, the upgrade is completed, and only two versions of V2 are available thereafter. The process runs on the machine and the upgrade process ends successfully.
  • the log collection client to which the present invention is applied is deployed on hundreds of thousands of servers, and the upgrade of the API can complete the upgrade of all machine client versions in 10 minutes.
  • the client upgrade of a single machine can be completed in 5 seconds. There is no loss in data collection during the process, and the new version of the program can be automatically rolled back when it is abnormal.
  • a log collection client includes a heartbeat request module, an upgrade response module, and an upgrade check module.
  • the log collection client of this embodiment is installed on the host machine for collecting log data, and interacting with the configuration server to complete the upgrade of the program.
  • the heartbeat request module is configured to send a heartbeat request to the configuration server, and receive a heartbeat request response returned by the configuration server.
  • the upgrade response module is configured to download the upgrade file according to the upgrade instruction carried in the heartbeat request response, and suspend the sending of the heartbeat request and stop.
  • the new log data is collected, and the log data that has been collected but not completed is written to the local file, the current progress point is recorded, and the downloaded upgrade file is used for the upgrade.
  • the upgrade check module is used to check whether the upgrade is successful.
  • the log data written to the local file is sent to the data server, and the log data is collected from the recorded progress point to start working with the upgraded version, otherwise it is rolled back to the pre-upgrade version to work.
  • a daemon process and a work process are created. The following describes the operations performed by each module during the upgrade process.
  • the heartbeat request module sends a heartbeat request to the configuration server, the following operations are performed:
  • the work process periodically sends a heartbeat request to the configuration server, where the heartbeat request carries the version number of the current log collection client and the IP address of the host, so that the configuration server sends an empty heartbeat request response without upgrading the API request.
  • the heartbeat request response carrying the upgrade command is sent in the case of upgrading the API request, and the upgrade command includes a version number of the log collection client to be upgraded and a download address thereof.
  • the upgrade response module performs the following operations before upgrading by using the downloaded upgrade file:
  • the worker process issues a signal SIGUSR1 to the daemon to notify the upgrade operation.
  • the global state is set to DAEMON_UPDATE
  • the daemon uses the downloaded upgrade file to upgrade;
  • the daemon sends a SIGKILL signal to the worker process and the worker process exits.
  • the daemon cycle under the new version periodically detects the global state
  • the notification signal SIGUSR2 is sent to the daemon under the original version, and a startup failure message is attached;
  • the notification signal SIGUSR2 and the startup success message are sent to the daemon under the original version.
  • the daemon cycle under the original version periodically checks the notification signal SIGUSR2 from the daemon under the new version;
  • the daemon in the original version thinks that the new version is timed out and sends a SIGKILL command to the process group of the daemon under the new version, ending the running of the new program, and then the original The daemon under the version restarts the worker process and rolls back to the pre-upgrade state;
  • the daemon in the original version sends a SIGKILL command to the process group in the new version of the daemon to end the running of the new program. Then the daemon in the original version restarts the worker process and rolls back to the pre-upgrade state;

Abstract

一种日志收集客户端及其升级方法,该方法首先向配置服务器发送心跳请求,接收配置服务器返回的心跳请求响应(S1),随后根据心跳请求响应中携带的升级指令,下载升级文件并暂停发送心跳请求,并停止收集新的日志数据,将已经收集但未完成发送的日志数据写入本地文件,记录当前进度点,采用下载的升级文件进行升级(S2),并检查是否升级成功,如果升级成功则将写入本地文件的日志数据发送到数据服务器,并从记录的进度点开始收集日志数据,以升级后的版本开始工作,否则回退到升级前的版本进行工作(S3)。日志收集客户端包括心跳请求模块、升级响应模块和升级检查模块。该方案可以实现在升级过程中数据收集无丢失,新版程序异常时可以自动回滚。

Description

一种日志收集客户端及其升级方法
本申请要求2016年01月08日递交的申请号为201610011466.0、发明名称为“一种日志收集客户端及其升级方法”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明属于计算机技术领域,尤其涉及一种日志收集客户端及其升级方法。
背景技术
随着电子信息技术的发展,大数据时代已经到来。日志是一种分布广泛且重要的数据资源,基于日志可以完成系统监控、运营审计、数据分析等工作。日志收集客户端是运行在设备操作系统上的程序,可以根据采集配置读取指定日志文件内容、处理后发送到日志服务端。
为了规避已知程序bug的潜在风险、提供更好的功能体验,客户端程序往往需要升级为更高的版本。然而在实际业务场景下,日志每时每刻在产生,客户端程序升级不可避免要更换可执行文件并重启进程,因此在升级的过程中容易造成日志采集进度的丢失。
现有技术方案在解决日志收集客户端升级的问题上,业内主要有两类方案。方案一为冷升级,例如Logstash(1.5.4版本)、fluentd(2.2.1版本)等开源日志收集软件,其程序版本升级过程分为三个步骤:
在设备上执行控制脚本停止正在运行的旧版本进程;
通过yum或tar包等方式安装新版本程序文件到设备;
在设备上执行控制脚本启动新版本进程并完成升级。
方案二为双程序文件热升级,这类客户端软件会在设备上运行两个程序文件,分别对应两个进程:一个是日志收集进程,该进程安装SIGTERM信号并在信号处理函数中执行程序退出的准备操作;另一个是守护进程,负责下载新的程序文件并完成从旧到新的版本切换。其升级过程包括四步:
守护进程在一次轮询中检测到有新的客户端程序安装包可用,并将其下载到本机;
守护进程向日志收集进程发出SIGTERM信号;
一般情况下,日志收集进程在接收到SIGTERM信号后,完成退出准备操作并记录 日志采集进度到本地后主动退出。若日志收集进程的退出动作超时(比如进程接受SIGTERM后一分钟没有完成退出准备操作),守护进程将发出SIGKILL强制结束日志收集进程运行。
守护进程检测到旧版本日志收集进程已退出,启动新版本程序并完成升级。
然而现有的冷升级方案,需要人工参与升级过程,运维成本高,并且程序升级过程中会强制杀死旧进程造成日志采集进度的丢失,程序版本升级对数据收集的完整性有影响;假如新版本程序文件不可用(如启动后发生crash),也没有自动的版本回退机制。现有双程序热升级方案中,日志收集程序与守护程序相结合,支持自动化操作,但升级过程中,守护进程通过信号与日志收集进程单向通信,日志收集进程在收到SIGTERM信号后,若短时间无法正常退出(比如没有完成日志采集进度的持久化),守护进程在超时后会再次发出SIGKILL信号并被强制终止其运行。这样新版本程序启动后无法获取升级前的日志采集进度,造成数据收集的丢失。并且在守护进程发出SIGTERM后,旧版本日志收集进程正常退出,但是随后启动的新采集程序无法正常启动时,日志收集中断,需要人工运维介入。
发明内容
本发明的目的是提供一种日志收集客户端及其升级方法,通过单程序文件、双进程运行的方式完成程序自身升级,解决了升级过程中可能出现的数据丢失问题和升级失败时的版本回退问题。
为了实现上述目的,本发明技术方案如下:
一种日志收集客户端升级方法,应用于日志收集客户端,所述方法包括:
向配置服务器发送心跳请求,接收配置服务器返回的心跳请求响应;
根据心跳请求响应中携带的升级指令,下载升级文件并暂停发送心跳请求,并停止收集新的日志数据,将已经收集但未完成发送的日志数据写入本地文件,记录当前进度点,采用下载的升级文件进行升级;
检查是否升级成功,如果升级成功则将写入本地文件的日志数据发送到数据服务器,并从记录的进度点开始收集日志数据,以升级后的版本开始工作,否则回退到升级前的版本进行工作。
其中,所述日志收集客户端启动后,创建有守护进程和工作进程,则所述向配置服 务器发送心跳请求,包括:
工作进程定期向配置服务器发送心跳请求,所述心跳请求中携带当前日志收集客户端的版本号和宿主机的IP地址,以便配置服务器在没有升级API请求的情况下发送空的心跳请求响应,在有升级API请求的情况下发送携带升级指令的心跳请求响应,所述升级指令包括待升级日志收集客户端的版本号及其下载地址。
进一步地,所述日志收集客户端升级方法在采用下载的升级文件进行升级之前,还包括:
所述工作进程向守护进程发出通知升级操作的信号SIGUSR1。
进一步地,所述守护进程具有如下全局状态:
A、DAEMON_INIT,守护进程准备执行初始化工作;
B、DAEMON_INIT_FAIL,守护进程初始化执行失败;
C、DAEMON_NORMAL,守护进程初始化执行成功,并开始守护工作;
D、DAEMON_UPDATE,守护进程准备执行程序升级工作;
E、DAEMON_UPDATE_FAIL,守护进程执行程序升级工作失败。
进一步地,所述采用下载的升级文件进行升级,包括:
守护进程接收SIGUSR1信号后设置全局状态为DAEMON_UPDATE;
守护进程在守护循环中检测到当前全局状态为DAEMON_UPDATE时,采用下载的升级文件进行升级;
守护进程发送SIGKILL信号给工作进程,工作进程退出。
进一步地,所述采用下载的升级文件进行升级,还包括步骤:
执行升级后的日志收集客户端程序,创建新版本下的守护进程和工作进程;
新版本下的守护进程周期循环检测全局状态;
如果新版本下的工作进程启动后异常退出,导致全局状态变为DAEMON_UPDATE_FAIL,则发送通知信号SIGUSR2给原版本下的守护进程,附上启动失败消息;
若发现状态保持为DAEMON_INIT,循环周期内新版本下的工作进程未有异常发生,则发送通知信号SIGUSR2和启动成功消息给原版本下的守护进程。
进一步地,所述检查是否升级成功,包括:
原版本下的守护进程周期循环检查来自新版本下的守护进程的通知信号SIGUSR2;
若在循环周期内没有来自新版本下的守护进程的SIGUSR2,原版本下的守护进程认 为启动新版本超时并向新版本下的守护进程所在进程组发送SIGKILL命令,结束新程序的运行,随后原版本下的守护进程重新启动工作进程并回退至升级前状态;
若在循环周期内收到来自新版本下的守护进程的SIGUSR2信号并得到启动失败消息,则原版本下的守护进程向新版本下的守护进程所在进程组发送SIGKILL命令,结束新程序的运行,随后原版本下的守护进程重新启动工作进程并回退至升级前状态;
若在循环周期内收到来自新版本下的守护进程的SIGUSR2信号且得到启动成功消息,则原版本下的守护进程退出,升级成功。
本发明还提出了一种日志收集客户端,所述日志收集客户端包括:
心跳请求模块,用于向配置服务器发送心跳请求,接收配置服务器返回的心跳请求响应;
升级响应模块,用于根据心跳请求响应中携带的升级指令,下载升级文件并暂停发送心跳请求并停止收集新的日志数据,将已经收集但未完成发送的日志数据写入本地文件,记录当前进度点,采用下载的升级文件进行升级;
升级检查模块,用于检查是否升级成功,如果升级成功则将写入本地文件的日志数据发送到数据服务器,并从记录的进度点开始收集日志数据,以升级后的版本开始工作,否则回退到升级前的版本进行工作。
进一步地,所述日志收集客户端启动后,创建有守护进程和工作进程,所述心跳请求模块在向配置服务器发送心跳请求时,执行如下操作:
工作进程定期向配置服务器发送心跳请求,所述心跳请求中携带当前日志收集客户端的版本号和宿主机的IP地址,以便配置服务器在没有升级API请求的情况下发送空的心跳请求响应,在有升级API请求的情况下发送携带升级指令的心跳请求响应,所述升级指令包括待升级日志收集客户端的版本号及其下载地址。
进一步地,所述升级响应模块在采用下载的升级文件进行升级之前,还执行如下操作:
所述工作进程向守护进程发出通知升级操作的信号SIGUSR1。
进一步地,所述守护进程具有如下全局状态:
A、DAEMON_INIT,守护进程准备执行初始化工作;
B、DAEMON_INIT_FAIL,守护进程初始化执行失败;
C、DAEMON_NORMAL,守护进程初始化执行成功,并开始守护工作;
D、DAEMON_UPDATE,守护进程准备执行程序升级工作;
E、DAEMON_UPDATE_FAIL,守护进程执行程序升级工作失败。
进一步地,所述升级响应模块在采用下载的升级文件进行升级时,执行如下操作:
守护进程接收SIGUSR1信号后设置全局状态为DAEMON_UPDATE;
守护进程在守护循环中检测到当前全局状态为DAEMON_UPDATE时,采用下载的升级文件进行升级;
守护进程发送SIGKILL信号给工作进程,工作进程退出。
进一步地,所述升级响应模块在采用下载的升级文件进行升级时,还执行如下操作:
执行升级后的日志收集客户端程序,创建新版本下的守护进程和工作进程;
新版本下的守护进程周期循环检测全局状态;
如果新版本下的工作进程启动后异常退出,导致全局状态变为DAEMON_UPDATE_FAIL,则发送通知信号SIGUSR2给原版本下的守护进程,附上启动失败消息;
若发现状态保持为DAEMON_INIT,循环周期内新版本下的工作进程未有异常发生,则发送通知信号SIGUSR2和启动成功消息给原版本下的守护进程。
进一步地,所述升级检查模块在检查是否升级成功时,执行如下操作:
原版本下的守护进程周期循环检查来自新版本下的守护进程的通知信号SIGUSR2;
若在循环周期内没有来自新版本下的守护进程的SIGUSR2,原版本下的守护进程认为启动新版本超时并向新版本下的守护进程所在进程组发送SIGKILL命令,结束新程序的运行,随后原版本下的守护进程重新启动工作进程并回退至升级前状态;
若在循环周期内收到来自新版本下的守护进程的SIGUSR2信号并得到启动失败消息,则原版本下的守护进程向新版本下的守护进程所在进程组发送SIGKILL命令,结束新程序的运行,随后原版本下的守护进程重新启动工作进程并回退至升级前状态;
若在循环周期内收到来自新版本下的守护进程的SIGUSR2信号且得到启动成功消息,则原版本下的守护进程退出,升级成功。
本发明提出的一种日志收集客户端及其升级方法,升级过程无需人工运维干预,升级过程中的父子进程双向通信,协商一致后执行升级操作,升级前后数据不丢失;如果新程序启动异常,守护进程可以快速发现并自动执行版本回退操作。
附图说明
图1为本发明日志收集客户端升级方法流程图;
图2为本发明原版本客户端运行流程图;
图3为本发明新版本客户端运行流程图;
图4为本发明日志收集客户端结构示意图。
具体实施方式
下面结合附图和实施例对本发明技术方案做进一步详细说明,以下实施例不构成对本发明的限定。
日志系统一般包括安装在宿主机上的日志收集客户端Client,以及用于管理所有宿主机上运行的日志收集客户端的配置服务器ConfigServer,以及接收日志收集客户端采集到的日志数据的数据服务器DataServer。宿主机就是日志系统所要记录日志的设备,每个宿主机上都安装有日志收集客户端。
宿主机的日志收集客户端启动后,有两个进程开始运行,一个是守护进程DaemonProcess,一个是工作进程WorkerProcess。在启动日志收集客户端时,先创建父进程DaemonProcess,然后调用系统调用fork,创建子进程WorkerProcess。子进程WorkerProcess根据用户的收集配置采集指定日志文件内容并通过网络发送到数据服务器,同时子进程WorkerProcess还通过定时(例如1分钟)向配置服务器发送心跳请求,通过心跳请求的响应内容来接受配置服务器的指令。父进程DaemonProcess为守护进程,在发现WorkerProcess意外退出后会重启子进程,在发现Client版本升级指令时触发升级流程。
如图1所示,本实施例一种日志收集客户端升级方法,应用于日志收集客户端,包括:
步骤S1、向配置服务器发送心跳请求,接收配置服务器返回的心跳请求响应。
宿主机上Client启动后,WorkerProcess每1分钟向ConfigServer发送一次心跳请求,请求内容包括当前程序文件版本号v_1和宿主机ip_1。在没有升级操作时,ConfigServer在心跳请求的响应中返回空内容给WorkerProcess。
假设对于宿主机ip_1有新的Client版本v_2,运维人员通过升级API向ConfigServer发出请求,ConfigServer在收到升级API请求后,设置宿主机ip_1的状态:当前版本v_1,待升级版本v_2。
则ConfigServer在心跳请求的响应中返回升级指令,升级指令包括v_2版本号、v_2程序升级文件(HTTP下载地址)和可执行文件的md5sum。
步骤S2、根据心跳请求响应中携带的升级指令,暂停发送心跳请求并停止收集新的日志数据,将已经收集的日志数据写入本地文件,记录当前进度点,下载升级文件开始升级。
为便于描述,本实施例将版本v_1的日志收集客户端称为ClientV1,其对应的两个进程为WorkerProcessV1和DaemonProcessV1。将升级为版本v_2的日志收集客户端称为ClientV2,其对应的两个进程为WorkerProcessV2和DaemonProcessV2。
则在ClientV1运行后,WorkerProcessV1发现心跳请求的响应中有升级指令时,开始准备升级操作:
下载程序升级文件到本机,解压缩后并验证可执行文件md5sum。
停止读取新的日志数据。
内存中已读到的日志数据完成解析后写入本地文件BuffeFile,写入BuffeFil的日志数据是已经收集但是未完成发送的日志数据,BufferFile会在升级完成后由ClientV2发送到DataServer。写BufferFile可以大大减少网络发送延时导致的升级时间长问题。
记录进度点CheckPoint。日志采集是有进度的,CheckPoint保存该状态并会持久化到文件。内容包括:日志目录,日志文件名,日志文件签名,日志文件当前采集到的位置。
WorkerProcessV1向DaemonProcessV1发出SIGUSR1,通知升级操作。
本实施例对于DaemonProcess进程,定义了5种全局状态,用于表示DaemonProcess的进程状态,分别为:
1、DAEMON_INIT
DaemonProcess准备执行初始化工作。
2、DAEMON_INIT_FAIL
DaemonProcess初始化执行失败。
3、DAEMON_NORMAL
DaemonProcess初始化执行成功,并开始守护工作。
4、DAEMON_UPDATE
DaemonProcess准备执行程序升级工作。
5、DAEMON_UPDATE_FAIL
DaemonProcess执行程序升级工作失败。
同时DaemonProcess进程有如下信号处理函数:
1)、DaemonProcess的SIGCHLD信号处理函数。
SIGCHLD信号表明其子进程WorkerProcess异常退出,若全局状态为DAEMON_INIT,则状态改变为DAEMON_INIT_FAIL。
2)、DaemonProcess的SIGUSR1信号处理函数。
本实施例自定义SIGUSR1是WorkerProcess发送给DaemonProcess用以通知升级操作的信号,DaemonProcess收到该信号后设置全局状态为DAEMON_UPDATE。
3)、DaemonProcess的SIGUSR2信号处理函数
本实施例自定义SIGUSR2是升级启动的新版DaemonProcess发送给旧版DaemonProcess的信号。若信号附带消息DaemonStartSuccess(新版本DaemonProcess、WorkerProcess启动成功),则DaemonProcess主动退出;若信号消息为DaemonStartFail(新版本DaemonProcess或WorkerProcess启动失败),则设置DaemonProcess全局状态为DAEMON_UPDATE_FAIL。
4)、SIGKILL,向进程发出SIGKILL后,接收到该信号的进程终止运行。
从而在WorkerProcessV1向DaemonProcessV1发出SIGUSR1后,DaemonProcessV1处理SIGUSR1信号,进入中断,信号处理函数将全局状态设置为DAEMON_UPDATE。
如图2所示,ClientV1在启动后,设置DaemonProcessV1为DAEMON_INIT状态,并安装SIGCHLD信号,随后fork出WorkerProcessV1进行日志采集循环,DaemonProcessV1安装SIGUSR1信号,设置状态为DAEMON_NORMAL。当ConfigServer在返回的心跳请求响应中携带升级指令后,WorkerProcessV1发送SIGUSR1给DaemonProcessV1,DaemonProcessV1在守护循环中检测到当前全局状态为DAEMON_UPDATE,开始升级。
DaemonProcessV1发送SIGKILL给WorkerProcessV1,此时WorkerProcessV1的内存队列是空的,随后WorkerProcessV1退出,无数据丢失。
DaemonProcessV1安装SIGUSR2信号:若安装失败,则设置当前状态为DAEMON_NORMAL并执行回退,重新fork出WorkerProcessV1运行,结束升级操作并恢复到升级前状态;若SIGUSR2安装成功,则fork一个子进程,在子进程当前进程空间下执行新版本程序文件ClientV2,并开始循环检测是否升级成功。
步骤S3、检查是否升级成功,如果升级成功则将写入本地文件的日志数据发送到数据服务器,并从记录的进度点开始收集日志数据,以升级后的版本开始工作,否则回退到升级前的版本。
如图3所示,在执行新版本程序文件ClientV2后,DaemonProcessV2执行初始化工作。
设置当前状态为DAEMON_INIT。
安装SIGUSR2信号、SIGCHLD信号。
DaemonProcessV2fork出WorkerProcessV2执行,并进入5秒的循环等待,DaemonProcessV2检测全局状态:
若发现状态变为DAEMON_INIT_FAIL(WorkerProcessV2启动后异常退出,中断处理SIGCHLD信号导致全局状态变化),则发送信号SIGUSR2给DaemonProcessV1,附上消息DaemonStartFail。
若发现状态保持为DAEMON_INIT,5秒内WorkerProcessV2未有异常发生,则发送SIGUSR2信号和消息DaemonStartSuccess给DaemonProcessV1。
接图2,而DaemonProcessV1等待15秒钟时间,检查来自DaemonProcessV2的信号。分三种情况:
若15秒内没有来自DaemonProcessV2的SIGUSR2,DaemonProcessV1认为启动新版本超时并向DaemonProcessV2所在进程组发送SIGKILL命令,结束新程序的运行,随后DaemonProcessV1重新启动WorkerProcessV1并回退至升级前状态。
若15秒内收到SIGUSR2信号并得到消息DaemonStartFail,则DaemonProcessV1向DaemonProcessV2所在进程组发送SIGKILL命令,结束新程序的运行,随后DaemonProcessV1重新启动WorkerProcessV1并回退至升级前状态。即DaemonProcessV1将清理ClientV2的进程组并回退到V1版本工作。
若15秒内收到SIGUSR2信号且得到消息DaemonStartSuccess,则DaemonProcessV1执行exit退出,即DaemonProcessV1在收到信号后将主动退出,DaemonProcessV1退出后,DaemonProcessV2和WorkerProcessV2完全接管,升级完成,此后只有V2版本的两个进程在机器上运行,升级过程成功结束。
应用本发明的日志收集客户端在十几万台服务器上部署,通过升级API可以在10分钟完成所有机器客户端版本的升级。单台机器的客户端升级一般可以在5秒内完成,过程中数据收集无丢失,新版程序异常时可以自动回滚。
如图4所示,本实施例一种日志收集客户端,包括心跳请求模块、升级响应模块和升级检查模块。本实施例的日志收集客户端安装在宿主机上,用于进行日志数据的采集,与配置服务器交互完成程序的升级。
其中,心跳请求模块,用于向配置服务器发送心跳请求,接收配置服务器返回的心跳请求响应;升级响应模块,用于根据心跳请求响应中携带的升级指令,下载升级文件并暂停发送心跳请求并停止收集新的日志数据,将已经收集但未完成发送的日志数据写入本地文件,记录当前进度点,采用下载的升级文件进行升级;升级检查模块,用于检查是否升级成功,如果升级成功则将写入本地文件的日志数据发送到数据服务器,并从记录的进度点开始收集日志数据,以升级后的版本开始工作,否则回退到升级前的版本进行工作。
本实施例日志收集客户端启动后,创建有守护进程和工作进程,以下分别阐述各模块在升级过程中所做的操作。
心跳请求模块在向配置服务器发送心跳请求时,执行如下操作:
工作进程定期向配置服务器发送心跳请求,所述心跳请求中携带当前日志收集客户端的版本号和宿主机的IP地址,以便配置服务器在没有升级API请求的情况下发送空的心跳请求响应,在有升级API请求的情况下发送携带升级指令的心跳请求响应,所述升级指令包括待升级日志收集客户端的版本号及其下载地址。
本实施例中,升级响应模块在采用下载的升级文件进行升级之前,还执行如下操作:
工作进程向守护进程发出通知升级操作的信号SIGUSR1。
本实施例中,升级响应模块在采用下载的升级文件进行升级时,执行如下操作:
守护进程接收SIGUSR1信号后设置全局状态为DAEMON_UPDATE;
守护进程在守护循环中检测到当前全局状态为DAEMON_UPDATE时,采用下载的升级文件进行升级;
守护进程发送SIGKILL信号给工作进程,工作进程退出。
本实施例中,升级响应模块在采用下载的升级文件进行升级时,还执行如下操作:
执行升级后的日志收集客户端程序,创建新版本下的守护进程和工作进程;
新版本下的守护进程周期循环检测全局状态;
如果新版本下的工作进程启动后异常退出,导致全局状态变为DAEMON_UPDATE_FAIL,则发送通知信号SIGUSR2给原版本下的守护进程,附上启动失败消息;
若发现状态保持为DAEMON_INIT,循环周期内新版本下的工作进程未有异常发生,则发送通知信号SIGUSR2和启动成功消息给原版本下的守护进程。
本实施例中,升级检查模块在检查是否升级成功时,执行如下操作:
原版本下的守护进程周期循环检查来自新版本下的守护进程的通知信号SIGUSR2;
若在循环周期内没有来自新版本下的守护进程的SIGUSR2,原版本下的守护进程认为启动新版本超时并向新版本下的守护进程所在进程组发送SIGKILL命令,结束新程序的运行,随后原版本下的守护进程重新启动工作进程并回退至升级前状态;
若在循环周期内收到来自新版本下的守护进程的SIGUSR2信号并得到启动失败消息,则原版本下的守护进程向新版本下的守护进程所在进程组发送SIGKILL命令,结束新程序的运行,随后原版本下的守护进程重新启动工作进程并回退至升级前状态;
若在循环周期内收到来自新版本下的守护进程的SIGUSR2信号且得到启动成功消息,则原版本下的守护进程退出,升级成功。
以上实施例仅用以说明本发明的技术方案而非对其进行限制,在不背离本发明精神及其实质的情况下,熟悉本领域的技术人员当可根据本发明作出各种相应的改变和变形,但这些相应的改变和变形都应属于本发明所附的权利要求的保护范围。

Claims (14)

  1. 一种日志收集客户端升级方法,应用于日志收集客户端,其特征在于,所述方法包括:
    向配置服务器发送心跳请求,接收配置服务器返回的心跳请求响应;
    根据心跳请求响应中携带的升级指令,下载升级文件并暂停发送心跳请求,并停止收集新的日志数据,将已经收集但未完成发送的日志数据写入本地文件,记录当前进度点,采用下载的升级文件进行升级;
    检查是否升级成功,如果升级成功则将写入本地文件的日志数据发送到数据服务器,并从记录的进度点开始收集日志数据,以升级后的版本开始工作,否则回退到升级前的版本进行工作。
  2. 根据权利要求1所述的日志收集客户端升级方法,其特征在于,所述日志收集客户端启动后,创建有守护进程和工作进程,所述向配置服务器发送心跳请求,包括:
    工作进程定期向配置服务器发送心跳请求,所述心跳请求中携带当前日志收集客户端的版本号和宿主机的IP地址,以便配置服务器在没有升级API请求的情况下发送空的心跳请求响应,在有升级API请求的情况下发送携带升级指令的心跳请求响应,所述升级指令包括待升级日志收集客户端的版本号及其下载地址。
  3. 根据权利要求2所述的日志收集客户端升级方法,其特征在于,所述日志收集客户端升级方法在采用下载的升级文件进行升级之前,还包括:
    所述工作进程向守护进程发出通知升级操作的信号SIGUSR1。
  4. 根据权利要求3所述的日志收集客户端升级方法,其特征在于,所述守护进程具有如下全局状态:
    A、DAEMON_INIT,守护进程准备执行初始化工作;
    B、DAEMON_INIT_FAIL,守护进程初始化执行失败;
    C、DAEMON_NORMAL,守护进程初始化执行成功,并开始守护工作;
    D、DAEMON_UPDATE,守护进程准备执行程序升级工作;
    E、DAEMON_UPDATE_FAIL,守护进程执行程序升级工作失败。
  5. 根据权利要求4所述的日志收集客户端升级方法,其特征在于,所述采用下载的升级文件进行升级,包括:
    守护进程接收SIGUSR1信号后设置全局状态为DAEMON_UPDATE;
    守护进程在守护循环中检测到当前全局状态为DAEMON_UPDATE时,采用下载 的升级文件进行升级;
    守护进程发送SIGKILL信号给工作进程,工作进程退出。
  6. 根据权利要求5所述的日志收集客户端升级方法,其特征在于,所述采用下载的升级文件进行升级,还包括步骤:
    执行升级后的日志收集客户端程序,创建新版本下的守护进程和工作进程;
    新版本下的守护进程周期循环检测全局状态;
    如果新版本下的工作进程启动后异常退出,导致全局状态变为DAEMON_UPDATE_FAIL,则发送通知信号SIGUSR2给原版本下的守护进程,附上启动失败消息;
    若发现状态保持为DAEMON_INIT,循环周期内新版本下的工作进程未有异常发生,则发送通知信号SIGUSR2和启动成功消息给原版本下的守护进程。
  7. 根据权利要求6所述的日志收集客户端升级方法,其特征在于,所述检查是否升级成功,包括:
    原版本下的守护进程周期循环检查来自新版本下的守护进程的通知信号SIGUSR2;
    若在循环周期内没有来自新版本下的守护进程的SIGUSR2,原版本下的守护进程认为启动新版本超时并向新版本下的守护进程所在进程组发送SIGKILL命令,结束新程序的运行,随后原版本下的守护进程重新启动工作进程并回退至升级前状态;
    若在循环周期内收到来自新版本下的守护进程的SIGUSR2信号并得到启动失败消息,则原版本下的守护进程向新版本下的守护进程所在进程组发送SIGKILL命令,结束新程序的运行,随后原版本下的守护进程重新启动工作进程并回退至升级前状态;
    若在循环周期内收到来自新版本下的守护进程的SIGUSR2信号且得到启动成功消息,则原版本下的守护进程退出,升级成功。
  8. 一种日志收集客户端,其特征在于,所述日志收集客户端包括:
    心跳请求模块,用于向配置服务器发送心跳请求,接收配置服务器返回的心跳请求响应;
    升级响应模块,用于根据心跳请求响应中携带的升级指令,下载升级文件并暂停发送心跳请求并停止收集新的日志数据,将已经收集但未完成发送的日志数据写入本地文件,记录当前进度点,采用下载的升级文件进行升级;
    升级检查模块,用于检查是否升级成功,如果升级成功则将写入本地文件的日志数据发送到数据服务器,并从记录的进度点开始收集日志数据,以升级后的版本开始工作, 否则回退到升级前的版本进行工作。
  9. 根据权利要求8所述的日志收集客户端,其特征在于,所述日志收集客户端启动后,创建有守护进程和工作进程,所述心跳请求模块在向配置服务器发送心跳请求时,执行如下操作:
    工作进程定期向配置服务器发送心跳请求,所述心跳请求中携带当前日志收集客户端的版本号和宿主机的IP地址,以便配置服务器在没有升级API请求的情况下发送空的心跳请求响应,在有升级API请求的情况下发送携带升级指令的心跳请求响应,所述升级指令包括待升级日志收集客户端的版本号及其下载地址。
  10. 根据权利要求9所述的日志收集客户端,其特征在于,所述升级响应模块在采用下载的升级文件进行升级之前,还执行如下操作:
    所述工作进程向守护进程发出通知升级操作的信号SIGUSR1。
  11. 根据权利要求10所述的日志收集客户端,其特征在于,所述守护进程具有如下全局状态:
    A、DAEMON_INIT,守护进程准备执行初始化工作;
    B、DAEMON_INIT_FAIL,守护进程初始化执行失败;
    C、DAEMON_NORMAL,守护进程初始化执行成功,并开始守护工作;
    D、DAEMON_UPDATE,守护进程准备执行程序升级工作;
    E、DAEMON_UPDATE_FAIL,守护进程执行程序升级工作失败。
  12. 根据权利要求11所述的日志收集客户端,其特征在于,所述升级响应模块在采用下载的升级文件进行升级时,执行如下操作:
    守护进程接收SIGUSR1信号后设置全局状态为DAEMON_UPDATE;
    守护进程在守护循环中检测到当前全局状态为DAEMON_UPDATE时,采用下载的升级文件进行升级;
    守护进程发送SIGKILL信号给工作进程,工作进程退出。
  13. 根据权利要求12所述的日志收集客户端,其特征在于,所述升级响应模块在采用下载的升级文件进行升级时,还执行如下操作:
    执行升级后的日志收集客户端程序,创建新版本下的守护进程和工作进程;
    新版本下的守护进程周期循环检测全局状态;
    如果新版本下的工作进程启动后异常退出,导致全局状态变为DAEMON_UPDATE_FAIL,则发送通知信号SIGUSR2给原版本下的守护进程,附上启 动失败消息;
    若发现状态保持为DAEMON_INIT,循环周期内新版本下的工作进程未有异常发生,则发送通知信号SIGUSR2和启动成功消息给原版本下的守护进程。
  14. 根据权利要求13所述的日志收集客户端,其特征在于,所述升级检查模块在检查是否升级成功时,执行如下操作:
    原版本下的守护进程周期循环检查来自新版本下的守护进程的通知信号SIGUSR2;
    若在循环周期内没有来自新版本下的守护进程的SIGUSR2,原版本下的守护进程认为启动新版本超时并向新版本下的守护进程所在进程组发送SIGKILL命令,结束新程序的运行,随后原版本下的守护进程重新启动工作进程并回退至升级前状态;
    若在循环周期内收到来自新版本下的守护进程的SIGUSR2信号并得到启动失败消息,则原版本下的守护进程向新版本下的守护进程所在进程组发送SIGKILL命令,结束新程序的运行,随后原版本下的守护进程重新启动工作进程并回退至升级前状态;
    若在循环周期内收到来自新版本下的守护进程的SIGUSR2信号且得到启动成功消息,则原版本下的守护进程退出,升级成功。
PCT/CN2016/112854 2016-01-08 2016-12-29 一种日志收集客户端及其升级方法 WO2017118334A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610011466.0 2016-01-08
CN201610011466.0A CN106959866B (zh) 2016-01-08 2016-01-08 一种日志收集客户端及其升级方法

Publications (1)

Publication Number Publication Date
WO2017118334A1 true WO2017118334A1 (zh) 2017-07-13

Family

ID=59274159

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/112854 WO2017118334A1 (zh) 2016-01-08 2016-12-29 一种日志收集客户端及其升级方法

Country Status (2)

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

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110045971A (zh) * 2018-01-16 2019-07-23 浙江宇视科技有限公司 系统升级恢复方法及装置
CN110879713A (zh) * 2018-09-06 2020-03-13 山东华软金盾软件股份有限公司 一种android端强加密插件热更新管理方法
CN111061499A (zh) * 2019-12-31 2020-04-24 上海赫千电子科技有限公司 一种基于文件系统的ecu更新方法及系统
CN111124465A (zh) * 2019-11-28 2020-05-08 武汉虹信技术服务有限责任公司 一种跨网络c/s程序远程升级方法及系统
CN111385296A (zh) * 2020-03-04 2020-07-07 深信服科技股份有限公司 一种业务进程重启方法、装置、存储介质以及系统
CN112181443A (zh) * 2019-07-01 2021-01-05 中国移动通信集团浙江有限公司 服务的自动化部署方法、装置及电子设备
CN113329044A (zh) * 2020-02-28 2021-08-31 北京京东振世信息技术有限公司 一种监控代理程序的升级方法和升级装置
CN114584464A (zh) * 2022-03-07 2022-06-03 浪潮云信息技术股份公司 一种云平台全自动管理日志采集方法及终端
CN115509559A (zh) * 2022-09-30 2022-12-23 广州朗桥维视通信技术有限公司 一种零接触部署系统及方法
CN115576792A (zh) * 2022-11-24 2023-01-06 北京宝兰德软件股份有限公司 日志采集系统及方法

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108363610A (zh) * 2018-02-09 2018-08-03 华为技术有限公司 一种虚拟机监控插件的控制方法及设备
CN109257218B (zh) * 2018-09-19 2021-08-06 上海电子信息职业技术学院 一种基于snmp协议网络系统孤岛自愈方法
CN109361542B (zh) * 2018-10-29 2021-10-15 北京奇艺世纪科技有限公司 客户端的故障处理方法、装置、系统、终端和服务器
CN109542750A (zh) * 2018-11-26 2019-03-29 深圳天源迪科信息技术股份有限公司 分布式日志系统
CN113329046A (zh) * 2020-02-28 2021-08-31 珠海格力电器股份有限公司 数据传输方法、系统以及存储介质
CN111596940B (zh) * 2020-05-19 2023-04-07 杭州视联动力技术有限公司 一种版本升级方法、装置、电子设备及存储介质
CN112596941B (zh) * 2020-12-28 2023-10-03 凌云光技术股份有限公司 一种工业图像处理软件的工具结果判定方法及装置
CN112905230A (zh) * 2021-03-16 2021-06-04 深圳市麦谷科技有限公司 应用程序的管理方法、装置、终端设备和存储介质
CN117056288A (zh) * 2023-08-17 2023-11-14 齐鲁空天信息研究院 一种服务器文件检索下载方法和系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1517863A (zh) * 2003-01-15 2004-08-04 联想(北京)有限公司 无盘工作站自动升级方法
CN101719165A (zh) * 2010-01-12 2010-06-02 山东高效能服务器和存储研究院 一种实现数据库高效快速备份的方法
CN103677870A (zh) * 2012-09-10 2014-03-26 腾讯科技(深圳)有限公司 系统升级方法及采用该方法升级的系统
CN105187262A (zh) * 2015-10-27 2015-12-23 上海斐讯数据通信技术有限公司 一种路由器升级方法及系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100583782C (zh) * 2007-10-23 2010-01-20 华为技术有限公司 软件升级方法和装置
CN103064860A (zh) * 2011-10-21 2013-04-24 阿里巴巴集团控股有限公司 数据库高可用实现方法及其装置
US8935689B2 (en) * 2012-08-13 2015-01-13 International Business Machines Corporation Concurrent embedded application update and migration

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1517863A (zh) * 2003-01-15 2004-08-04 联想(北京)有限公司 无盘工作站自动升级方法
CN101719165A (zh) * 2010-01-12 2010-06-02 山东高效能服务器和存储研究院 一种实现数据库高效快速备份的方法
CN103677870A (zh) * 2012-09-10 2014-03-26 腾讯科技(深圳)有限公司 系统升级方法及采用该方法升级的系统
CN105187262A (zh) * 2015-10-27 2015-12-23 上海斐讯数据通信技术有限公司 一种路由器升级方法及系统

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110045971B (zh) * 2018-01-16 2023-03-24 浙江宇视科技有限公司 系统升级恢复方法及装置
CN110045971A (zh) * 2018-01-16 2019-07-23 浙江宇视科技有限公司 系统升级恢复方法及装置
CN110879713A (zh) * 2018-09-06 2020-03-13 山东华软金盾软件股份有限公司 一种android端强加密插件热更新管理方法
CN110879713B (zh) * 2018-09-06 2023-06-20 山东华软金盾软件股份有限公司 一种android端强加密插件热更新管理方法
CN112181443A (zh) * 2019-07-01 2021-01-05 中国移动通信集团浙江有限公司 服务的自动化部署方法、装置及电子设备
CN112181443B (zh) * 2019-07-01 2023-04-07 中国移动通信集团浙江有限公司 服务的自动化部署方法、装置及电子设备
CN111124465A (zh) * 2019-11-28 2020-05-08 武汉虹信技术服务有限责任公司 一种跨网络c/s程序远程升级方法及系统
CN111124465B (zh) * 2019-11-28 2023-06-20 武汉虹信技术服务有限责任公司 一种跨网络c/s程序远程升级方法及系统
CN111061499A (zh) * 2019-12-31 2020-04-24 上海赫千电子科技有限公司 一种基于文件系统的ecu更新方法及系统
CN111061499B (zh) * 2019-12-31 2023-06-13 上海赫千电子科技有限公司 一种基于文件系统的ecu更新方法及系统
CN113329044A (zh) * 2020-02-28 2021-08-31 北京京东振世信息技术有限公司 一种监控代理程序的升级方法和升级装置
CN111385296A (zh) * 2020-03-04 2020-07-07 深信服科技股份有限公司 一种业务进程重启方法、装置、存储介质以及系统
CN111385296B (zh) * 2020-03-04 2022-06-21 深信服科技股份有限公司 一种业务进程重启方法、装置、存储介质以及系统
CN114584464A (zh) * 2022-03-07 2022-06-03 浪潮云信息技术股份公司 一种云平台全自动管理日志采集方法及终端
CN115509559A (zh) * 2022-09-30 2022-12-23 广州朗桥维视通信技术有限公司 一种零接触部署系统及方法
CN115509559B (zh) * 2022-09-30 2023-09-01 广州朗桥维视通信技术有限公司 一种零接触部署系统及方法
CN115576792A (zh) * 2022-11-24 2023-01-06 北京宝兰德软件股份有限公司 日志采集系统及方法

Also Published As

Publication number Publication date
CN106959866A (zh) 2017-07-18
CN106959866B (zh) 2020-12-01

Similar Documents

Publication Publication Date Title
WO2017118334A1 (zh) 一种日志收集客户端及其升级方法
US8146060B2 (en) Data processing system and method for execution of a test routine in connection with an operating system
US10642599B1 (en) Preemptive deployment in software deployment pipelines
KR102268355B1 (ko) 클라우드 배치 기반구조 검증 엔진
KR102047216B1 (ko) 서비스의 2차 위치에서의 작업의 재생 기법
US9485151B2 (en) Centralized system management on endpoints of a distributed data processing system
US10019250B2 (en) Forcibly completing upgrade of distributed software in presence of failures
JP5579650B2 (ja) 監視対象プロセスを実行する装置及び方法
US10379922B1 (en) Error recovery in a virtual machine-based development environment
CN110895484A (zh) 任务调度方法及装置
CN110895487B (zh) 分布式任务调度系统
CN110895488B (zh) 任务调度方法及装置
CN110895486B (zh) 分布式任务调度系统
CN110895483A (zh) 任务恢复方法及装置
KR20040047209A (ko) 네트워크 상의 컴퓨터 시스템의 자동 복구 방법 및 이를구현하기 위한 컴퓨터 시스템의 자동 복구 시스템
WO2017124799A1 (zh) 固件管理方法和装置
US7392149B2 (en) Automatic software testing
TW200426571A (en) Policy-based response to system errors occurring during os runtime
CN111090546B (zh) 一种操作系统重启方法、装置、设备及可读存储介质
JP4560074B2 (ja) 仮想計算機システム及び同システムにおける仮想計算機復元方法
TWI740886B (zh) 日誌收集客戶端及其升級方法
US8826264B1 (en) Non-disruptive upgrade of applications
CN112948008B (zh) 一种基于Ironic管理物理裸机的方法
CN110895485A (zh) 任务调度系统
WO2016131294A1 (zh) 版本升级处理方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16883459

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16883459

Country of ref document: EP

Kind code of ref document: A1