0
我不能讓芹菜(版本4.0.2)與RabbitMQ一起使用。我曾經在一個tasks.py文件中的以下(如芹菜的tutorial/doc建議):芹菜製作芹菜MQL
from celery import Celery
app = Celery('tasks', broker='pyamqp://[email protected]//')
@app.task
def add(x, y):
return x + y
但是,當我按下面的命令:
celery -A tasks worker --loglevel=info
我得到以下奇怪的錯誤:
Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 22] Invalid argument.
我的RabbitMQ服務器正在運行。這裏是我所得到的,當我按下「rabbitmqctl狀態」命令:
[{pid,188},
{running_applications,[{rabbit,"RabbitMQ","3.6.6"},
{os_mon,"CPO CXC 138 46","2.2.14"},
{rabbit_common,[],"3.6.6"},
{mnesia,"MNESIA CXC 138 12","4.11"},
{xmerl,"XML parser","1.3.5"},
{ranch,"Socket acceptor pool for TCP protocols.",
"1.2.1"},
{sasl,"SASL CXC 138 11","2.3.4"},
{stdlib,"ERTS CXC 138 10","1.19.4"},
{kernel,"ERTS CXC 138 10","2.16.4"}]},
{os,{unix,linux}},
{erlang_version,"Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:4:4] [async-threads:64] [kernel-poll:true]\n"},
{memory,[{total,45625464},
{connection_readers,0},
{connection_writers,0},
{connection_channels,0},
{connection_other,0},
{queue_procs,2704},
{queue_slave_procs,0},
{plugins,0},
{other_proc,18736352},
{mnesia,60216},
{mgmt_db,0},
{msg_index,51568},
{other_ets,933528},
{binary,1069976},
{code,19343063},
{atom,711569},
{other_system,4716488}]},
{alarms,[]},
{listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,6819561472},
{disk_free_limit,50000000},
{disk_free,188958461952},
{file_descriptors,[{total_limit,1948},
{total_used,2},
{sockets_limit,1751},
{sockets_used,0}]},
{processes,[{limit,1048576},{used,141}]},
{run_queue,0},
{uptime,1138},
{kernel,{net_ticktime,60}}]
而且我使用Python 2.7。 有沒有人有可能是什麼問題的想法?