Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to shutdown celery node

My celery log is showing this error:

UserWarning: A node named celery@postr is already using this process mailbox!

Maybe you forgot to shutdown the other node or did not do so properly?
Or if you meant to start multiple nodes on the same host please make sure
you give each node a unique node name!

  warnings.warn(W_PIDBOX_IN_USE.format(node=self))

How can I shutdown the other node?

PS: Is there a way to see all the current running nodes?

like image 968
Zorgan Avatar asked May 08 '18 08:05

Zorgan


1 Answers

Assuming you are on a unix, you can see the running processes with:

ps aux | grep celery

This will show you as list of the running process ids, eg. 1111, 2222 and 3333. You can then shut down the celery processes by sending the TERM signal:

kill -TERM 1111 2222 3333

Depending on your configuration your celery process might spawn several subprocesses and you can see the parent process id in something like /var/run/celery.pid

See: https://docs.celeryproject.org/en/stable/userguide/workers.html#stopping-the-worker

like image 120
Rune Kaagaard Avatar answered Sep 22 '22 01:09

Rune Kaagaard