1
我們正在使用芹菜與我們的燒瓶應用程序。我們的各種任務有很多隊列,我們使用supervisord來運行隊列。我們使用cloudamqp 代理。如何爲芹菜的每個節點命名
實例主管的配置如下圖所示:
[program:my-queue]
command=/home/ubuntu/opt/proect/venv/bin/celery -A async_runner worker -Q my_queue --loglevel=INFO --without-gossip --without-mingle --autoscale=1,1 -c 1
environment=PYTHONPATH=/home/ubuntu/opt/project/,PRODUCTION_ENVIRONMENT=true
directory=/home/ubuntu/opt/project/app
process_name = %(program_name)s_%(process_num)02d
user=ubuntu
numprocs=2
autostart=true
autorestart=true
startsecs=10
stopwaitsecs = 600
priority=998
我們得到以下錯誤和隊列只是停止。
[2017-04-06 12:43:06,759: WARNING/MainProcess] /home/ubuntu/opt/project/venv/local/lib/python2.7/site-packages/kombu/pidbox.py:75: UserWarning: A node named [email protected] 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))
問題:如何給每個節點命名?
當我運行celery -A async_runner status
它給5個節點的在線消息。
[email protected]_value_here-: OK
[email protected]_value_here-: OK
[email protected]_value_here-: OK
[email protected]_value_here-: OK
[email protected]_value_here-: OK
5 nodes online.
不知道我的理解,如果這個回答我的問題。 – Kishan
@soupboy對不起,應該澄清'-n'設置了工人的名字,這聽起來像是你需要的。 –
@soupboy實際上,我現在看到你正在爲同一個隊列運行多個worker,所以你也想在worker名字中包含'process_num'。 –