1. 监控和管理Workers

1.1 将celery实例放入shell
[root@node2 app]# celery -A tasks shell
Python 3.6.5 (default, Oct 23 2019, 12:55:54)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.8.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: app
Out[1]: <Celery tasks at 0x7ff7dddbdc18> In [2]: add.delay(1,2)
Out[2]: <AsyncResult: c5cfd00f-8b11-4408-95e2-241f2f3d5521>
1.2 查看任务的结果
[root@node2 app]# celery -A tasks  result c5cfd00f-8b11-4408-95e2-241f2f3d5521
3

  

1.3 从所有已配置的任务队列中清除消息
[root@node2 app]# celery -A tasks  purge
WARNING: This will remove all tasks from queue: celery.
There is no undo for this operation! (to skip this prompt use the -f option) Are you sure you want to delete all tasks (yes/NO)? yes
No messages purged from 1 queue

  

您还可以使用-Q选项指定要清除的队列:

$ celery -A proj purge -Q celery,foo,bar

并使用-X选项排除清除队列:

  $ celery -A proj purge -X celery

1.4 列出活动的任务

  celery -A tasks inspect active

1.5列出计划的ETA任务

  celery -A tasks inspect scheduled

这些是设置了eta或countdown参数时由工作人员保留的任务 。

1.6 列出保留任务
  celery -A tasks inspect reserved

这将列出工作者已经预取的所有任务,并且当前正在等待执行(不包括设置了ETA值的任务)。

1.7 列出已撤销任务的历史记录

  $ celery -A tasks inspect revoked

1.8 列出注册的任务
  celery -A tasks inspect registered
1.9 显示worker的统计信息
  celery -A tasks inspect stats
1.10 查询任务信息

  celery -A tasks inspect query_task task_id

1.11启用和禁用事件

  celery -A tasks control enable_events/disable_events

2. Flower: Celery实时的Web监控

2.1 安装flower
pip install flower
2.2 启动Flower
 celery -A tasks flower

 可以添加--port参数指定监听端口,默认监听5555 

或者通过指定Broker URL
$ celery flower --broker=amqp://guest:guest@localhost:5672//
or
$ celery flower --broker=redis://guest:guest@localhost:6379/0

  

3. celery events: Curses Monitor

celery -A tasks events

可以看件如下界面:

按j,k键可以选中task,查看任务结果

Celery-管理与监控的更多相关文章

  1. 系统内存和CPU管理、监控

    本博文的主要内容有 .系统内存管理.监控:vmstat和free -mt .系统CPU管理.监控:sar -u.mpstat.uptime linux系统内存和CPU是在系统运行的过程中不断消耗的资源 ...

  2. Linux 基础 —— Linux 进程的管理与监控

    这篇文章主要讲 Linux 中进程的概念和进程的管理工具.原文:http://liaoph.com/inux-process-management/ 进程的概念 什么是进程 进程(Process)是计 ...

  3. Oracle数据库web维护管理及监控

    1.Oracle数据库客户端的种类及现状         目前Oracle数据库维护管理,通常是使用客户端软件:PL/SQL Developer,SQL* Plus,toad,em等进行数据的管理.维 ...

  4. 基于spring-boot和docker-java实现对docker容器的动态管理和监控[附完整源码下载]

    ​ (我是个封面) docker简介 Docker 是一个开源的应用容器引擎,和传统的虚拟机技术相比,Docker 容器性能开销极低,因此也广受开发者喜爱.随着基于docker的开发者越来越多,doc ...

  5. spring-boot-plus集成Spring Boot Admin管理和监控应用

    Spring Boot Admin Spring Boot Admin用来管理和监控Spring Boot应用程序 应用程序向我们的Spring Boot Admin Client注册(通过HTTP) ...

  6. spring-boot-plus集成Spring Boot Admin管理和监控应用(十一)

    spring-boot-plus集成Spring Boot Admin管理和监控应用 spring boot admin Spring Boot Admin用来管理和监控Spring Boot应用程序 ...

  7. JMX——以可视化形式管理与监控正在运行中的Java程序

    简单理解: MBean:管理的最小单元,一个MBean就是一个可以被监控的JavaBean. MBeanServer:一个池子,各个MBean都会注册到该池子中,并且该池子提供一系列的管理.监控API ...

  8. 利用nvidia-smi 管理和监控NVIDIA GPU设备

    NVIDIA系统管理界面介绍 原文来源:https://developer.nvidia.com/nvidia-system-management-interface NVIDIA系统管理界面(nvi ...

  9. 009.OpenShift管理及监控

    一 资源限制 1.1 pod资源限制 pod可以包括资源请求和资源限制: 资源请求 用于调度,并控制pod不能在计算资源少于指定数量的情况下运行.调度程序试图找到一个具有足够计算资源的节点来满足pod ...

  10. Celery的Web监控管理--Flower

    Flower是Celery的一个实时监控和管理Web界面工具,目前仍在活跃的开发之中,但已经是一个很重要的可用工具了.这是推荐使用的Celery监控工具. 1,安装依赖 pip install flo ...

随机推荐

  1. admin端的专业管理模块功能测试

    1.概述 1.1 测试范围 本次所测试的内容是admin端的专业管理模块. 1.2 测试方法 本次测试采用黑盒子方法进行集成测试. 1.3 测试环境 操作系统:Windows 2012 Server ...

  2. PAT甲级1019水题飘过

    题目分析: 将n转成对应大小的b进制数之后判断是否为回文串,是则Yes,否则No #include<iostream> using namespace std; ]; //存放从0开始b进 ...

  3. PAT 乙级 1007.素数对猜想 C++/Java

    1007 素数对猜想 (20 分) 题目来源 让我们定义d​n​​为:d​n​​=p​n+1​​−p​n​​,其中p​i​​是第i个素数.显然有d​1​​=1,且对于n>1有d​n​​是偶数.“ ...

  4. php单例型(singleton pattern)

    搞定,吃饭 <?php /* The purpose of singleton pattern is to restrict instantiation of class to a single ...

  5. PHP中的生成器

    python中有的,php一样不落下呀. <?php //生成器 //生成器代理 //生成器返回表达示 function gen1() { yield '1'; yield '2'; yield ...

  6. 【转载】python2x与3x下urlretrieve的使用

    转载地址:https://blog.csdn.net/drdairen/article/details/61934598 1.python2x下urlretrieve方法: 直接将远程数据下载到本地. ...

  7. IE 常见bug

    1. 双空白边浮动bug 最常见且最容易发现的bug 之一是IE6和更低版本中的双空白边浮动bug.顾名思义,这个Windows bug使任何浮动元素上的空白边加倍 这个bug 很容易修复,将元素的d ...

  8. 19、Python标准库: 日期和时间

    一.time时间模块 import time 1 .时间戳   时间戳(timestamp):时间戳表示的是从1970年1月1日00:00:00开始按秒计算的偏移量. time_stamp = tim ...

  9. SparkStreaming运行原理

    Spark Streaming应用也是Spark应用,Spark Streaming生成的DStream最终也是会转化成RDD,然后进行RDD的计算,所以Spark Streaming最终的计算是RD ...

  10. vue 实战

    vue 实战 Vue命令行工具vue-cli https://www.cnblogs.com/xiaohuochai/p/7277771.html https://github.com/ymblog/ ...