gearman stop start restart command

14.5k Views Asked by At

What are the command to start, restart and stop gearman?

So far I know:

gearadmin --shutdown # stop
gearmand -d # I believe it is to restart. Not sure.

Any idea for managing gearman?

3

There are 3 best solutions below

0
On

The popular answer seems to be a bit old, so if you get Failed to restart gearman-job-server.service: Unit not found. when trying to restart the old way, try just sudo service gearmand restart. That's how it seems to work on a CentOS with latest version of gearman.

For restarting the workers on the same system there seems to be a sudo gearmanw-control restart command avaliable.

0
On

If you want to restart the gearmand, then you should use the shell script gearman-job-server. Type the command as sudo service gearman-job-server restart which STOPs and STARTs the server

---------------------- More Information If you need it -----------------------

I assume you have some small confusion over here. It's all because of Terminologies. The name of the application is Gearman which is a Message-Queue System.

I am answering with the assumption tha you are working with Linux OS. When you try installing the Gearman, the application that gets installed is gearmand which is a Job-Server/executable file. Something like Apache for example. Refer the link http://manpages.ubuntu.com/manpages/precise/en/man8/gearmand.8.html for the command reference.

Then what's the gearman? gearman is the Client Program/Application, with which you can talk to the gearmand. With gearman you can run client and worker functions from the command line. Refer the link http://manpages.ubuntu.com/manpages/precise/en/man1/gearman.1.html for the command reference.

So what's gearadmin? It's the tool which allows you to run Admin commands against your gearmand Refer the link: http://manpages.ubuntu.com/manpages/precise/en/man1/gearadmin.1.html

Now coming to your questions about the command gearmand. From the shell if you run the command as gearmand, the Job Server starts and gets attached to your Shell Process. For ex: if you run php from shell the php runs and starts waiting for your commands right? Same way. If you want to run Gearmand as a background process, then you should run with the param as -d which makes it run as a daemon

So gearmand -d makes it run as Daemon. Not a restart command.

Hope this helps to answer your question and also to clarify in case if you have any confusion over the naming.

0
On

How to STOP Gearman Server

==> gearadmin --shutdown


How to START Gearman Server

==> gearmand -d