1

I'm testing Gearman on a dedicated job-server (Ubuntu 12.04) for my PHP project (using pecl/gearman as the PHP impementation).

Manually this works fine: starting up the client, adding jobs and running one or more workers in separate shells works as intended. Now I want to run the workers using Supervisord, but this generates a lot of the following errors in the Gearman log:

WARNING [     4 ] lost connection to client recv(peer has closed connection) 127.0.0.1:37126 -> libgearman-server/io.cc:608
  ERROR [     4 ] Failed while in _connection_read() -> libgearman-server/io.cc:489

The supervisor conf is default, I just added a program:

[program:migration]
command=/path/to/script
process_name=%(program_name)s_%(process_num)02d
numprocs=10
stdout_logfile=/var/log/gearman.log
stderr_logfile=/var/log/gearman-error.log
stdout_logfile_maxbytes=1MB
environment=GEARMAN_USER=gearman
autostart=true
autorestart=true
user=gearman
stopsignal=KILL

Gearman process information:

gearman   9802  0.0  0.0 476116  1780 ?        Ssl  12:18   0:00 /usr/sbin/gearmand --pid-file=/var/run/gearman/gearmand.pid --user=gearman --daemon --log-file=/var/log/gearman-job-server/gearman.log --listen=127.0.0.1

When testing supervisor:

supervisord -n -c /etc/supervisor/supervisord.conf 

I'm kind of stuck here, since the error message doesn't really return results on Google. Any help is appreciated.

Peter Kruithof
  • 87
  • 1
  • 11

1 Answers1

3

Ran into the same error in almost exactly the same server stack, and found a solution. The warning and error are thrown because your trying to send a job to a non registered worker. Check the name of your worker and check with ps -ax on the command line if its running.

Sending a job to a non existing worker on the command line using gearmand -f will give you no feedback. Doing it using the pecl module results in an error.

PS: I know you already jumped ship and moved along with Beanstalkd but maybe it can help someone else.

Yo-han
  • 166
  • 4