Using Gearman across environments.
跨环境使用gearman。
Deploying Gearman in dynamic environments.
在动态环境中部署gearman。
Listing 1 shows a Gearman worker written in PHP.
清单1给出了用PHP编写的一个Gearmanworker。
The Gearman daemon is commonly installed in /usr/sbin.
这个Gearman守护程序通常被安装在 /usr/sbin。
Gearman is a nascent but capable work-distribution system.
Gearman是一个刚刚起步却很有实力的工作分发系统。
Let's have a look at some more examples of Gearman deployments.
下面我们来看其他一些Gearman部署的例子。
As mentioned earlier, a Gearman configuration has three kinds of actors.
我们前面提到过,一个Gearman配置有三个角色。
uses Gearman across 60 or more servers to process 6 million jobs per day.
在60或更多的服务器上使用Gearman每天处理 600 万个作业。
The Gearman library for PHP distributes work among a collection of machines.
PHP的Gearman库能把工作分发给一组机器。
Thus, if the Gearman daemon fails, it can recreate the work queue on restart.
这样一来,如果Gearman守护程序故障,它就可以在重启后重新创建这个工作队列。
Gearman doesn't do any form of translation or manipulation of the data exchanged.
Gearman不进行所交换数据的任何转换或操作。
So far, you have looked at ways of using Gearman where you want or need an immediate response.
到目前为止,已经了解在想要或需要即时响应的时候使用Gearman的方式。
For the former, the Gearman work queue remains in memory but is backed by a relational database.
对于前者,Gearman工作队列保存在内存并在一个关系型数据库内存有备份。
News aggregator Digg has built a Gearman network of similar size to crunch 400,000 jobs per day.
新闻聚合器Digg也已构建了一个相同规模的Gearman网络,每天可处理400,000个作业。
You create a Gearman Client object, specify the servers, and call the task that you want to perform.
您创建一个GearmanClient对象,指定服务器,调用您想要执行的任务。
To run the other script, all you need are the Gearman libraries, script modules, and the script itself.
要运行另外的脚本,您所需要的只有gearman库、脚本模块和脚本本身。
To track the Gearman project, subscribe to its Google group, or visit its IRC channel, #gearman, on Freenode.
为了跟踪这个Gearman项目,可以订阅它的Google组,或访问 Freenode上它的IRC频道 #gearman。
Gearman queues jobs and doles out assignments, distributing onerous tasks to machines set aside for the task.
Gearman会对作业进行排队并少量分派作业,而将那些复杂的任务分发给为此任务预留的机器。
The easiest way to see how Gearman works is to try a simple application that makes use of the Gearman service.
了解Gearman如何工作最容易的方式是,尝试一个使用 Gearman 服务的简单应用程序。
You have a standard Gearman environment using your standard group of workers serving the needs of your clients.
您具有一个标准的Gearman环境,使用标准工人组来满足客户机的需求。
All that's needed to add workers to the Gearman system is for the worker script to be executed during boot time.
将工人添加到Gearman系统所需要做的就是让工人脚本在引导时间执行。
If the version number matches that of the Gearman library you built and installed previously, your system is ready.
如果这个版本号与之前构建和安装的gearman库的版本号相匹配,那么系统就已准备好了。
You can generate a request with gearman, too. Again, use the -f option to spell out which service you want help from
也可以用gearman生成一个请求。
Using Gearman from PHP is similar to the previous example, except that you create the producer and consumer actors in PHP.
从PHP使用Gearman类似于之前的示例,惟一的区别在于这里是在php内创建producer和consumer。
When used in a cloud environment, you use the flexible nature of Gearman to ramp up the available workers when you need them.
在云环境中使用时,您利用Gearman的灵活特点来运行可用的工人。
Gearman takes a different approach by providing a flexible mechanism for distributing discrete tasks around a group of machines.
Gearman采用与之不同的方法,它为跨一组机器分布离散的任务提供一种灵活的机制。
For example, if you are providing or using Twitter integration, you can use Gearman to handle the Posting to the Twitter account.
例如,如果您在提供或使用Twitter集成,那么可以使用Gearman来处理到Twitter帐户的发布。
In that case, you can bring up the EC2 instances, do the work through Gearman, collate the responses, and shut the EC2 instances down.
在本例中,您可以启动EC2实例,通过Gearman执行工作,比较响应,并关闭ec2实例。
Assuming that you host your PHP applications on a typical LAMP configuration, Gearman requires an additional daemon and a PHP extension.
假设您将PHP应用程序托管在一个典型的LAMP配置上,那么Gearman将需要一个额外的守护程序以及一个PHP扩展。
Adding Gearman to a machine requires two steps: building and starting the daemon and building the PHP extension to match your version of PHP.
向一个机器添加Gearman需要两步:第一步构建并启动这个守护程序,第二步构建与PHP版本相匹配的PHP扩展。
应用推荐