celery起动报下列警告
[2023-06-08 01:07:11,671: WARNING/MainProcess] D:\program\ANACONDA3\envs\medical\lib\site-packages\celery\worker\consumer\consumer.py:498: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine
whether broker connection retries are made during startup in Celery 6.0 and above.
If you wish to retain the existing behavior for retrying connections on startup,
you should set broker_connection_retry_on_startup to True.
warnings.warn(
[2023-06-08 01:07:11,714: INFO/MainProcess] Connected to amqp://ubuntu:**@101.42.41.201:5672//
[2023-06-08 01:07:11,715: WARNING/MainProcess] D:\program\ANACONDA3\envs\medical\lib\site-packages\celery\worker\consumer\consumer.py:498: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine
whether broker connection retries are made during startup in Celery 6.0 and above.
If you wish to retain the existing behavior for retrying connections on startup,
you should set broker_connection_retry_on_startup to True.
warnings.warn(
[2023-06-08 01:07:11,754: INFO/MainProcess] mingle: searching for neighbors
[2023-06-08 01:07:12,905: INFO/MainProcess] mingle: all alone
[2023-06-08 01:07:12,944: WARNING/MainProcess] D:\program\ANACONDA3\envs\medical\lib\site-packages\celery\worker\consumer\consumer.py:498: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine
whether broker connection retries are made during startup in Celery 6.0 and above.
If you wish to retain the existing behavior for retrying connections on startup,
you should set broker_connection_retry_on_startup to True.
warnings.warn(
[2023-06-08 01:07:12,989: INFO/MainProcess] pidbox: Connected to amqp://ubuntu:**@101.42.41.201:5672//.
[2023-06-08 01:07:13,016: INFO/MainProcess] celery@LAPTOP-HU661FE2 ready.
[2023-06-08 01:07:13,018: WARNING/MainProcess] D:\program\ANACONDA3\envs\medical\lib\site-packages\kombu\pidbox.py:72: UserWarning: A node named celery@LAPTOP-HU661FE2 is already using this process mailbox!
Maybe you forgot to shutdown the other node or did not do so properly?
Or if you meant to start multiple nodes on the same host please make sure
you give each node a unique node name!
warnings.warn(W_PIDBOX_IN_USE.format(node=self))
解决方法:
CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP = True
- 第二个警告的解决方法:
- 在队列中把报警告的队列删除,重启后就不警告了
- 在起动时给每个worker起个名字
celery -A central_console_django worker -l info --concurrency=1 -n worker1@%h -P eventlet