diff --git a/README.md b/README.md index 783b75a550891008ad9e9c43d71af1c3c10f45b0..6074955dce71966523f932979f3c63249be06748 100644 --- a/README.md +++ b/README.md @@ -1,80 +1,168 @@ -# openEuler 文档 - -[English](./README-en.md) | 简体中文 - -## 介绍 - -openEuler Docs 仓旨在为帮助社区用户快速了解 openEuler 各类项目,本仓包含了 openEuler 社区的所有文档,包括发行说明、操作系统安装、管理员指南、虚拟化和容器的使用指导等内容。 - -## 如何查看版本分支对应关系 - -openEuler 目前提供以下两类版本: - -- 长期支持 (LTS)版本:openEuler 发布间隔周期定为2年,提供4年社区支持,在较长的时间内获得安全、维护和功能的更新。 -- 社区创新版本:每隔6个月会发布一个社区创新版本,具有最新的硬软件支持。 - -Docs 当前使用以下三类分支,长期支持版本和社区创新版本分别以 20.03 LTS SP3 和 21.09 为例: -| 分支 | 说明 | 内容呈现 | -|-----|----|----| -| master | 开发分支,为默认分支|-| -| stable2-20.03_LTS_SP3 | 20.03 LTS 版本 SP3 版本分支 | 分支内容呈现在[openEuler社区](https://openeuler.org/)网站“文档->20.03 LTS SP3” | -| stable2-21.09 | 21.09 版本分支 | 分支内容呈现在[openEuler社区](https://openeuler.org/)网站“文档->21.09” | - -## 资料清单 - -| 文档名称 | 开发类型 | 文件夹 | -|-----|----|----| -| 法律声明 | 更新 | Releasenotes | -| 发行说明 | 更新 | Releasenotes | -| 快速入门 | 更新 | Quickstart | -| 安装指南 | 更新 | Installation | -| 管理员指南 | 更新 | Administration | -| 安全加固指南 | 更新 | SecHarden | -| 虚拟化用户指南 | 更新 | Virtualization | -| StratoVirt用户指南 | 更新 | StratoVirt | -| 容器用户指南 | 更新 | Container | -| A-Tune 用户指南 | 更新 | A-Tune | -| Embedded 用户指南 | 新增 | Embedded | -| 内核热升级指南 | 更新 | KernelLiveUpgrade | -| 应用开发指南 | 更新 | ApplicationDev | -| secGear 开发指南 | 更新 | secGear | -| Kubernetes 集群部署指南 | 更新 | Kubernetes | -| 第三方软件安装指南 | 更新 | thirdparty_migration | -| 桌面环境用户指南 | 更新 | desktop | -| 工具集用户指南 | 更新 | userguide | -| A-Ops用户指南 | 更新 | A-Ops | -| 容器OS升级指南 | 新增 | KubeOS | - -## 如何在Docs中查找文档 - -进入[Docs 仓](https://gitee.com/openeuler/docs), 选择 stable2-21.09 分支,进入 “docs” 文件夹,该文件夹包含了中文(“zh”文件夹)和英文(“en”文件夹)两种语言文档,以中文文档举例进行说明。在“zh”文件夹中,“docs”文件夹包含了文档的内容,“menu”展示了具体文档与 Docs 官网目录的映射关系。 “docs” 文件夹与各手册的对应关系可参考资料清单。 - -## 如何修改文档 - -当openEuler版本信息有刷新时,这里文档也需要刷新。很感谢您愿意提供刷新内容。 -请阅读[openEuler 开源社区贡献指南](https://gitee.com/openeuler/docs/blob/master/contribute/openEuler%E5%BC%80%E6%BA%90%E7%A4%BE%E5%8C%BA%E8%B4%A1%E7%8C%AE%E6%8C%87%E5%8D%97.md)进行操作参考。 - -## 如何参与SIG - -建立或回复 issue:欢迎通过建立或回复 issue 来讨论。可选择[文档捉虫](https://docs.openeuler.org/zh/)方式快速建立 issue,可查看[活动详情](https://docs-bug.openeuler.sh/)。 - -提交PR:欢迎通过提交PR的方式参与SIG。具体操作方法可参考[PR提交指南](https://gitee.com/openeuler/community/blob/master/zh/contributors/pull-request.md)。 - -提交评论:欢迎在issue或PR中提交评论。 您也可以通过网站文档页的“意见反馈”对文档进行评论。 - -重要的事说三遍:**欢迎提交 PR!欢迎提交 PR!欢迎提交 PR!** - -## 成员 - -### Maintainer 列表 - -- amyMaYun[@amy_mayun](https://gitee.com/amy_mayun) -- hujunjune[@hujunjune](https://gitee.com/hujunjune) -- judithsq[@judithsq](https://gitee.com/judithsq) -- lizhongqian[@lizhongqian](https://gitee.com/lizhongqian) -- echo10111111[@echo10111111](https://gitee.com/echo10111111) - -### 如何联系我们 - -邮件列表: +# gala-anteater使用手册 + +gala-anteater是一款基于AI的操作系统异常检测平台。主要提供时序数据预处理、异常点发现、异常上报等功能。基于线下预训练、线上模型的增量学习与模型更新,能够很好地适应于多维多模态数据故障诊断。 + +本文主要介绍如何部署和使用gala-anteater服务。 + +## 安装 + +挂载repo源: + +```basic +[everything] +name=everything +baseurl=http://121.36.84.172/dailybuild/EBS-openEuler-24.09/EBS-openEuler-24.09/everything/$basearch/ +enabled=1 +gpgcheck=0 +priority=1 + +[EPOL] +name=EPOL +baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/EPOL/main/$basearch/ +enabled=1 +gpgcheck=0 +priority=1 + +``` + +安装gala-anteater: + +```bash +# yum install gala-anteater +``` + +## 配置 + +> 说明:gala-anteater不包含额外需要配置的config文件,其参数通过命令行的启动参数传递。 + +##### 启动参数介绍 + +| 参数项 | 参数详细名 | 类型 | 是否必须 | 默认值 | 名称 | 含义 | +|---|---|---|---|---|---|---| +| -ks | --kafka_server | string | True | | KAFKA_SERVER | Kafka Server的ip地址,如:localhost / xxx.xxx.xxx.xxx | +| -kp | --kafka_port | string | True | | KAFKA_PORT | Kafka Server的port,如:9092 | +| -ps | --prometheus_server | string | True | | PROMETHEUS_SERVER | Prometheus Server的ip地址,如:localhost / xxx.xxx.xxx.xxx | +| -pp | --prometheus_port | string | True | | PROMETHEUS_PORT | Prometheus Server的port,如:9090 | +| -m | --model | string | False | vae | MODEL | 异常检测模型,目前支持两种异常检测模型,可选(random_forest,vae)
random_forest:随机森林模型,不支持在线学习
vae:Variational Autoencoder,无监督模型,支持首次启动时,利用历史数据,进行模型更新迭代 | +| -d | --duration | int | False | 1 | DURATION | 异常检测模型执行频率(单位:分),每x分钟,检测一次 | +| -r | --retrain | bool | False | False | RETRAIN | 是否在启动时,利用历史数据,进行模型更新迭代,目前仅支持vae模型 | +| -l | --look_back | int | False | 4 | LOOK_BACK | 利用过去x天的历史数据,更新模型 | +| -t | --threshold | float | False | 0.8 | THRESHOLD | 异常检测模型的阈值:(0,1),较大的值,能够减少模型的误报率,推荐大于等于0.5 | +| -sli | --sli_time | int | False | 400 | SLI_TIME | 表示应用性能指标(单位:毫秒),较大的值,能够减少模型的误报率,推荐大于等于200
对于误报率较高的场景,推荐1000以上 | + +## 启动 + +执行如下命令启动gala-anteater +``` +systemctl start gala-anteater +``` + +### 在线训练方式运行(推荐) + +```bash +gala-anteater -ks {ip} -kp {port} -ps {ip} -pp {port} -m vae -r True -l 7 -t 0.6 -sli 400 +``` + +### 普通方式运行 +systemctl start gala-anteater +预期结果: systemctl status gala-anteater 服务启动状态为 runing + +```bash +gala-anteater -ks {ip} -kp {port} -ps {ip} -pp {port} -m vae -t 0.6 -sli 400 +``` + +### 故障注入 +gala-anteater 为故障检测与根因定位模块,测试阶段需要通过故障注入来构造故障, 从而通过故障检测和根因定位模块获得故障节点信息和故障传播根因节点 +* 故障注入(仅提供参考) + ```bash + chaosblade create disk burn --size 10 --read --write --path /var/lib/docker/overlay2/cf0a469be8a84cabe1d057216505f8d64735e9c63159e170743353a208f6c268/merged --timeout 120 + + ``` + *chaosblade 为故障注入工具, 可以模拟各种故障, 包括但不限于磁盘故障、网络故障、IO故障等待 + 备注: 通过注入不一样的故障, 指标采集器(例如 gala-gopher) 监控关联指标并上报到 promethues 模块, prometheus graph 指标图部分关联指标会存在明显波动。 + +### 查询gala-anteater服务状态 + +若日志显示如下内容,说明服务启动成功,启动日志也会保存到当前运行目录下`logs/anteater.log`文件中。 + +```log +2022-09-01 17:52:54,435 - root - INFO - Run gala_anteater main function... +2022-09-01 17:52:54,436 - root - INFO - Start to try updating global configurations by querying data from Kafka! +2022-09-01 17:52:54,994 - root - INFO - Loads metric and operators from file: xxx\metrics.csv +2022-09-01 17:52:54,997 - root - INFO - Loads metric and operators from file: xxx\metrics.csv +2022-09-01 17:52:54,998 - root - INFO - Start to re-train the model based on last day metrics dataset! +2022-09-01 17:52:54,998 - root - INFO - Get training data during 2022-08-31 17:52:00+08:00 to 2022-09-01 17:52:00+08:00! +2022-09-01 17:53:06,994 - root - INFO - Spends: 11.995422840118408 seconds to get unique machine_ids! +2022-09-01 17:53:06,995 - root - INFO - The number of unique machine ids is: 1! +2022-09-01 17:53:06,996 - root - INFO - Fetch metric values from machine: xxxx. +2022-09-01 17:53:38,385 - root - INFO - Spends: 31.3896164894104 seconds to get get all metric values! +2022-09-01 17:53:38,392 - root - INFO - The shape of training data: (17281, 136) +2022-09-01 17:53:38,444 - root - INFO - Start to execute vae model training... +2022-09-01 17:53:38,456 - root - INFO - Using cpu device +2022-09-01 17:53:38,658 - root - INFO - Epoch(s): 0 train Loss: 136.68 validate Loss: 117.00 +2022-09-01 17:53:38,852 - root - INFO - Epoch(s): 1 train Loss: 113.73 validate Loss: 110.05 +2022-09-01 17:53:39,044 - root - INFO - Epoch(s): 2 train Loss: 110.60 validate Loss: 108.76 +2022-09-01 17:53:39,235 - root - INFO - Epoch(s): 3 train Loss: 109.39 validate Loss: 106.93 +2022-09-01 17:53:39,419 - root - INFO - Epoch(s): 4 train Loss: 106.48 validate Loss: 103.37 +... +2022-09-01 17:53:57,744 - root - INFO - Epoch(s): 98 train Loss: 97.63 validate Loss: 96.76 +2022-09-01 17:53:57,945 - root - INFO - Epoch(s): 99 train Loss: 97.75 validate Loss: 96.58 +2022-09-01 17:53:57,969 - root - INFO - Schedule recurrent job with time interval 1 minute(s). +2022-09-01 17:53:57,973 - apscheduler.scheduler - INFO - Adding job tentatively -- it will be properly scheduled when the scheduler starts +2022-09-01 17:53:57,974 - apscheduler.scheduler - INFO - Added job "partial" to job store "default" +2022-09-01 17:53:57,974 - apscheduler.scheduler - INFO - Scheduler started +2022-09-01 17:53:57,975 - apscheduler.scheduler - DEBUG - Looking for jobs to run +2022-09-01 17:53:57,975 - apscheduler.scheduler - DEBUG - Next wakeup is due at 2022-09-01 17:54:57.973533+08:00 (in 59.998006 seconds) +``` + +## 输出数据 + +gala-anteater如果检测到的异常点,会将结果输出至kafka。输出数据格式如下: + +```json +{ + "Timestamp":1659075600000, + "Attributes":{ + "entity_id":"xxxxxx_sli_1513_18", + "event_id":"1659075600000_1fd37742xxxx_sli_1513_18", + "event_type":"app" + }, + "Resource":{ + "anomaly_score":1.0, + "anomaly_count":13, + "total_count":13, + "duration":60, + "anomaly_ratio":1.0, + "metric_label":{ + "machine_id":"1fd37742xxxx", + "tgid":"1513", + "conn_fd":"18" + }, + "recommend_metrics":{ + "gala_gopher_tcp_link_notack_bytes":{ + "label":{ + "__name__":"gala_gopher_tcp_link_notack_bytes", + "client_ip":"x.x.x.165", + "client_port":"51352", + "hostname":"localhost.localdomain", + "instance":"x.x.x.172:8888", + "job":"prometheus-x.x.x.172", + "machine_id":"xxxxxx", + "protocol":"2", + "role":"0", + "server_ip":"x.x.x.172", + "server_port":"8888", + "tgid":"3381701" + }, + "score":0.24421279500639545 + }, + ... + }, + "metrics":"gala_gopher_ksliprobe_recent_rtt_nsec" + }, + "SeverityText":"WARN", + "SeverityNumber":14, + "Body":"TimeStamp, WARN, APP may be impacting sli performance issues." +} +```