zoukankan      html  css  js  c++  java
  • 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就可以了。不会报错。

  • 相关阅读:
    Redis操作命令大全
    Redis实用监控工具一览
    Redis缓存雪崩、缓存穿透、缓存击穿、缓存降级、缓存预热、缓存更新
    Redis GEO地理位置信息,查看附近的人
    详解redis持久化
    详解Supervisor进程守护监控
    详解Redis Cluster集群
    arduino使用rfid
    树莓派控制WS2812
    Arduino读取温湿度dh11+烟雾气体MQ2+彩灯ws2812
  • 原文地址:https://www.cnblogs.com/liaojiafa/p/14919845.html
Copyright © 2011-2022 走看看