安装ceilometer

在控制节点上执行


#!/bin/bash
MYSQL_ROOT_PASSWD='m4r!adbOP'
GNOCCHI_PASSWD='gnocchi1234!'
CEILOMETER_PASSWD='ceilometer1234!'
RABBIT_PASSWD='0penstackRMQ'
AODH_PASSWD='aodh1234!'
controllerHost='controller'
OPENSTACK_RELEASE='queens'

controller-ceilometer(){
source ~/admin-openrc
openstack user create --domain default --password ${CEILOMETER_PASSWD} ceilometer
openstack role add --project service --user ceilometer admin
openstack service create --name ceilometer --description "Telemetry" metering
yum -y install  openstack-ceilometer-collector openstack-ceilometer-notification openstack-ceilometer-central python-ceilometerclient
cp /etc/ceilometer/ceilometer.conf /etc/ceilometer/ceilometer.conf_bak
openstack-config --set /etc/ceilometer/ceilometer.conf DEFAULT meter_dispatchers gnocchi
openstack-config --set /etc/ceilometer/ceilometer.conf DEFAULT event_dispatchers gnocchi
openstack-config --set /etc/ceilometer/ceilometer.conf dispatcher_gnocchi filter_service_activity False
openstack-config --set /etc/ceilometer/ceilometer.conf dispatcher_gnocchi archive_policy low
openstack-config --set /etc/ceilometer/ceilometer.conf dispatcher_gnocchi transport_url rabbit://openstack:${RABBIT_PASSWD}@${controllerHost}:5672
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials auth_uri http://${controllerHost}:5000/v3
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials auth_url http://${controllerHost}:35357/v3
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials memcached_servers ${controllerHost}:11211
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials project_domain_name default
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials user_domain_name default
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials project_name service
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials interface internalURL
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials region_name RegionOne
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials auth_type password
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials username ceilometer
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials password ${CEILOMETER_PASSWD}
openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken auth_uri http://${controllerHost}:5000/v3
openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken auth_url http://${controllerHost}:35357/v3
openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken memcached_servers ${controllerHost}:11211
openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken project_domain_name default
openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken user_domain_name default
openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken project_name service
openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken interface internalURL
openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken region_name RegionOne
openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken auth_type password
openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken username gnocchi
openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken password ${GNOCCHI_PASSWD}
ceilometer-upgrade --skip-metering-database
systemctl enable openstack-ceilometer-notification.service openstack-ceilometer-central.service
systemctl restart openstack-ceilometer-notification.service openstack-ceilometer-central.service
systemctl status openstack-ceilometer-notification.service openstack-ceilometer-central.service
echo 'export OS_AUTH_TYPE=password' >> ~/admin-openrc
source ~/admin-openrc
gnocchi status
gnocchi metric list | grep cpu
}

controller-ceilometer-interval(){
sed -i "/interval/c\      interval: 60" /etc/ceilometer/polling.yaml
systemctl restart openstack-ceilometer*
systemctl status openstack-ceilometer*
}

在计算节点上执行


#!/bin/bash
CEILOMETER_PASSWD='ceilometer1234!'
RABBIT_PASSWD='0penstackRMQ'
controllerHost='controller'
OPENSTACK_RELEASE='queens'
compute-ceilometer(){
yum -y install openstack-ceilometer-compute
cp /etc/ceilometer/ceilometer.conf /etc/ceilometer/ceilometer.conf_bak
openstack-config --set /etc/ceilometer/ceilometer.conf DEFAULT transport_url rabbit://openstack:${RABBIT_PASSWD}@${controllerHost}:5672
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials auth_url  http://${controllerHost}:5000/v3
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials memcached_servers ${controllerHost}:11211
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials project_domain_id  default
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials user_domain_id default
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials username ceilometer
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials project_name service
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials auth_type password
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials password ${CEILOMETER_PASSWD}
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials interface internalURL
openstack-config --set /etc/ceilometer/ceilometer.conf service_credentials region_name RegionOne
systemctl enable openstack-ceilometer-compute.service
systemctl restart openstack-ceilometer-compute.service
systemctl status openstack-ceilometer-compute.service
}
compute-nova-useceilometer(){
openstack-config --set /etc/nova/nova.conf DEFAULT instance_usage_audit True
openstack-config --set /etc/nova/nova.conf DEFAULT instance_usage_audit_period hour
openstack-config --set /etc/nova/nova.conf DEFAULT notify_on_state_change vm_and_task_state
openstack-config --set /etc/nova/nova.conf oslo_messaging_notifications driver messagingv2
systemctl restart openstack-nova-compute.service
systemctl status openstack-nova-compute.service
}
compute-ceilometer-interval(){
sed -i "/interval/c\      interval: 60" /etc/ceilometer/polling.yaml
systemctl restart openstack-ceilometer*
systemctl status openstack-ceilometer*
}

posted @ 2019-07-21 22:34  小白的日常  阅读(645)  评论(0编辑  收藏  举报