Gearman 问题:GEARMAN_COULD_NOT_CONNECT
我已经使用“apt-get install gearman-server”安装了 gearman,然后构建了 PHP PECL。
如果我尝试工人:
$ gearman -w -f wc -- wc -l
它开始等待。正确的。
但是如果我尝试开始一份工作(如教程中所述)
$ gearman -f wc
/etc/passwd
它说:
Gearman:gearman_client_run_tasks:刷新(GEARMAN_COULD_NOT_CONNECT) 127.0.0.1:4730 --> libgearman/connection.cc:480
如果我尝试教程中描述的 PHP str_rev 演示,它会给我同样的错误。
PHP 警告:GearmanClient::do(): 刷新(GEARMAN_COULD_NOT_CONNECT) 127.0.0.1:4730 --> /root/client.php 中的 libgearman/connection.cc:480 第 4 行
这是我使用过的教程: http://gearman.org/index.php?id =getting_started
有人可以帮助我吗?
编辑: 好的。我执行了以下操作:“apt-get remove gearman-server”,然后“apt-get install gearman-job-server”。现在错误消失了。但另一个问题:工人和客户现在都冻结了。就像他们在等待什么一样。有人可以帮助我吗?
I've installed gearman using "apt-get install gearman-server" and than build the PHP PECL.
If i try the worker:
$ gearman -w -f wc -- wc -l
It starts waiting. right.
But if i try to start a job (as descriped in the tutorial)
$ gearman -f wc < /etc/passwd
it says:
gearman: gearman_client_run_tasks : flush(GEARMAN_COULD_NOT_CONNECT)
127.0.0.1:4730 -> libgearman/connection.cc:480
And if i try the PHP str_rev demo descriped in the tutorial it gives me the very same error.
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
Here's the tutorial i've used: http://gearman.org/index.php?id=getting_started
Can someone help me?
Edit:
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在快速完成示例时遇到了同样的问题。听起来您没有运行 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.
显式调用: $worker->addServer("localhost",4730);
explicitly call: $worker->addServer("localhost",4730);