【发布时间】:2019-08-08 00:00:15
【问题描述】:
如何将 Azure Redis 缓存连接到使用 celery 执行一些异步任务的 Flask WebApp?每当我尝试通过 Webjob 连接时,它会说无法连接到 redis。
我也尝试从这篇帖子How to configure celery-redis in django project on microsoft azure? 输入这个celery inspect ping -b redis://{password}@{redis_service_name}.redis.cache.windows.net:6379/0,但我会得到Connection Failure: If this issue persists, ensure your computer's firewall and proxy settings allow outbound TCP traffic to port 10225. Using the firewall feature on your cache may also block connections from the console if your IP address has not been whitelisted
【问题讨论】:
-
会不会只是你使用了错误的端口? Redis 通常在 6379 上侦听。还有一个建议 - 不要使用与现有模块/包 (app.celery) 冲突的名称,您迟早会遇到问题。
project_name.app_name更有意义(更改 project_name 和 app_name 以匹配您当前的工作)。 -
两个端口都试过了,没用
-
我对 Azure 不熟悉,但我认为它与 AWS SecurityGroups 类似——您需要允许到 Redis 服务器的流量...
-
端口号 10225 来自哪里??
标签: python azure flask redis celery