我试图连接 redis 6.0+,这是我现在配置的 Python celery redis 代理 url:
broker_url = redis://:default:[email protected]:6379/5
celery_result_backend = redis://:default:[email protected]:6379/5
但是当我使用这个命令启动芹菜时:
root@pydolphin-service-6fc4b98f54-msfql:~/pydolphin# celery -A dolphin.tasks.tasks worker --loglevel=INFO -n worker2 -Q non_editor_pick_and_diff_pull --concurrency 2
/usr/local/lib/python3.9/site-packages/celery/platforms.py:834: SecurityWarning: You're running the worker with superuser privileges: this is
absolutely not recommended!
Please specify a different user using the --uid option.
User information: uid=0 euid=0 gid=0 egid=0
warnings.warn(SecurityWarning(ROOT_DISCOURAGED.format(
-------------- celery@worker2 v5.1.2 (sun-harmonics)
--- ***** -----
-- ******* ---- Linux-3.10.0-1160.31.1.el7.x86_64-x86_64-with-glibc2.28 2021-08-08 20:45:35
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app: tasks:0x7fb4f6c2dd90
- ** ---------- .> transport: redis://:**@cruise-redis-headless.reddwarf-cache.svc.cluster.local:6379/5
- ** ---------- .> results: redis://:**@cruise-redis-headless.reddwarf-cache.svc.cluster.local:6379/5
- *** --- * --- .> concurrency: 2 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> non_editor_pick_and_diff_pull exchange=non_editor_pick_and_diff_pull(direct) key=non_editor_pick_and_diff_pull
[tasks]
. pydolphin.dolphin.tasks.cert-tasks
. pydolphin.dolphin.tasks.tasks
[2021-08-08 20:45:35,540: ERROR/MainProcess] consumer: Cannot connect to redis://:**@cruise-redis-headless.reddwarf-cache.svc.cluster.local:6379/5: WRONGPASS invalid username-password pair or user is disabled..
Trying again in 2.00 seconds... (1/100)
[2021-08-08 20:45:37,547: ERROR/MainProcess] consumer: Cannot connect to redis://:**@cruise-redis-headless.reddwarf-cache.svc.cluster.local:6379/5: WRONGPASS invalid username-password pair or user is disabled..
Trying again in 4.00 seconds... (2/100)
^C
worker: Hitting Ctrl+C again will terminate all running tasks!
worker: Warm shutdown (MainProcess)
我确定用户名和密码正确,因为我可以使用该redis-cli
命令登录 redis。问题出在哪里,我应该怎么做才能解决它?
它可能是 URL 中用户名之前的“:”。本来应该
您可能在 URL 中使用前导冒号的情况是使用密码但没有用户名进行连接时。然后它看起来像这样: