1

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?

Hussain
  • 5,057
  • 6
  • 45
  • 71
nlper
  • 2,297
  • 7
  • 27
  • 37
  • I checked the manual pages for `gearman`, `gearmand` and `gearadmin` and found that what you know is correct. AFAIK there is no option to `restart`. I used to kill the daemon process and start using `gearmand -d` for a `restart`. Hope it helps. – Hussain Apr 02 '15 at 14:08
  • @Hussain, you can refer my answer. To restart, you should use the **gearman-job-server** command – Vinod Tigadi May 20 '15 at 07:51

3 Answers3

7

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.

Vinod Tigadi
  • 859
  • 5
  • 12
2

How to STOP Gearman Server

==> gearadmin --shutdown


How to START Gearman Server

==> gearmand -d

Bhagvan
  • 21
  • 2
0

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.

Ecuador
  • 1,014
  • 9
  • 26