我们正在使用RabbitMQ执行芹菜任务。我们有一个队列正在处理超过230000个任务,这些队列昨天因日志不足而崩溃,
<code>2019-02-11 22:30:32,770 WARNING 13003 [celery.worker.consumer] consumer.py:289 - consumer: Connection to broker lost. Trying to re-establish the connection...
Traceback (most recent call last):
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/celery/worker/consumer.py", line 278, in start
blueprint.start(self)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/celery/bootsteps.py", line 123, in start
step.start(parent)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/celery/worker/consumer.py", line 821, in start
c.loop(*c.loop_args())
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/celery/worker/loops.py", line 70, in asynloop
next(loop)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/kombu/async/hub.py", line 340, in create_loop
cb(*cbargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/kombu/transport/base.py", line 164, in on_readable
reader(loop)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/kombu/transport/base.py", line 146, in _read
drain_events(timeout=0)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/amqp/connection.py", line 324, in drain_events
return amqp_method(channel, args)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/amqp/channel.py", line 1647, in _basic_cancel_notify
raise ConsumerCancelled(consumer_tag, (60, 30))
ConsumerCancelled: Basic.cancel: (0) None8
2019-02-11 22:30:32,878 INFO 13003 [celery.worker.consumer] consumer.py:479 - Connected to amqp://celery:**@127.0.0.1:5672//
2019-02-11 22:31:20,308 ERROR 13003 [celery.worker.consumer] consumer.py:364 - consumer: Cannot connect to amqp://celery:**@127.0.0.1:5672//: [Errno 104] Connection res$
Trying again in 2.00 seconds...
</code>
rabbitmq崩溃后,我再次使用以下命令重新启动:
sudo service rabbitmq-server restart
rabbitmq一旦重启,我就失去了所有队列。我的队列持久性是持久的,消息传递模式是非持久性的。
有什么办法可以恢复队列中的邮件?正在处理非常重要的用户数据。
答案 0 :(得分:0)
不。非永久性意味着它们位于RAM中,而不存储在磁盘上。
一般注释-RabbitMQ不是数据库。即使您将队列设置为持久性,也期望消息代理可靠地可靠地处理200,000条消息的临时存储。您的系统应设计为使代理是任务之间的缓冲区,平均队列长度为零。如果发现数量如此之多,则可以加快处理速度或将其存储在旨在能够承受偶发重启而几乎不会造成任何后果的数据库中。