CN112099928A - Recovery method, system and medium for accidental stop of Maxwell process - Google Patents
Recovery method, system and medium for accidental stop of Maxwell process Download PDFInfo
- Publication number
- CN112099928A CN112099928A CN202010887218.9A CN202010887218A CN112099928A CN 112099928 A CN112099928 A CN 112099928A CN 202010887218 A CN202010887218 A CN 202010887218A CN 112099928 A CN112099928 A CN 112099928A
- Authority
- CN
- China
- Prior art keywords
- maxwell
- python script
- restarted
- enterprise wechat
- restarting
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/04—Real-time or near real-time messaging, e.g. instant messaging [IM]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/133—Protocols for remote procedure calls [RPC]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a method, a system and a medium for recovering accidental stop of a Maxwell process, which comprise the following steps: python script calling step: a timer is used on a linux server, and a python script is called according to preset time to monitor the Maxwell process; and (3) a Maxwell process restarting step: and when the python script monitors the Maxwell process, judging whether the process exists or not by using a linux command according to the return value, if not, restarting the Maxwell process by using the linux command, and alarming. The method monitors the Maxwell process through the python script and restarts the Maxwell process, so that the problem that the service environment is influenced by unexpected stop of the Maxwell process is solved; the enterprise Wechat gives an alarm and can inform related personnel of problem handling in time.
Description
Technical Field
The invention relates to the technical field of data communication, in particular to a method, a system and a medium for recovering Maxwell process unexpected stop.
Background
The Maxwell daemon reads the binary log of MySQL and writes the update operation into the Kafka message queue. In actual application, a process is often stopped unexpectedly, because Maxwell is often delayed due to the kafka connection problem, and the problem exists all the time, a certain influence on the service occurs in an actual application scene, and a small loss may be brought seriously.
Patent document CN110275927A (application number: 201910559607.6) discloses a streaming real-time data synchronization system based on MySQL, which relates to the technical field of data communication; MySQL records data update in real time by using binlog, a Maxwell tool analyzes real-time data of MySQL binlog, the real-time data is synchronized into Kafka, the Kafka synchronizes the real-time data into ElasticSearch by using KafkaConntor, and the ElasticSearch carries out data analysis and monitoring on the real-time data.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a recovery method, a system and a medium for accidental stopping of a Maxwell process.
The recovery method for unexpected stop of Maxwell process provided by the invention comprises the following steps:
python script calling step: a timer is used on a linux server, and a python script is called according to preset time to monitor the Maxwell process;
and (3) a Maxwell process restarting step: when the python script monitors the Maxwell process, judging whether the process exists or not by using a linux command according to a return value, and if so, not performing any operation; if the current state does not exist, restarting the Maxwell process through a linux command;
an alarming step: and when the python script monitors that the Maxwell process does not exist, alarming.
Preferably, the python script is invoked to listen to the Maxwell process every 5 seconds.
Preferably, the enterprise WeChat is used for alarming and informing related personnel, and after the Maxwell process is restarted successfully, the enterprise WeChat is used for informing that the Maxwell process is restarted normally.
Preferably, after the Maxwell process is restarted, the Maxwell process is restarted through the enterprise WeChat until the Maxwell process is restarted successfully.
The recovery system for unexpected stop of Maxwell process provided by the invention comprises the following steps:
the python script calls the module: a timer is used on a linux server, and a python script is called according to preset time to monitor the Maxwell process;
and the Maxwell process restarting module: when the python script monitors the Maxwell process, judging whether the process exists or not by using a linux command according to a return value, and if so, not performing any operation; if the current state does not exist, restarting the Maxwell process through a linux command;
an alarm module: and when the python script monitors that the Maxwell process does not exist, alarming.
Preferably, the python script is invoked to listen to the Maxwell process every 5 seconds.
Preferably, the enterprise WeChat is used for alarming and informing related personnel, and after the Maxwell process is restarted successfully, the enterprise WeChat is used for informing that the Maxwell process is restarted normally.
Preferably, after the Maxwell process is restarted, the Maxwell process is restarted through the enterprise WeChat until the Maxwell process is restarted successfully.
According to the present invention, a computer-readable storage medium is provided, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the method as described above.
Compared with the prior art, the invention has the following beneficial effects:
1. the method and the device have the advantages that the problems that the Maxwell process influences the service environment due to unexpected stop are solved by monitoring the Maxwell process and restarting through the python script;
2. the invention solves the problem that the Maxwell process cannot be informed to relevant personnel for processing due to unexpected stop by adopting an enterprise WeChat alarm mode.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
Example (b):
as shown in fig. 1, the method for recovering unexpected halt of Maxwell process provided by the present invention includes:
invoking a python script step: a timer is used on a linux server, and the python script is called every 5s, so that the process problem is guaranteed to be inquired in the second level, and the Maxwell process is monitored by using a python script program anytime and anywhere;
and restarting the Maxwell step: when monitoring the Maxwell process, the python script judges whether the process still exists according to the return value by using a linux command, and if so, no operation is performed; if the process does not exist, restarting the process of the Maxwell by the linux command;
enterprise WeChat alarm step: when the situation that the Maxwell process does not exist is monitored, an alarm function of the enterprise WeChat is defined in the python script, related personnel are informed, and after the process is restarted successfully, the process is informed of normal restart on the enterprise WeChat.
Judging the process and selecting the restarting key point in terms of time, if the time is short, the next process monitoring script runs, and the process is restarted twice; if the time is too long, the purpose of recovering the process as soon as possible cannot be achieved, and the data is untimely.
And (4) carrying out a plurality of tests, wherein the restart time of the process is set to be about 5s within a certain range, so that the two problems can be solved.
The recovery system for unexpected stop of Maxwell process provided by the invention comprises the following steps:
the python script calls the module: a timer is used on a linux server, and a python script is called according to preset time to monitor the Maxwell process;
and the Maxwell process restarting module: when the python script monitors the Maxwell process, judging whether the process exists or not by using a linux command according to a return value, and if so, not performing any operation; if the current state does not exist, restarting the Maxwell process through a linux command;
an alarm module: and when the python script monitors that the Maxwell process does not exist, alarming.
Preferably, the python script is invoked to listen to the Maxwell process every 5 seconds.
Preferably, the enterprise WeChat is used for alarming and informing related personnel, and after the Maxwell process is restarted successfully, the enterprise WeChat is used for informing that the Maxwell process is restarted normally.
Preferably, after the Maxwell process is restarted, the Maxwell process is restarted through the enterprise WeChat until the Maxwell process is restarted successfully.
According to the present invention, a computer-readable storage medium is provided, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the method as described above.
Those skilled in the art will appreciate that, in addition to implementing the systems, apparatus, and various modules thereof provided by the present invention in purely computer readable program code, the same procedures can be implemented entirely by logically programming method steps such that the systems, apparatus, and various modules thereof are provided in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Therefore, the system, the device and the modules thereof provided by the present invention can be considered as a hardware component, and the modules included in the system, the device and the modules thereof for implementing various programs can also be considered as structures in the hardware component; modules for performing various functions may also be considered to be both software programs for performing the methods and structures within hardware components.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.
Claims (9)
1. A recovery method for unexpected stop of Maxwell process is characterized by comprising the following steps:
python script calling step: a timer is used on a linux server, and a python script is called according to preset time to monitor the Maxwell process;
and (3) a Maxwell process restarting step: when the python script monitors the Maxwell process, judging whether the process exists or not by using a linux command according to a return value, and if so, not performing any operation; if the current state does not exist, restarting the Maxwell process through a linux command;
an alarming step: and when the python script monitors that the Maxwell process does not exist, alarming.
2. A recovery method for unexpected stop of Maxwell process as claimed in claim 1, characterized in that the python script is invoked to listen to Maxwell process every 5 seconds.
3. The method for recovering the unexpected stop of the Maxwell process as claimed in claim 1, wherein the method comprises the steps of alarming through enterprise WeChat, informing relevant personnel, and informing that the Maxwell process is restarted normally through the enterprise WeChat after the Maxwell process is restarted successfully.
4. The method for recovering the unexpected halt of the Maxwell process as claimed in claim 3, wherein after the Maxwell process is unsuccessfully restarted, the alarm is given again through enterprise WeChat, and the Maxwell process is continuously restarted until the restart is successful.
5. A recovery system for unexpected stoppage of Maxwell processes, comprising:
the python script calls the module: a timer is used on a linux server, and a python script is called according to preset time to monitor the Maxwell process;
and the Maxwell process restarting module: when the python script monitors the Maxwell process, judging whether the process exists or not by using a linux command according to a return value, and if so, not performing any operation; if the current state does not exist, restarting the Maxwell process through a linux command;
an alarm module: and when the python script monitors that the Maxwell process does not exist, alarming.
6. The recovery system for unexpected stop of Maxwell process according to claim 5, wherein the python script is invoked to listen to Maxwell process every 5 seconds.
7. The recovery system for the unexpected stop of the Maxwell process as claimed in claim 5, wherein the warning is performed by the enterprise WeChat to notify the relevant personnel, and after the Maxwell process is restarted successfully, the warning is performed by the enterprise WeChat that the Maxwell process is restarted normally.
8. The recovery system for the unexpected stop of the Maxwell process as claimed in claim 5, wherein after the Maxwell process is restarted, the alarm is given again through the enterprise WeChat, and the Maxwell process is restarted continuously until the restart is successful.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010887218.9A CN112099928A (en) | 2020-08-28 | 2020-08-28 | Recovery method, system and medium for accidental stop of Maxwell process |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010887218.9A CN112099928A (en) | 2020-08-28 | 2020-08-28 | Recovery method, system and medium for accidental stop of Maxwell process |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112099928A true CN112099928A (en) | 2020-12-18 |
Family
ID=73758328
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010887218.9A Pending CN112099928A (en) | 2020-08-28 | 2020-08-28 | Recovery method, system and medium for accidental stop of Maxwell process |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112099928A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6948153B2 (en) * | 2001-11-13 | 2005-09-20 | Prometric | Method and system for computer based testing using an amalgamated resource file |
CN101969391A (en) * | 2010-10-27 | 2011-02-09 | 北京邮电大学 | Cloud platform supporting fusion network service and operating method thereof |
CN110134518A (en) * | 2019-05-21 | 2019-08-16 | 浪潮软件集团有限公司 | A kind of method and system improving big data cluster multinode high application availability |
CN110275927A (en) * | 2019-06-26 | 2019-09-24 | 浪潮卓数大数据产业发展有限公司 | A kind of streaming real-time data synchronization system based on MySQL |
CN111131815A (en) * | 2019-12-18 | 2020-05-08 | 苏宁智能终端有限公司 | Smart television performance monitoring and abnormal process processing method and device |
CN111400057A (en) * | 2020-02-27 | 2020-07-10 | 苏州浪潮智能科技有限公司 | Method, device and medium for remotely controlling test process |
-
2020
- 2020-08-28 CN CN202010887218.9A patent/CN112099928A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6948153B2 (en) * | 2001-11-13 | 2005-09-20 | Prometric | Method and system for computer based testing using an amalgamated resource file |
CN101969391A (en) * | 2010-10-27 | 2011-02-09 | 北京邮电大学 | Cloud platform supporting fusion network service and operating method thereof |
CN110134518A (en) * | 2019-05-21 | 2019-08-16 | 浪潮软件集团有限公司 | A kind of method and system improving big data cluster multinode high application availability |
CN110275927A (en) * | 2019-06-26 | 2019-09-24 | 浪潮卓数大数据产业发展有限公司 | A kind of streaming real-time data synchronization system based on MySQL |
CN111131815A (en) * | 2019-12-18 | 2020-05-08 | 苏宁智能终端有限公司 | Smart television performance monitoring and abnormal process processing method and device |
CN111400057A (en) * | 2020-02-27 | 2020-07-10 | 苏州浪潮智能科技有限公司 | Method, device and medium for remotely controlling test process |
Non-Patent Citations (3)
Title |
---|
DIANJU3162: "《小记------通过脚本监控、及重新运行其他脚本保证脚本正常运行》", 《HTTPS://BLOG.CSDN.NET/DIANJU3162/ARTICLE/DETAILS/101460886》 * |
GADDWEI: "《ds-platform》", 《HTTPS://GITHUB.COM/GADDWEI/DS-PLATFORM》 * |
NBBGOT: "《解决maxwell宕机问题》", 《HTTPS://BLOG.CSDN.NET/QQ_31947831/ARTICLE/DETAILS/105976519》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9720761B2 (en) | System fault detection and processing method, device, and computer readable storage medium | |
CN107515796B (en) | Equipment abnormity monitoring processing method and device | |
CN108710544B (en) | Process monitoring method of database system and rail transit comprehensive monitoring system | |
CN107491346B (en) | Application task processing method, device and system | |
CN107480014B (en) | High-availability equipment switching method and device | |
CN111224818B (en) | Road side unit alarming method and device, electronic equipment and storage medium | |
US20190036762A1 (en) | Exception monitoring and alarming method and apparatus | |
CN103401698A (en) | Monitoring system used for alarming server status in server cluster operation | |
CN111526049B (en) | Operation and maintenance system, operation and maintenance method, electronic device and storage medium | |
CN100395722C (en) | Method for preserving abnormal state information of control system | |
CN107423620B (en) | Management method and device for storage server service process | |
CN114675998A (en) | Method, device, equipment and medium for monitoring timed snapshot task | |
CN112099928A (en) | Recovery method, system and medium for accidental stop of Maxwell process | |
CN111371642B (en) | Network card fault detection method, device, equipment and storage medium | |
CN111813592A (en) | Method and device for optimizing system fault recovery plan and computer storage medium | |
CN117149482A (en) | Method and device for detecting thread state, electronic equipment and medium | |
JP2006065440A (en) | Process management system | |
CN105391575B (en) | A kind of national treasury control method and system | |
CN104346233A (en) | Fault recovery method and device for computer system | |
CN105677515A (en) | Online backup method and system for database | |
CN107797915B (en) | Fault repairing method, device and system | |
CN110968486A (en) | Script running method and device | |
CN116541312B (en) | Continuous integration test method and system for automobile software | |
CN108959038A (en) | A kind of method and device of distributed application services monitoring | |
CN113094280B (en) | Upgrade method, system, and readable storage medium |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20201218 |