1

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

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.

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

The statement

  gearadmin --getpid

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 

It seems to run.

Nevertheless,

gearadmin --workers 

results in something that probably represents and empty list :

33 127.0.0.1 - :
.

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


Attempting to run the client

 gearman -f wc < /etc/passwd

results in

 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.

Any idea?

1 Answer 1

0

Ok, It looks like the answer in here was the key to success. Probably, the "getting started" section was not updated for a while. Indeed, one must specify a port explicitly for gearmand and gearman .

Server:

 sudo gearmand -p 5000

Worker:

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

Client:

 gearman -p 5000 -f wc < /etc/passwd
1
  • I also ran into this when compiling from source. When I install from the repo the need to specify a port went away. I'm wondering if there is an error in configure that sets the default port incorrectly before building or something.
    – Josiah
    Aug 31, 2017 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.