ITPub博客

首页 > 数据库 > 数据库开发技术 > openGauss学习笔记-301 openGauss AI特性-AI子功能-Anomaly detection: 异常检测

openGauss学习笔记-301 openGauss AI特性-AI子功能-Anomaly detection: 异常检测

原创 数据库开发技术 作者:shuchaoyang 时间:2024-02-28 07:00:00 0 删除 编辑

openGauss学习笔记-301 openGauss AI特性-AI4DB数据库自治运维-DBMind的AI子功能-Anomaly detection: 异常检测301.1 概述301.2 使用指导301.3 获取帮助301.4 命令参考301.5 常见问题处理

openGauss学习笔记-301 openGauss AI特性-AI4DB数据库自治运维-DBMind的AI子功能-Anomaly detection: 异常检测

301.1 概述

Anomaly detection 异常检测模块主要基于统计方法来实现时序数据来发现数据中存在的可能的异常情况。该模块框架解耦,可以实现不同异常检测算法的灵活替换,而且该模块功能可以根据时序数据的不同特征来自动选择算法,支持异常值检测、阈值检测、箱型图检测、梯度检测、增长率检测、波动率检测和状态转换检测。

301.2 使用指导

假设指标采集系统运行正常,并且用户已经初始化了配置文件目录confpath,则可以通过下述命令实现本特性的功能:

仅启动异常检测功能:

gs_dbmind service start --conf confpath --only-run anomaly_detection

对于某一指标,在全部节点上,从timestamps1到timestamps1时间段内的数据进行概览:

gs_dbmind component anomaly_detection --conf confpath --action overview --metric metric_name --start-time timestamps1 --end-time timestamps2

对于某一指标,在特定节点上,从timestamps1到timestamps1时间段内的数据进行概览:

gs_dbmind component anomaly_detection --conf confpath --action overview --metric metric_name --start-time timestamps1 --end-time timestamps2 --host ip_address --anomaly anomaly_type

对于某一指标,在全部节点上,从timestamps1到timestamps1时间段内的数据,以特定异常检测方式进行概览:

gs_dbmind component anomaly_detection --conf confpath --action overview --metric metric_name --start-time timestamps1 --end-time timestamps2 --anomaly anomaly_type

对于某一指标,在特定节点,从timestamps1到timestamps1时间段内的数据,以特定异常检测方式进行概览:

gs_dbmind component anomaly_detection --conf confpath --action overview --metric metric_name --start-time timestamps1 --end-time timestamps2 --host ip_address --anomaly anomaly_type

对于某一指标,在特定节点,从timestamps1到timestamps1时间段内的数据,以特定异常检测方式进行可视化展示:

gs_dbmind component anomaly_detection --conf confpath --action plot --metric metric_name --start-time timestamps1 --end-time timestamps2 --host ip_address --anomaly anomaly_type

停止已启动的服务:

gs_dbmind service stop --conf confpath

说明: 在输入anomaly detection的参数时,start-time至少要比end-time早30秒以上。

301.3 获取帮助

模块命令行说明:

gs_dbmind component anomaly_detection --help

显示如下帮助信息:

usage: anomaly_detection.py [-h] --action {overview,plot} -c CONF -m METRIC -s
                          START_TIME -e END_TIME [-H HOST] [-a ANOMALY]

Workload Anomaly detection: Anomaly detection of monitored metric.

optional arguments:
 -h, --help            show this help message and exit
 --action {overview,plot}
                      choose a functionality to perform
 -c CONF, --conf CONF  set the directory of configuration files
 -m METRIC, --metric METRIC
                       set the metric name you want to retrieve
 -s START_TIME, --start-time START_TIME
                       set the start time of for retrieving in ms
 -e END_TIME, --end-time END_TIME
                       set the end time of for retrieving in ms
 -H HOST, --host HOST  set a host of the metric, ip only or ip and port.
 -a ANOMALY, --anomaly ANOMALY
                       set a anomaly detector of the metric(increase_rate,
                      level_shift, spike, threshold)

Process finished with exit code 0

301.4 命令参考

表 1 命令行参数说明

301.5 常见问题处理

  • 概览场景失败:请检查配置文件路径是否正确,且配置文件信息完整。检查指标名称是否准确,检查host地址是否正确,检查异常检测类型是否准确,检查起止时间内指标是否存在对应数据。

  • 可视化场景失败:请检查配置文件路径是否正确,且配置文件信息完整。检查指标名称是否准确,检查host地址是否正确,检查异常检测类型是否准确,检查起止时间内指标是否存在对应数据。


👍 点赞,你的认可是我创作的动力!

⭐️ 收藏,你的青睐是我努力的方向!

✏️ 评论,你的意见是我进步的财富!


PS:因为公众号平台更改了推送规则,如果不想错过内容,记得读完点一下“在看”,加个“星标”,这样每次新文章推送才会第一时间出现在你的订阅列表里。点“在看”支持我吧!


原文作者:超哥的IT私房菜;如有侵权,请联系管理员删除。

请登录后发表评论 登录
全部评论
专注于IT系统集成、运维、架构二十年的IT职场老兵,拥有CCNA、OCA、OCP、PGCA、PGCE认证证书,公众号:超哥的IT私房菜,知识星球:超哥的IT私房菜,目前是多家IT厂商的咨询顾问。

注册时间:2021-08-27

  • 博文量
    552
  • 访问量
    303563