无法运行“齿轮手”带有Gearman 1.1.6的命令行工具 [英] Unable to run "gearman" command line tool with gearman 1.1.6

查看:149
本文介绍了无法运行“齿轮手”带有Gearman 1.1.6的命令行工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Ubuntu上的 http://gearman.org/getting_started 上运行示例

I am trying to run the example on "http://gearman.org/getting_started" on Ubuntu in VirtualBox environment.

起初,我尝试使用下载旧版本 0.16 apt-get install gearman-job-server apt-get install gearman-tools ,一切正常。服务器在后台运行,我能够创建2个worker,并通过创建客户端来验证是否可以调用它们。

At first I tried to download an old version 0.16 by using apt-get install gearman-job-server, apt-get install gearman-tools and everything worked well. The server ran in the background, I was able to create 2 workers and verify that I can call them by creating a client.

我决定下载并编译最新版本, 1.1.6 。现在,我正在尝试对新版本执行相同的操作,但是出现错误。

I decided to download and compile the latest version, 1.1.6. Now, I am trying to do the same thing with the new version and I am having errors.

我以管理员身份运行服务器:

I run the server as admin:

  sudo gearmand

语句

  gearadmin --getpid

似乎可以正常工作-它会向我返回服务器的进程ID。因此,服务器正在运行,并且此答案不相关。

seems to work - it returns me the process ID of the server. Thus, the server is running, and this answer is not relevant.

现在,我要添加一个工人:

Now, I am adding a worker:

 gearman -w -f wc -- wc -l 

似乎跑步。

不过,

gearadmin --workers 

结果可能代表并清空列表:

results in something that probably represents and empty list :

33 127.0.0.1 - :
.

(在版本0.16中,我可以看到两行,第二行显示注册的函数名称。 )

(In version 0.16, I was able to see 2 lines, the second showing the registered function name.)

尝试运行客户端

 gearman -f wc < /etc/passwd

结果

 gearman: gearman_client_run_tasks : flush(GEARMAN_COULD_NOT_CONNECT) localhost:0 -> libgearman/connection.cc:671"

这可能与此处-未指定端口,但我有

This might be the very same problem described in here - the port not specified, but I have no idea how to do it through the command line tool.

任何想法吗?

推荐答案

好,看起来像是成功的关键。入门部分可能有一段时间没有更新。的确,必须为 gearmand gearman

服务器:

 sudo gearmand -p 5000

工人:

 gearman -p 5000 -w -f wc -- wc -l 

客户:

 gearman -p 5000 -f wc < /etc/passwd

这篇关于无法运行“齿轮手”带有Gearman 1.1.6的命令行工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆