celery启动报错:kombu.exceptions.VersionMismatch: Redis transport requires redis-py versions 3.2.0

问题原因:

kombu依赖包从v4.3.0开始对redis-py v2.10.6不兼容。所以需要使用旧版本的kombu。

解决方法:

pip install kombu==4.2.0

此时重启celery即可正常启动了。

这个错误提示显示 Redis 需要进行身份验证,而 Celery Flower 没有提供身份验证信息。你需要在 Celery 的配置文件中添加 Redis 的身份验证信息。 具体步骤如下: 1. 打开 Celery 的配置文件,通常为 `celeryconfig.py` 或 `celery.py`。 2. 在配置文件中添加以下内容: ```python broker_url = &#39;redis://user:password@localhost:6379/0&#39; ``` 其中,`user` 和 `password` 分别为 Redis 的用户名和密码,`localhost` 为 Redis 的地址,`6379` 为 Redis 的端口号,`0` 为 Redis 的数据库编号。 3. 保存配置文件并重新启动 Celery Flower。 如果你没有设置 Redis 的身份验证信息,可以在 Redis 中设置用户名和密码。具体步骤如下: 1. 打开 Redis 的配置文件,通常为 `redis.conf`。 2. 找到以下内容: ```conf # Require clients to issue AUTH <PASSWORD> before processing any other # commands. This might be useful in environments in which you do not trust # others with access to the host running redis-server. # # This should stay commented out for backward compatibility and because most # people do not need auth (e.g. they run their own servers). # # Warning: since Redis is pretty fast an outside user can try up to # 150k passwords per second against a good box. This means that you should # use a very strong password otherwise it will be very easy to break. # # requirepass foobared ``` 3. 将 `requirepass` 的注释去掉,并将 `foobared` 替换为你要设置的密码。 4. 保存配置文件并重新启动 Redis。 然后,在 Celery 的配置文件中添加 Redis 的身份验证信息即可。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值