Openstack云平台脚本部署之Aodh告警服务配置(十三)

2023-11-05

目录

一、简介

二、部署脚本

三、参考文档

四、源码

五、系列文章


一、简介

Openstack告警服务Aodh负责当收集的数据度量或事件超过所设定的阈值时,会出发报警。从Liberty 版本后从Ceilometer 中拆分出来,独立为单独的项目,Aodh告警可以出发多种形式的动作,目前已经实现的动作有HTTP回调,日志记录和 通过 Zaqar的API发送通知消息。

计量报警服务包含以下组件:

  • API服务器 (aodh-api):运行于一个或多个中心管理服务器上提供访问存储在数据中心的警告信息。
  • 报警评估器 (aodh-evaluator):运行在一个或多个中心管理服务器,当警告发生是由于相关联的统计趋势超过阈值以上的滑动时间窗口,然后作出决定。
  • 通知监听器 (aodh-listener):运行在一个中心管理服务器上,来检测什么时候发出告警。根据对一些事件预先定义一些规则,会产生相应的告警,同时能够被Telemetry数据收集服务的通知代理捕获到。
  • 报警通知器 (aodh-notifier):运行在一个或多个中心管理服务器,允许警告为一组收集的实例基于评估阀值来设置。

二、部署脚本

Aodh安装部署比较简单,在三个控制节点上安装配置即可,脚本install-configure-aodh.sh如下:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

#!/bin/sh

. ../0-set-config.sh

./style/print-split.sh "Aodh Installation"

### [所有控制节点] 安装软件

./pssh-exe C "yum install -y openstack-aodh-api openstack-aodh-evaluator openstack-aodh-notifier openstack-aodh-listener openstack aodh-expirer python-ceilometerclient"

### [所有控制节点] 修改配置文件

for ((i=0; i<${#controller_map[@]}; i+=1));

do

name=${controller_name[$i]};

ip=${controller_map[$name]};

. style/print-info.sh "Openstack configure in $name"

ssh root@$ip /bin/bash << EOF

openstack-config --set /etc/aodh/aodh.conf database connection mysql+pymysql://aodh:$password@$virtual_ip/aodh

openstack-config --set /etc/aodh/aodh.conf DEFAULT rpc_backend rabbit

openstack-config --set /etc/aodh/aodh.conf oslo_messaging_rabbit rabbit_hosts controller01:5672,controller02:5672,controller03:5672

openstack-config --set /etc/aodh/aodh.conf oslo_messaging_rabbit rabbit_ha_queues true

openstack-config --set /etc/aodh/aodh.conf oslo_messaging_rabbit rabbit_retry_interval 1

openstack-config --set /etc/aodh/aodh.conf oslo_messaging_rabbit rabbit_retry_backoff 2

openstack-config --set /etc/aodh/aodh.conf oslo_messaging_rabbit rabbit_max_retries 0

openstack-config --set /etc/aodh/aodh.conf oslo_messaging_rabbit rabbit_durable_queues true

openstack-config --set /etc/aodh/aodh.conf oslo_messaging_rabbit rabbit_userid openstack

openstack-config --set /etc/aodh/aodh.conf oslo_messaging_rabbit rabbit_password $password

openstack-config --set /etc/aodh/aodh.conf DEFAULT auth_strategy keystone

openstack-config --set /etc/aodh/aodh.conf keystone_authtoken auth_uri http://$virtual_ip:5000

openstack-config --set /etc/aodh/aodh.conf keystone_authtoken auth_url http://$virtual_ip:35357

openstack-config --set /etc/aodh/aodh.conf keystone_authtoken memcached_servers controller01:11211,controller02:11211,controller03:11211

openstack-config --set /etc/aodh/aodh.conf keystone_authtoken auth_type password

openstack-config --set /etc/aodh/aodh.conf keystone_authtoken project_domain_name default

openstack-config --set /etc/aodh/aodh.conf keystone_authtoken user_domain_name default

openstack-config --set /etc/aodh/aodh.conf keystone_authtoken project_name service

openstack-config --set /etc/aodh/aodh.conf keystone_authtoken username aodh

openstack-config --set /etc/aodh/aodh.conf keystone_authtoken password $password

openstack-config --set /etc/aodh/aodh.conf service_credentials auth_type password

openstack-config --set /etc/aodh/aodh.conf service_credentials auth_url http://$virtual_ip:5000/v3

openstack-config --set /etc/aodh/aodh.conf service_credentials project_domain_name default

openstack-config --set /etc/aodh/aodh.conf service_credentials user_domain_name default

openstack-config --set /etc/aodh/aodh.conf service_credentials project_name service

openstack-config --set /etc/aodh/aodh.conf service_credentials username aodh

openstack-config --set /etc/aodh/aodh.conf service_credentials password $password

openstack-config --set /etc/aodh/aodh.conf service_credentials interface internalURL

openstack-config --set /etc/aodh/aodh.conf service_credentials region_name RegionOne

openstack-config --set /etc/aodh/aodh.conf api host $ip

EOF

done;

### [任一节点]创建数据库

mysql -uroot -p$password_galera_root -h $virtual_ip -e "CREATE DATABASE aodh;

GRANT ALL PRIVILEGES ON aodh.* TO 'aodh'@'localhost' IDENTIFIED BY '$password';

GRANT ALL PRIVILEGES ON aodh.* TO 'aodh'@'controller01' IDENTIFIED BY '$password';

GRANT ALL PRIVILEGES ON aodh.* TO 'aodh'@'%' IDENTIFIED BY '$password';

FLUSH PRIVILEGES;"

##### generate haproxy.cfg

. ./1-gen-haproxy-cfg.sh aodh

### [controller01] 初始化数据库

su -s /bin/sh -c "aodh-dbsync" aodh

### [controller01] 创建用户、服务实体、端点

. /root/keystonerc_admin

openstack user create --domain default --password $password aodh

openstack role add --project service --user aodh admin

openstack service create --name aodh --description "Telemetry" alarming

openstack endpoint create --region RegionOne alarming public http://$virtual_ip:8042

openstack endpoint create --region RegionOne alarming internal http://$virtual_ip:8042

openstack endpoint create --region RegionOne alarming admin http://$virtual_ip:8042

### [controller01] 添加资源

pcs resource create redis redis wait_last_known_master=true --master meta notify=true ordered=true interleave=true

pcs resource create vip-redis IPaddr2 ip=$virtual_ip_redis

pcs resource create openstack-ceilometer-central systemd:openstack-ceilometer-central --clone interleave=true

pcs resource create openstack-ceilometer-collector systemd:openstack-ceilometer-collector --clone interleave=true

pcs resource create openstack-ceilometer-api systemd:openstack-ceilometer-api --clone interleave=true

pcs resource create delay Delay startdelay=10 --clone interleave=true

pcs resource create openstack-aodh-evaluator systemd:openstack-aodh-evaluator --clone interleave=true

pcs resource create openstack-aodh-notifier systemd:openstack-aodh-notifier --clone interleave=true

pcs resource create openstack-aodh-api systemd:openstack-aodh-api --clone interleave=true

pcs resource create openstack-aodh-listener systemd:openstack-aodh-listener --clone interleave=true

pcs resource create openstack-ceilometer-notification systemd:openstack-ceilometer-notification --clone interleave=true

pcs constraint order promote redis-master then start vip-redis

pcs constraint colocation add vip-redis with master redis-master

pcs constraint order start vip-redis then openstack-ceilometer-central-clone kind=Optional

pcs constraint order start mongod-clone then openstack-ceilometer-central-clone

pcs constraint order start openstack-keystone-clone then openstack-ceilometer-central-clone

pcs constraint order start openstack-ceilometer-central-clone then openstack-ceilometer-collector-clone

pcs constraint order start openstack-ceilometer-collector-clone then openstack-ceilometer-api-clone

pcs constraint colocation add openstack-ceilometer-api-clone with openstack-ceilometer-collector-clone

pcs constraint order start openstack-ceilometer-api-clone then delay-clone

pcs constraint colocation add delay-clone with openstack-ceilometer-api-clone

pcs constraint order start delay-clone then openstack-aodh-evaluator-clone

pcs constraint order start openstack-aodh-evaluator-clone then openstack-aodh-notifier-clone

pcs constraint order start openstack-aodh-notifier-clone then openstack-aodh-api-clone

pcs constraint order start openstack-aodh-api-clone then openstack-aodh-listener-clone

pcs constraint order start openstack-aodh-api-clone then openstack-ceilometer-notification-clone

pcs resource op add openstack-ceilometer-central start timeout=300

pcs resource op add openstack-ceilometer-central stop timeout=300

pcs resource op add openstack-ceilometer-collector start timeout=300

pcs resource op add openstack-ceilometer-collector stop timeout=300

pcs resource op add openstack-ceilometer-api start timeout=300

pcs resource op add openstack-ceilometer-api stop timeout=300

pcs resource op add delay start timeout=300

pcs resource op add delay stop timeout=300

pcs resource op add openstack-aodh-evaluator start timeout=300

pcs resource op add openstack-aodh-evaluator stop timeout=300

pcs resource op add openstack-aodh-notifier start timeout=300

pcs resource op add openstack-aodh-notifier stop timeout=300

pcs resource op add openstack-aodh-api start timeout=300

pcs resource op add openstack-aodh-api stop timeout=300

pcs resource op add openstack-aodh-listener start timeout=300

pcs resource op add openstack-aodh-listener stop timeout=300

pcs resource op add openstack-ceilometer-notification start timeout=300

pcs resource op add openstack-ceilometer-notification stop timeout=300

pcs resource op add mongod start timeout=300

pcs resource op add mongod stop timeout=300

. restart-pcs-cluster.sh

### [任意节点] 测试数据收集

ceilometer meter-list

三、参考文档

OpenStack Docs: Telemetry service overview

Welcome to Aodh’s documentation! — aodh 15.1.0.dev3 documentation

四、源码

脚本源码:GitHub - zjmeixinyanzhi/Openstack-HA-Install-Shells: Shell scripts for installing openstack high availability cluster

五、系列文章

Openstack云平台脚本部署”系列文章目录如下:

Openstack云平台脚本部署之概述(零)

Openstack云平台脚本部署之基础环境配置(一)

Openstack云平台脚本部署之Galera高可用集群配置(二)

Openstack云平台脚本部署之RabbitMQ高可用集群部署(三)

Openstack云平台脚本部署之MongoDB配置(四)

Openstack云平台脚本部署之Memcached配置(五)

Openstack云平台脚本部署之Keystone认证服务配置(六)

Openstack云平台脚本部署之Glance镜像服务配置(七)

Openstack云平台脚本部署之Nova计算服务配置(八)

Openstack云平台脚本部署之Neutron网络服务配置(九)

Openstack云平台脚本部署之Dashboard配置(十)

Openstack云平台脚本部署之Cinder块存储服务配置(十一)

Openstack云平台脚本部署之Ceilometer数据收集服务配置(十二)

Openstack云平台脚本部署之Aodh告警服务配置(十三)

Openstack云平台脚本部署之Ceph存储集群配置(十四)

Openstack云平台脚本部署之计算节点服务配置(十五)

Openstack云平台脚本部署之增加计算节点配置(十六)

Openstack云平台脚本部署之测试验证(十七)

Openstack云平台脚本部署之Ganglia监控(十八)

Openstack云平台脚本部署之Nagios监控(十九)

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Openstack云平台脚本部署之Aodh告警服务配置(十三) 的相关文章

  • ssh 连接超时

    我无法在 git 中 ssh 到 github bitbucket 或 gitlab 我通常会收到以下错误消息 如何避免它 输出 ssh T email protected cdn cgi l email protection i ssh
  • 找不到包“gdk-pixbuf-2.0”

    我正在尝试在 Amazon Linux 发行版实例上构建 librsvg 我已经通过 yum 安装了大部分依赖项 其中一些在实例上启用的默认 yum 存储库中不可用 因此必须从头开始构建它们 我已经走了很远 但还停留在最后一点 跑步时sud
  • SSH,运行进程然后忽略输出

    我有一个命令可以使用 SSH 并在 SSH 后运行脚本 该脚本运行一个二进制文件 脚本完成后 我可以输入任意键 本地终端将恢复到正常状态 但是 由于该进程仍在我通过 SSH 连接的计算机中运行 因此任何时候它都会登录到stdout我在本地终
  • 在 C 中使用单个消息队列是否可以实现双向通信

    我希望服务器向客户端发送一些消息 并让客户端确认它 我被分配了这个任务 我可以在 C linux 中使用单个消息队列来完成它还是我需要创建两个 谢谢 是的 可以使用 sysV 消息队列来做到这一点 从您之前的问题来看 您正在使用该队列 您可
  • docker 非 root 绑定安装权限,WITH --userns-remap

    all 尝试让绑定安装权限正常工作 我的目标是在容器中绑定安装卷 以便 a 容器不以 root 用户身份运行入口点 二 docker daemon 配置了 userns remap 这样容器 主机上没有 root c 我可以绑定挂载和读 写
  • 如何为 Linux 桌面条目文件指定带有相对路径的图标?

    对于我的一个 Linux 应用程序 我有应用程序二进制文件 一个 launcher sh 脚本 针对 LD LIBRARY PATH 和一个 desktop 文件 所有这些都位于同一文件夹中 我想使用图标的相对路径而不是绝对路径 我试过了
  • python获取上传/下载速度

    我想在我的计算机上监控上传和下载速度 一个名为 conky 的程序已经在 conky conf 中执行了以下操作 Connection quality alignr wireless link qual perc wlan0 downspe
  • 使用 \r 并打印一些文本后如何清除控制台中的一行?

    对于我当前的项目 有一些代码很慢并且我无法使其更快 为了获得一些关于已完成 必须完成多少的反馈 我创建了一个进度片段 您可以在下面看到 当你看到最后一行时 sys stdout write r100 80 n I use 80覆盖最终剩余的
  • 执行“minikube start”命令时出现问题

    malik malik minikube start minikube v1 12 0 on Ubuntu 18 04 Using the docker driver based on existing profile Starting c
  • C 语言的符号表

    我目前正在开发一种执行模式匹配的静态分析工具 我在用Flex https github com westes flex生成词法分析器 我编写了代码来管理符号表 我不太有经验C 所以我决定将符号表实现为线性链表 include
  • 如何根据标签将单个 XML 文件拆分为多个

    我有一个带有标签的 XML 文件 我想像这样分割文件
  • 为什么 fopen("any_path_name",'r') 不给出 NULL 作为返回值?

    在调试一些代码时 我得到如下内容 include
  • 并行运行 shell 脚本

    我有一个 shell 脚本 打乱大型文本文件 600 万行和 6 列 根据第一列对文件进行排序 输出 1000 个文件 所以伪代码看起来像这样 file1 sh bin bash for i in seq 1 1000 do Generat
  • CMake 链接 glfw3 lib 错误

    我正在使用 CLion 并且正在使用 glfw3 库编写一个程序 http www glfw org docs latest http www glfw org docs latest 我安装并正确执行了库中的所有操作 我有 a 和 h 文
  • 使用 MAX_ORDER / 包含 mmzone.h

    根据https www kernel org doc Documentation networking packet mmap txt https www kernel org doc Documentation networking pa
  • Bash - 在与当前终端分开的另一个终端中启动命令的新实例

    我有一个简单的 bash 脚本 test sh 设置如下 bin bash args if args 0 check capture then watch n 1 ls lag home user capture0 watch n 1 ls
  • 静态方法的 Java 内存模型

    我来自操作系统和 C 语言背景 在代码编译时 世界很简单 需要处理和理解堆栈 堆文本部分等 当我开始学习 Java 时 我确实了解 JVM 和垃圾收集器 我对静态方法感到很有趣 根据我的理解 类的所有实例都会在堆中创建 然后被清理 但是 对
  • 使用 python 脚本更改 shell 中的工作目录

    我想实现一个用户态命令 它将采用其参数之一 路径 并将目录更改为该目录 程序完成后 我希望 shell 位于该目录中 所以我想实施cd命令 但需要外部程序 可以在 python 脚本中完成还是我必须编写 bash 包装器 Example t
  • 如何让 Node.js 作为后台进程运行并且永不死掉?

    我通过 putty SSH 连接到 linux 服务器 我尝试将其作为后台进程运行 如下所示 node server js 然而 2 5 小时后 终端变得不活动 进程终止 即使终端断开连接 我是否也可以使进程保持活动状态 Edit 1 事实
  • 复制目录内容

    我想将目录 tmp1 的内容复制到另一个目录 tmp2 tmp1 可能包含文件和其他目录 我想使用C C 复制tmp1的内容 包括模式 如果 tmp1 包含目录树 我想递归复制它们 最简单的解决方案是什么 我找到了一个解决方案来打开目录并读

随机推荐

  • Unity Rotate鼠标控制人物旋转

    添加碰撞盒 一定要添加碰撞盒才能响应鼠标事件 将碰撞盒复制给骨架 如果鼠标划动的向量 X轴大于Y轴 则是左右划动 让它旋转 SpinWithMouse using System Collections using System Collec
  • 窗体,组件,事件

    窗体对象JFrame package frame import javax swing public class JFrameTest public static void main String args 创建窗体对象 JFrame jF
  • 使用javacv中的ffmpeg实现录屏,结果连运行都失败了,现在终于解决了

    前言 今天突发奇想 想自己写一个录屏的软件 上次写了一个专门录音的Demo 但是要把声音和视频放到一起合成一个mp4文件 着实有一点艰难 所以就打算使用ffmpeg来写一个 而这篇博客中会顺便谈一谈我碰到的各种坑 ffmpeg是一个c 程序
  • 中兴EPON OLT-C300开局配置

    一 基础配置 1 自定义时间 clock set hh mm ss Apr 8 2018 con t username zte password zte privilege 15 用户名密码 2 自定义名称 hostname CeShi O
  • js如何进行数组去重?

    1 数组反转 使用 reverse 实现数组反转 const arr 1 2 3 console log arr 1 2 3 arr reverse console log arr 3 2 1 2 数组去重 1 new Set array
  • python学习语法中与c语言不同之处(1)

    一 发现使用打印使用的是print 而在C语言中我们更多的使用的是printf 比如想要打印出来hello world 直接如下 C语言 printf a d a python语言 print hello world 然后就是直接回车键就可
  • angular表单验证

    表单验证 通常 我们都需要对用户的表单输入做验证 以保证数据的整体质量 Angular也有两种验证表单的形式 使用属性验证 用于模板驱动表单 使用验证器函数进行验证 用于响应式表单 验证器 Validator 函数 验证器函数可以是同步函数
  • 13功能之C++类默认生成的六个成员函数的自定义

    13功能之C 类默认生成的六个成员函数的自定义 1 代码理解即可 pragma warning disable 4996 include
  • UGUI之rectTransform属性

    RectTransform 本文转载自uGUI知识点剖析之RectTransform 一 基本要点 RectTransform继承于Transform 在 Transform 基础上 RectTransform 增加了 轴心 pivot 锚
  • 【文献翻译】构建网络安全知识库的框架-A Framework to Construct Knowledge Base for Cyber Security

    摘要 现在有一些针对不同方面的独立网络安全知识库 在互联网上 也有很多网络安全相关的内容以文字的形式存在 融合这些网络安全相关信息可以是一项有意义的工作 在本文中 我们提出了一个框架来整合现有的网络安全知识库并从文本中提取网络安全相关信息
  • java8日期时间相关

    java8时间相关api 一 java8时间相关api出现的原因 二 LocalDate LocalTime LocalDateTime的使用 1 解释 2 学习点 3 代码示例 三 Instant 1 解释 2 学习点 3 代码示例 四
  • Ubuntu下的CUDA编程(二)

    Ubuntu下cuda编程的基本过程 一 运行程序 按照上一篇文章所述 安装好cuda软件以后 就可以使用 nvcc V 命令查看所用到的编译器版本 本人用版本信息来自 Cuda compilation tools release 3 2
  • python学习——如何求质数/素数

    质数判断 方法一 一个大于1的自然数 除了1和它本身外 不能被其他自然数 质数 整除 2 3 5 7等 换句话说就是该数除了1和它本身以外不再有其他的因数 也就是说 从2到n 1遍历 如果存在一个数是这个整数n的因数 那么它就不是质数 但是
  • docker保存镜像到本地,并加载本地镜像文件

    docker保存镜像到本地 并加载本地镜像文件 1 查看已有的镜像文件 docker images 显示效果如下所示 2 将镜像打包成本地文件 指令 docker save 镜像id gt 文件名 tar docker save 17282
  • COCO数据集的下载、介绍及如何使用(数据载入及数据增广,含代码)

    如何使用COCO数据集 COCO数据集可以说是语义分割等计算机视觉任务中应用较为广泛的一个数据集 具体可以应用到物体识别 语义分割及目标检测等方面 我是在做语义分割方面任务时用到了COCO数据集 但本文主要讲解的是数据载入方面 因此可以通用
  • springboot 微信小程序 对接微信支付功能(完整版)

    微信小程序对接微信支付功能 业务流程时序图 JAVA版 1 项目架构 2 pom xml配置文件 3 小程序账号参数配置类 4 JAVA 通用代码 4 1 工具类 4 1 1 IdGen id生成类 4 1 2 Render 响应结果类 4
  • Springboot

    0 学习目标 了解SpringBoot的作用 掌握java配置的方式 了解SpringBoot自动配置原理 掌握SpringBoot的基本使用 了解Thymeleaf的基本使用 1 了解SpringBoot 在这一部分 我们主要了解以下3个
  • CUDA编程第四章: 全局内存

    前言 本章内容 学习CUDA内存模型 CUDA内存管理 全局内存编程 探索全局内存访问模式 研究全局内存数据布局 统一内存编程 最大限度地提高全局内存吞吐量 在上一章中 你已经了解了线程是如何在GPU中执行的 以及如何通过操作线程束来优化核
  • 【Seq2Seq】压缩填充序列、掩蔽、推理和 BLEU

    大家好 我是Sonhhxg 柒 希望你看完之后 能对你有所帮助 不足请指正 共同学习交流 个人主页 Sonhhxg 柒的博客 CSDN博客 欢迎各位 点赞 收藏 留言 系列专栏 机器学习 ML 自然语言处理 NLP 深度学习 DL fore
  • Openstack云平台脚本部署之Aodh告警服务配置(十三)

    目录 一 简介 二 部署脚本 三 参考文档 四 源码 五 系列文章 一 简介 Openstack告警服务Aodh负责当收集的数据度量或事件超过所设定的阈值时 会出发报警 从Liberty 版本后从Ceilometer 中拆分出来 独立为单独