In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you about how to achieve the system error alarm function in Gearman, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
What is Gearman?
Gearman is a system used to delegate work to other machines, distributed calls are more suitable for machines to do some work, do some work concurrently to do load balancing among multiple calls, or be used to call functions in other languages.
How Gearman works
Client (client): create a Job.
Server (service): find the appropriate Worker and give the Job to Worker.
Worker (worker): execute Job.
Scenarios commonly used in Web.
Crop the picture to generate a thumbnail.
File distribution (multiple servers distribute files uploaded by users).
Video transcoding (transcoding storage for uploaded videos).
System alarm (when there is a problem with the system, notify the relevant person as soon as possible).
This article mainly explains the alarm scenario of the system.
In the process of developing a system, programs often have problems of one kind or another.
We need to get the error question as soon as possible, notify the SMS and email to the relevant personnel.
Because, the sending of text messages and emails is time-consuming, and when the quantity of sending is large, there will be a delay phenomenon.
Therefore, Gearman is used to send SMS and email asynchronously.
Two ways to install Gearman
Method 1: the official website recommends the installation method
Official website address: http://gearman.org/getting-started/
Yum install gearmand
Method 2: custom installation
Install libevent:
Wget get https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gztar zxvf libevent-2.0.22-stable.tar.gz./configure-- prefix=/usrmake & & make install
Install Gearman server and library:
Wget get https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gztar zxvf gearmand-1.1.12.tar.gzcd gearmand-1.1.12./configure if error: configure: error: could not find boostyum install-y boost boost-devel if error: configure: error: could not find gperfyum install gperf if error: configure: error: Unable to find libuuidyum install libuuid-develmake & & make install is installed successfully, execute gearmand- V to query the version number. Gearmand-d starts the service. Warm reminder: for reference only, if you encounter unpredictable problems, please Google.
Install Gearman PHP extension:
Wget get http://pecl.php.net/get/gearman-1.1.2.tgztar zxvf gearman-1.1.2.tgzcd gearman-1.1.2/usr/local/php/bin/phpize./configure-- with-php-config=/usr/local/php/bin/php-config-- with-gearman if wrong: configure: error: Please install libgearmanyum install-y libgearman-devel.x86_64
Case (system alarm)
Start the service
Gearmand-d
Execute Worker
Php worker.php
Client.php
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.