Gearman 的问题:GEARMAN_COULD_NOT_CONNECT

2022-01-24 00:00:00 debian php gearman unix

我使用apt-get install gearman-server"安装了 gearman,然后构建了 PHP PECL.

I've installed gearman using "apt-get install gearman-server" and than build the PHP PECL.

如果我尝试工人:

$ gearman -w -f wc -- wc -l

$ gearman -w -f wc -- wc -l

它开始等待.对.

但如果我尝试开始一份工作(如教程中所述)

But if i try to start a job (as descriped in the tutorial)

$ gearman -f wc

/etc/passwd

$ gearman -f wc < /etc/passwd

上面写着:

gearman:gearman_client_run_tasks:刷新(GEARMAN_COULD_NOT_CONNECT)127.0.0.1:4730 -> libgearman/connection.cc:480

gearman: gearman_client_run_tasks : flush(GEARMAN_COULD_NOT_CONNECT) 127.0.0.1:4730 -> libgearman/connection.cc:480

如果我尝试教程中描述的 PHP str_rev 演示,它会给我同样的错误.

And if i try the PHP str_rev demo descriped in the tutorial it gives me the very same error.

PHP 警告:GearmanClient::do(): flush(GEARMAN_COULD_NOT_CONNECT)127.0.0.1:4730 -> libgearman/connection.cc:480 在/root/client.php 上第 4 行

PHP Warning: GearmanClient::do(): flush(GEARMAN_COULD_NOT_CONNECT) 127.0.0.1:4730 -> libgearman/connection.cc:480 in /root/client.php on line 4

这是我使用的教程:http://gearman.org/index.php?id=getting_started

有人可以帮我吗?

行.我做了以下操作:apt-get remove gearman-server",然后apt-get install gearman-job-server".现在错误消失了.但另一个问题:工人和客户现在都冻结了.就在他们等待着什么的时候.有人可以帮我吗?

Ok. I did the following: "apt-get remove gearman-server" and then "apt-get install gearman-job-server". Now the error is gone. But Another Problem: Both, Worker and Client, are now freezing. Just as they wait for something. Can someone help me?

推荐答案

我在快速完成示例时遇到了同样的问题.听起来你没有运行 gearmand - 这就是找到可用工人来完成工作的过程.请记住,有 3 个部分 - 想要完成工作的客户端,将完成工作的工作人员,以及将为客户的请求找到可用工作人员的工作服务器(又名 gearmand).

I had the same problem when working quickly through the example. It sounds like you don't have gearmand running - that's the process that will find available workers to do your job. Remember there are 3 parts - the client who wants the work done, the worker who will do the work, and the job-server (aka gearmand) who will find an available worker for the client's request.

相关文章