2014-01-12 44 views
2

我是第一次將遠程工作人員連接到我的芹菜服務器(Django)。我的服務器上,我已經創建了一個用戶一個新的用戶名和密碼,並設置權限:芹菜:無法用新用戶名連接遠程工作人員

# rabbitmqctl add_user adcelery pwd 
# rabbitmqctl set_permissions adcelery "^adcelery-.*" ".*" ".*" 
# rabbitmqctl list_users 
Listing users ... 
guest [administrator] 
adcelery [] 
...done. 
# /etc/init.d/rabbitmq-server restart 
# /etc/init.d/celeryd restart 

我的遠程工作人員的網址:

BROKER_URL = "amqp://adcelery:[email protected]/" 

我正在上的啓動下面的錯誤我的遠程工作者。當我在上面的BROKER_URL中設置「guest:guest」作爲我的登錄名時,它連接得非常好。我確定我錯過了一兩步,有什麼建議?

[2014-01-12 11:31:26,188: INFO/MainProcess] Connected to amqp://[email protected]:5672// 
[2014-01-12 11:31:26,391: ERROR/MainProcess] Unrecoverable error: AccessRefused(403, u"ACCESS_REFUSED - access to exchange 'celeryev' in vhost '/' refused f 
or user 'adcelery'", (40, 10), 'Exchange.declare') 
Traceback (most recent call last): 
    File "/usr/local/lib/python2.7/dist-packages/celery/worker/__init__.py", line 206, in start 
    self.blueprint.start(self) 
    File "/usr/local/lib/python2.7/dist-packages/celery/bootsteps.py", line 123, in start 
    step.start(parent) 
    File "/usr/local/lib/python2.7/dist-packages/celery/bootsteps.py", line 373, in start 
    return self.obj.start() 
    File "/usr/local/lib/python2.7/dist-packages/celery/worker/consumer.py", line 270, in start 
    blueprint.start(self) 
    File "/usr/local/lib/python2.7/dist-packages/celery/bootsteps.py", line 123, in start 
    step.start(parent) 
    File "/usr/local/lib/python2.7/dist-packages/celery/worker/consumer.py", line 498, in start 
    enabled=self.send_events, groups=self.groups, 
    File "/usr/local/lib/python2.7/dist-packages/celery/events/__init__.py", line 150, in __init__ 
    self.enable() 
    File "/usr/local/lib/python2.7/dist-packages/celery/events/__init__.py", line 169, in enable 
    serializer=self.serializer) 
    File "/usr/local/lib/python2.7/dist-packages/kombu/messaging.py", line 82, in __init__ 
    self.revive(self._channel) 
    File "/usr/local/lib/python2.7/dist-packages/kombu/messaging.py", line 216, in revive 
    self.declare() 
    File "/usr/local/lib/python2.7/dist-packages/kombu/messaging.py", line 102, in declare 
    self.exchange.declare() 
    File "/usr/local/lib/python2.7/dist-packages/kombu/entity.py", line 166, in declare 
    nowait=nowait, passive=passive, 
    File "/usr/local/lib/python2.7/dist-packages/amqp/channel.py", line 612, in exchange_declare 
    (40, 11), # Channel.exchange_declare_ok 
    File "/usr/local/lib/python2.7/dist-packages/amqp/abstract_channel.py", line 75, in wait 
    return self.dispatch_method(method_sig, args, content) 
    File "/usr/local/lib/python2.7/dist-packages/amqp/abstract_channel.py", line 93, in dispatch_method 
    return amqp_method(self, args) 
    File "/usr/local/lib/python2.7/dist-packages/amqp/channel.py", line 232, in _close 
    reply_code, reply_text, (class_id, method_id), ChannelError, 
AccessRefused: Exchange.declare: (403) ACCESS_REFUSED - access to exchange 'celeryev' in vhost '/' refused for user 'adcelery' 

回答

5

剛剛找到答案in the docs。需要添加用戶到虛擬主機:

rabbitmqctl set_permissions -p/adcelery ".*" ".*" ".*"