1

I have compiled Gearman on my ubuntu machine and it works fine in localhost mode but I get a connection error when connecting from another machine to add a new job to the queue.

I have tried...

  1. Editing the config file located at /etc/default/gearman-job-server to add --listen={ip-here} and that did nothing.
  2. Editing the upstart script directly to add the --listen flag and that did nothing either.
  3. Editing the /etc/init.d/gearman-job-server file to add the --listen and --port paramaters to the start script.
  4. Manually editing the upstart file at /etc/init/gearman-job-server.conf and commenting out the existing exec line and adding in the following lines after the respawn command...

script

exec gearmand --listen={ip} --port=4703

end script

The only way I have Gearman working at the moment is by manually running the command gearmand -d -listen={ip} --port=4703 which has made it work. Now I understand that the -d flag launches it in daemon mode which has allowed me to close the SSH session while still keeping it running but any machine reboot is going to put me right back where I started.

I want to have Gearman automatically start on boot, or restart through the sudo service command listening to the correct IP and port and I don't want to have to log into the server every time something goes wrong to manually start the daemon again.

I have been through serverFault which led me to the first two options but still needing help as neither of those worked.

  • Would you be willing to post your htop results from the server hosting gearman? We need to compare ours to another installation. We are successfully using addserver and running. Wondering why we never have a dropserver in our application. Any example you could share of dropserver, or a url with an explanation of dropserver function. Thanks – Wilson Hauck May 31 '18 at 11:38
1

Managed to get this figured by digging right into the Debian bug reports...

Even though Gearman has the config file located in /etc/default/gearman-job-server and even though it has entries in the /etc/init/ and /etc/init.d/ directories these are apparently ignored in many installations (Possible from the point that the init.d command for service control was superceeded by the service command but basically what you need to do it...

  1. Navigate to the /lib/systemd/system directory and open gearman-job-server.service in your chosen text editor.
  2. Update the ExecStart command. At this point you can either manually code in the parameters you want or you can include the default params environment variable by adding $PARAMS to the end of the line. The parameters you care about are the --listen and --port parameters. The listen parameter should be the publicly accessible IP of your server.
  3. Run sudo systemctl daemon-reload
  4. Run sudo service gearman-job-server restart
  5. Give it a test and it should be working now
0

In CentOS 7 there is the same problem. You may edit the /etc/sysconfig/gearmand and add the following:

OPTIONS="--listen=127.0.0.1 --port=4730"

Note, the default port is 4730, not 4703. Then, run "sudo service gearmand restart" -- and get "gearadmin --status" working!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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