2
我試圖讓在Rackspace公司Ubuntu的機器上運行我的芹菜程序,但是我在使用RabbitMQ的連接芹菜麻煩。在我的Mac上,使用默認的rabbitmq設置(BROKER_URL ='amqp://'),一切正常,但在生產服務器上,我無法讓芹菜與rabbitmq進行通話。芹菜不能連接到RabbitMQ的 - 意外的方法來接收
這裏就是我所做的:
$ sudo rabbitmqctl add_user celeryuser celerypassword
$ sudo rabbitmqctl add_vhost celeryhost
$ sudo rabbitmqctl set_permissions -p celeryhost celeryuser ".*" ".*" ".*"
從here
以下幾個方向在celeryconfig.py
我與配置從上面
BROKER_URL = 'amqp://celeryuser:[email protected]:5672/celeryhost'
定義的經紀人URL和celery_app.py
我加載以上配置:
app.config_from_object('proj.celeryconfig')
但是當我嘗試先從芹菜工人:
celery worker --app=proj.celery_app
我收到以下錯誤:
-------------- [email protected] v3.1.13 (Cipater)
---- **** -----
--- * *** * -- Linux-2.6.32-64-server-x86_64-with-Ubuntu-10.04-lucid
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app: proj:0x29e9850
- ** ---------- .> transport: amqp://celeryuser:**@localhost:5672/celeryhost
- ** ---------- .> results: amqp
- *** --- * --- .> concurrency: 4 (prefork)
-- ******* ----
--- ***** ----- [queues]
-------------- .> celery exchange=celery(direct) key=celery
[2014-09-12 09:28:00,266: ERROR/MainProcess] consumer: Cannot connect to amqp://celeryuser:**@localhost:5672/celeryhost: Couldn't log in: unexpected method received.
Trying again in 2.00 seconds...
我檢查,看看是否RabbitMQ的服務器與運行:
$ sudo rabbitmqctl status
並且結果是:
Status of node [email protected] ...
[{running_applications,[{rabbit,"RabbitMQ","1.7.2"},
{mnesia,"MNESIA CXC 138 12","4.4.12"},
{os_mon,"CPO CXC 138 46","2.2.4"},
{sasl,"SASL CXC 138 11","2.1.8"},
{stdlib,"ERTS CXC 138 10","1.16.4"},
{kernel,"ERTS CXC 138 10","2.13.4"}]},
{nodes,[[email protected]]},
{running_nodes,[[email protected]]}]
...done.