首页 > 其他 > 详细

celery-redis密码连接问题

时间:2020-06-01 23:00:25      阅读:252      评论:0      收藏:0      [点我收藏+]

错误问题:
consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [WinError 10061] 由于目标计算机积极拒绝,无法连接。.
Trying again in 2.00 seconds... (1/100)

解决问题:
URL连接的格式为: redis://:password@hostname:port/db_number

例如:
任务队列的链接地址(变量名唯一)
broker_url  = ‘redis://:foobared@127.0.0.1:6379/6‘
结果队列的链接地址(变量名唯一)
result_backend  = ‘redis://:foobared@127.0.0.1:6379/8‘

执行命令: celery -A main worker --loglevel=info

-------------- celery@DESKTOP-RIBVNKO v4.4.3 (cliffs)
--- ***** -----
-- ******* ---- Windows-10-10.0.18362-SP0 2020-06-01 21:10:07

  • *** --- * ---
  • ** ---------- [config]
  • ** ---------- .> app: luffy:0x1533b361240
  • ** ---------- .> transport: redis://??*@127.0.0.1:6379/6
  • ** ---------- .> results: redis://??*@127.0.0.1:6379/8
  • *** --- * --- .> concurrency: 8 (prefork)
    -- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
    --- ***** -----
    -------------- [queues]
    .> celery exchange=celery(direct) key=celery

[tasks]
. mycelery.sms.tasks.send_sms

[2020-06-01 21:10:08,025: INFO/MainProcess] Connected to redis://??*@127.0.0.1:6379/6
[2020-06-01 21:10:08,045: INFO/MainProcess] mingle: searching for neighbors
[2020-06-01 21:10:08,125: INFO/SpawnPoolWorker-1] child process 19976 calling self.run()
[2020-06-01 21:10:08,166: INFO/SpawnPoolWorker-2] child process 1136 calling self.run()
[2020-06-01 21:10:08,230: INFO/SpawnPoolWorker-3] child process 22676 calling self.run()
[2020-06-01 21:10:08,289: INFO/SpawnPoolWorker-4] child process 6460 calling self.run()
[2020-06-01 21:10:08,349: INFO/SpawnPoolWorker-5] child process 20808 calling self.run()
[2020-06-01 21:10:08,398: INFO/SpawnPoolWorker-6] child process 17800 calling self.run()
[2020-06-01 21:10:08,423: INFO/SpawnPoolWorker-7] child process 24296 calling self.run()
[2020-06-01 21:10:08,486: INFO/SpawnPoolWorker-8] child process 17604 calling self.run()
[2020-06-01 21:10:09,084: INFO/MainProcess] mingle: all alone
[2020-06-01 21:10:09,093: INFO/MainProcess] celery@DESKTOP-RIBVNKO ready.

celery-redis密码连接问题

原文:https://www.cnblogs.com/remixnameless/p/13027479.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!