![](/img/trans.png)
[英]celery : Received unregistered task of type 'celery_deploy.tasks._stocks'
[英]Two applications using celery scheduled tasks: “Received unregistered task” errors in one of the workers
場景:
我使用以下命令行為每個應用程序啟動一個工作程序和一個節拍過程。
celery -A firstapp.tasks worker
celery -A firstapp.tasks beat
celery -A secondapp.tasks worker --hostname foobar
celery -A secondapp.tasks beat
現在一切似乎都正常,但是在secondapp
的工作進程中, secondapp
以下錯誤:
Received unregistered task of type 'firstapp.tasks.do_something'
有沒有辦法將兩個芹菜彼此隔離?
我使用的是Celery 3.1.16版,順便說一句。
我相信我通過創建RabbitMQ虛擬主機並配置了第二個應用程序以使用該虛擬機來解決了該問題。
創建虛擬主機(並設置權限):
sudo rabbitmqctl add_vhost /secondapp
sudo rabbitmqctl set_permissions -p /secondapp guest ".*" ".*" ".*"
然后更改第二個應用程序的命令行:
celery -A secondapp.tasks -b amqp://localhost//secondapp worker
celery -A secondapp.tasks -b amqp://localhost//secondapp beat
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.