我正在为Heroku使用CloudAMPQ插件 . 由于RabbitMQ需要为其每个进程提供唯一的节点名称,因此当我将工作器dynos从1扩展到2或更多时,我会遇到警告:
/app/.heroku/python/lib/python3.6/site-packages/kombu/pidbox.py:71: UserWarning: A node named coworker@fstrk.io 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!
我的Procfile行看起来像这样
coworker: celery -l info -A getmybot worker -Q slack -c ${COWORKER_PROCESSES:-4} --hostname coworker@fstrk.io --without-gossip --without-mingle --without-heartbeat
我该怎么办呢?
1 回答
尝试将
--hostname coworker@fstrk.io
更改为--hostname coworker@%%h
官方文档中的更多详细信息:http://docs.celeryproject.org/en/latest/reference/celery.bin.worker.html