18.OpenStack-Ocata 监测告警服务aodh

当收集到的测量或事件数据符合预定义的规则时,监测告警服务就会触发告警。

在控制器节点上安装和配置Telemetry Alarming服务aodh。

至少安装了以下组件:计算、图像服务、身份。

先决条件

要创建数据库,请完成以下步骤:

使用数据库访问客户端连接到数据库服务器作为root用户:

mysql -u root -p

创建aodh数据库:

CREATE DATABASE aodh;

aodh数据库授予权限:

GRANT ALL PRIVILEGES ON aodh.* TO 'aodh'@'localhost' IDENTIFIED BY 'AODH_DBPASS';
GRANT ALL PRIVILEGES ON aodh.* TO 'aodh'@'%' IDENTIFIED BY 'AODH_DBPASS';

图片[1]-18.OpenStack-Ocata 监测告警服务aodh-萨林博客

退出数据库;

. admin-openrc

要创建服务凭证,请完成以下步骤:

创建aodh用户:

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

图片[2]-18.OpenStack-Ocata 监测告警服务aodh-萨林博客

添加adminaodh用户:

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

创建aodh服务实体:

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

图片[3]-18.OpenStack-Ocata 监测告警服务aodh-萨林博客

创建报警服务 API 端点:

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

图片[4]-18.OpenStack-Ocata 监测告警服务aodh-萨林博客

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

图片[5]-18.OpenStack-Ocata 监测告警服务aodh-萨林博客

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

图片[6]-18.OpenStack-Ocata 监测告警服务aodh-萨林博客

安装和配置组件

安装软件包:

yum install -y openstack-aodh-api openstack-aodh-evaluator openstack-aodh-notifier openstack-aodh-listener openstack-aodh-expirer python-aodhclient

编辑/etc/aodh/aodh.conf文件

vim /etc/aodh/aodh.conf

[database]部分,配置数据库访问:

[database]
connection = mysql+pymysql://aodh:AODH_DBPASS@controller/aodh

图片[7]-18.OpenStack-Ocata 监测告警服务aodh-萨林博客

[DEFAULT]部分,配置RabbitMQ消息队列访问:

[DEFAULT]
transport_url = rabbit://openstack:RABBIT_PASS@controller

[DEFAULT][keystone_authtoken]部分,配置身份服务访问:

[DEFAULT]
auth_strategy = keystone

图片[8]-18.OpenStack-Ocata 监测告警服务aodh-萨林博客

[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = aodh
password = AODH_PASS

图片[9]-18.OpenStack-Ocata 监测告警服务aodh-萨林博客

[service_credentials]部分,配置服务凭据:

[service_credentials]
auth_type = password
auth_url = http://controller:5000/v3
project_domain_name = default
user_domain_name = default
project_name = service
username = aodh
password = AODH_PASS
interface = internalURL
region_name = RegionOne

图片[10]-18.OpenStack-Ocata 监测告警服务aodh-萨林博客

初始化数据库:

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

图片[11]-18.OpenStack-Ocata 监测告警服务aodh-萨林博客

完成安装

启动 Telemetry Alarming 服务并将它们配置开机时启动:

systemctl enable openstack-aodh-api.service openstack-aodh-evaluator.service openstack-aodh-notifier.service openstack-aodh-listener.service
systemctl start openstack-aodh-api.service openstack-aodh-evaluator.service openstack-aodh-notifier.service openstack-aodh-listener.service

图片[12]-18.OpenStack-Ocata 监测告警服务aodh-萨林博客

图片[13]-18.OpenStack-Ocata 监测告警服务aodh-萨林博客

© 版权声明
THE END
喜欢就支持一下吧
点赞17 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容