我希望Celery能够在Redis上构建而不是默认的RabbitMQ.
Configuration is easy,just configure the location of your Redis database:
BROKER_URL = 'redis://localhost:6379/0'
Where the URL is in the format of:
redis://:password@hostname:port/db_number
all fields after the scheme are optional,and will default to localhost on port 6379,using database 0.
但是,我有Redis设置不要监听端口,而是听取套接字.
有一个URI方案来支持这个吗?
自Celery 1.3起,Redis插座可供使用.语法是:
原文链接:https://www.f2er.com/ubuntu/347474.htmlBROKER_URL = 'redis+socket:///tmp/redis.sock'
如果要使用特定数据库:
BROKER_URL = 'redis+socket:///tmp/redis.sock?virtual_host=1'
该文档不是最新版本,但您可以查看此问题以获取更多详细信息:
> https://github.com/celery/celery/issues/1283
> https://github.com/celery/kombu/pull/238