云计算基础设施平台iaas(openstack)超级详细搭建(十六)安装Alarm监控服务

注意:接与上一篇博客内容 进行更新
由于整个开源openstack安装过程过于繁琐,命令太长,太繁琐,于是把整个安装命令写成shell脚本。

脚本数量内容过多,已经推送自我的github源码托管中心了。
这是本篇脚本内容所在的github仓库位置
controller节点

脚本内容介绍

#!/bin/bash
source /etc/xiandian/openrc.sh
source /etc/keystone/admin-openrc.sh
mysql -uroot -p$DB_PASS -e "create database IF NOT EXISTS aodh ;"
mysql -uroot -p$DB_PASS -e "GRANT ALL PRIVILEGES ON aodh.* TO 'aodh'@'localhost' IDENTIFIED BY '$AODH_DBPASS' ;"
mysql -uroot -p$DB_PASS -e "GRANT ALL PRIVILEGES ON aodh.* TO 'aodh'@'%' IDENTIFIED BY '$AODH_DBPASS' ;"

openstack user create --domain $DOMAIN_NAME --password $AODH_PASS 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://$HOST_NAME:8042
openstack endpoint create --region RegionOne alarming internal http://$HOST_NAME:8042
openstack endpoint create --region RegionOne alarming admin http://$HOST_NAME:8042

yum install -y openstack-aodh-api openstack-aodh-evaluator openstack-aodh-notifier openstack-aodh-listener openstack-aodh-expirer pytho
n-ceilometerclient

crudini --set /etc/aodh/aodh.conf database connection mysql+pymysql://aodh:$AODH_DBPASS@$HOST_NAME/aodh
crudini --set /etc/aodh/aodh.conf DEFAULT rpc_backend rabbit
crudini --set /etc/aodh/aodh.conf oslo_messaging_rabbit rabbit_host $HOST_NAME
crudini --set /etc/aodh/aodh.conf oslo_messaging_rabbit rabbit_userid $RABBIT_USER
crudini --set /etc/aodh/aodh.conf oslo_messaging_rabbit rabbit_password  $RABBIT_PASS

crudini --set /etc/aodh/aodh.conf DEFAULT auth_strategy keystone
crudini --set /etc/aodh/aodh.conf keystone_authtoken auth_uri  http://$HOST_NAME:5000
crudini --set /etc/aodh/aodh.conf keystone_authtoken auth_url  http://$HOST_NAME:35357
crudini --set /etc/aodh/aodh.conf keystone_authtoken memcached_servers  $HOST_NAME:11211
crudini --set /etc/aodh/aodh.conf keystone_authtoken auth_type  password
crudini --set /etc/aodh/aodh.conf keystone_authtoken project_domain_name  $DOMAIN_NAME
crudini --set /etc/aodh/aodh.conf keystone_authtoken user_domain_name $DOMAIN_NAME
crudini --set /etc/aodh/aodh.conf keystone_authtoken project_name  service
crudini --set /etc/aodh/aodh.conf keystone_authtoken username  aodh
crudini --set /etc/aodh/aodh.conf keystone_authtoken password  $AODH_PASS

crudini --set /etc/aodh/aodh.conf service_credentials auth_type  password
crudini --set /etc/aodh/aodh.conf service_credentials auth_url  http://$HOST_NAME:5000/v3
crudini --set /etc/aodh/aodh.conf service_credentials project_domain_name  $DOMAIN_NAME
crudini --set /etc/aodh/aodh.conf service_credentials user_domain_name  $DOMAIN_NAME

下面是本篇内容的命令的详细操作过程(脚本中已经包含该篇命令的所有操作,但是建议还是熟悉下整个过程之后再运行脚本)

12 安装Alarm监控服务

12.1通过脚本安装alarm服务
12.2-12.8 Alarm监控服务的操作命令已经编写成shell脚本,通过脚本进行一键安装。如下:
#Controller节点
执行脚本iaas-install-alarm.sh进行安装


12.2 创建数据库
# mysql -u root -p
mysql> CREATE DATABASE aodh;
mysql> GRANT ALL PRIVILEGES ON aodh.* TO aodh@'localhost' IDENTIFIED BY '000000'; mysql> GRANT ALL PRIVILEGES ON aodh.* TO aodh@'%' IDENTIFIED BY  '000000';

12.3 创建keystone用户
openstack user create --domain default --password 000000 aodh
openstack role add --project service --user aodh admin

12.4 创建Endpoint和API
openstack service create --name aodh --description "Telemetry" alarming
openstack endpoint create --region RegionOne alarming public http://controller:8042
openstack endpoint create --region RegionOne alarming internal http://controller:8042
openstack endpoint create --region RegionOne alarming admin http://controller:8042

12.5 安装软件包
yum install -y openstack-aodh-api openstack-aodh-evaluator openstack-aodh-notifier openstack-aodh-listener openstack-aodh-expirer python-ceilometerclient
12.6 配置aodh
openstack-config --set /etc/aodh/aodh.conf database connection mysql+pymysql://aodh:000000@controller/aodh
openstack-config --set /etc/aodh/aodh.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/aodh/aodh.conf oslo_messaging_rabbit rabbit_host controller
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  000000

openstack-config --set /etc/aodh/aodh.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/aodh/aodh.conf keystone_authtoken auth_uri  http://controller:5000
openstack-config --set /etc/aodh/aodh.conf keystone_authtoken auth_url  http://controller:35357
openstack-config --set /etc/aodh/aodh.conf keystone_authtoken memcached_servers  controller: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  000000
openstack-config --set /etc/aodh/aodh.conf service_credentials auth_type  password
openstack-config --set /etc/aodh/aodh.conf service_credentials auth_url  http://controller: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  000000
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/api_paste.ini  filter:authtoken oslo_config_project aodh

12.7 同步数据库
su -s /bin/sh -c "aodh-dbsync" aodh

12.8 启动服务
systemctl enable openstack-aodh-api.service openstack-aodh-evaluator.service openstack-aodh-notifier.service openstack-aodh-listener.service
systemctl restart openstack-aodh-api.service openstack-aodh-evaluator.service openstack-aodh-notifier.service openstack-aodh-listener.service


猜你喜欢

转载自blog.csdn.net/qq_28513801/article/details/90172627