celery -A shop worker -l info
[2024-08-17 13:31:27,736: WARNING/MainProcess] No hostname was supplied. Reverting to default 'localhost'
-------------- celery@famous-koala v5.4.0 (opalescent)
--- ***** -----
-- ******* ---- Linux-5.15.0-116-generic-x86_64-with-glibc2.35 2024-08-17 13:31:27
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app: shop:0x7f352527c070
- ** ---------- .> transport: amqp://guest:**@localhost:5672//
- ** ---------- .> results: disabled://
- *** --- * --- .> concurrency: 2 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> celery exchange=celery(direct) key=celery
我在远程虚拟机上运行此程序,因此我想指定 IP 和用户名/密码。我找不到有关如何执行此操作的信息。
我尝试了文档:https://docs.celeryq.dev/en/stable/userguide/workers.html#starting-the-worker
我想不通。
如有任何帮助,我们将不胜感激。谢谢。
试试这个:
celery -A shop worker -l info --hostname amqp://user:password@localhost:5672/myvhost