• celery 启动后等10几秒就报有关于ping command 的错误


    celery版本是 4.4.7
    django版本是 3.1
    redis版本是 Redis server v=2.8.4

    报错信息是:

    [2021-06-22 10:59:45,795: CRITICAL/MainProcess] Unrecoverable error: ResponseError("wrong number of arguments for 'ping' command")
    Traceback (most recent call last):
      File "/usr/local/python39/lib/python3.9/site-packages/celery/worker/worker.py", line 208, in start
        self.blueprint.start(self)
      File "/usr/local/python39/lib/python3.9/site-packages/celery/bootsteps.py", line 119, in start
        step.start(parent)
      File "/usr/local/python39/lib/python3.9/site-packages/celery/bootsteps.py", line 369, in start
        return self.obj.start()
      File "/usr/local/python39/lib/python3.9/site-packages/celery/worker/consumer/consumer.py", line 318, in start
        blueprint.start(self)
      File "/usr/local/python39/lib/python3.9/site-packages/celery/bootsteps.py", line 119, in start
        step.start(parent)
      File "/usr/local/python39/lib/python3.9/site-packages/celery/worker/consumer/consumer.py", line 599, in start
        c.loop(*c.loop_args())
      File "/usr/local/python39/lib/python3.9/site-packages/celery/worker/loops.py", line 83, in asynloop
        next(loop)
      File "/usr/local/python39/lib/python3.9/site-packages/kombu/asynchronous/hub.py", line 364, in create_loop
        cb(*cbargs)
      File "/usr/local/python39/lib/python3.9/site-packages/kombu/transport/redis.py", line 1083, in on_readable
        self.cycle.on_readable(fileno)
      File "/usr/local/python39/lib/python3.9/site-packages/kombu/transport/redis.py", line 354, in on_readable
        chan.handlers[type]()
      File "/usr/local/python39/lib/python3.9/site-packages/kombu/transport/redis.py", line 688, in _receive
        ret.append(self._receive_one(c))
      File "/usr/local/python39/lib/python3.9/site-packages/kombu/transport/redis.py", line 698, in _receive_one
        response = c.parse_response()
      File "/usr/local/python39/lib/python3.9/site-packages/redis/client.py", line 3506, in parse_response
        response = self._execute(conn, conn.read_response)
      File "/usr/local/python39/lib/python3.9/site-packages/redis/client.py", line 3480, in _execute
        return command(*args, **kwargs)
      File "/usr/local/python39/lib/python3.9/site-packages/redis/connection.py", line 757, in read_response
        raise response
    redis.exceptions.ResponseError: wrong number of arguments for 'ping' command
    

    查看celery的github源码站提示,发现要求的redis版本是redis>=3.2.0

    所以更新下redis版本即可。到redis官网下载下源码包:

    wget http://download.redis.io/releases/redis-5.0.4.tar.gz
    cd /tmp/
    tar xf redis-5.0.4.tar.gz
    cd redis-5.0.4/
    make
    make test
    

    启动redis后,重新启动celery就可以了。不会报错。

  • 相关阅读:
    Eclipse安装Git插件及简单操作
    物联网架构成长之路(28)-Docker练习之MQ中间件(Kafka)
    版本分支管理标准
    社交的基本逻辑
    委托投资方案
    印钞机 V1.0(量化选基总结)
    中小研发团队架构实践之总体架构设计
    FOF 全面科普贴(转载)
    DUIR Framework 相关技术介绍
    使用融资的心得和教训
  • 原文地址:https://www.cnblogs.com/liaojiafa/p/14919845.html
Copyright © 2020-2023  润新知