gpt4 book ai didi

rabbitmq - Celery:无法使用新用户名连接远程工作人员

转载 作者:行者123 更新时间:2023-12-02 21:37:27 26 4
gpt4 key购买 nike

我第一次将远程工作人员连接到我的 Celery 服务器 (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

我的远程工作人员的 URL:

BROKER_URL = "amqp://adcelery:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bbcbccdffbd6c2dfd4d6dad2d595d8d4d6" rel="noreferrer noopener nofollow">[email protected]</a>/"

我在启动远程工作人员时收到以下错误。当我在上面的 BROKER_URL 中设置“guest:guest”作为我的登录名时,它连接得很好。我确定我错过了一两个步骤,有什么建议吗?

[2014-01-12 11:31:26,188: INFO/MainProcess] Connected to amqp://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b8d9dcdbddd4ddcac1f8d9cfd9d9c296dcdd" rel="noreferrer noopener nofollow">[email protected]</a>: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'

最佳答案

刚刚找到答案in the docs 。需要将用户添加到虚拟主机:

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

关于rabbitmq - Celery:无法使用新用户名连接远程工作人员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21071906/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com