11.OpenStack 安装监控和业务流程服务
安装业务流程模块
安装和配置业务流程
创建数据库
mysql -uroot -ptoyo123 CREATE DATABASE heat; GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'localhost' \ IDENTIFIED BY 'toyo123'; GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'%' \ IDENTIFIED BY 'toyo123'; exit
创建服务凭据
keystone user-create --name heat --pass Abcd1234 keystone user-role-add --user heat --tenant service --role admin keystone role-create --name heat_stack_owner keystone user-role-add --user demo --tenant demo --role heat_stack_owner keystone role-create --name heat_stack_user keystone service-create --name heat --type orchestration \ --description "Orchestration" keystone endpoint-create \ --service-id $(keystone service-list | awk '/ orchestration / {print $2}') \ --publicurl http://controller:8004/v1/%\(tenant_id\)s \ --internalurl http://controller:8004/v1/%\(tenant_id\)s \ --adminurl http://controller:8004/v1/%\(tenant_id\)s \ --region regionOne
安装和配置业务流程组件
yum install -y openstack-heat-api openstack-heat-api-cfn openstack-heat-engine python-heatclient
编辑/etc/heat/heat.conf
mv /etc/heat/heat.conf /etc/heat/heat.conf_bak vim /etc/heat/heat.conf [database] connection = mysql://heat:toyo123@controller/heat [DEFAULT] rpc_backend = rabbit rabbit_host = controller rabbit_password = Abcd1234 heat_metadata_server_url = http://controller:8000 heat_waitcondition_server_url = http://controller:8000/v1/waitcondition verbose = True [keystone_authtoken] auth_uri = http://controller:5000/v2.0 identity_uri = http://controller:35357 admin_tenant_name = service admin_user = heat admin_password = Abcd1234 [ec2authtoken] auth_uri = http://controller:5000/v2.0
填充数据库,启动服务并设置为开机自启动
su -s /bin/sh -c "heat-manage db_sync" heat systemctl enable openstack-heat-api.service openstack-heat-api-cfn.service \ openstack-heat-engine.service systemctl start openstack-heat-api.service openstack-heat-api-cfn.service \ openstack-heat-engine.service
安装模块监控
yum install -y mongodb-server mongodb
编辑/etc/mongodb.conf
vim /etc/mongodb.conf bind_ip = 192.168.116.8 smallfiles = true
启动服务并设置为开机自启动
systemctl enable mongod.service
systemctl start mongod.service
创建云高仪
数据库
mongo --host controller --eval ' db = db.getSiblingDB("ceilometer"); db.addUser({user: "ceilometer", pwd: "toyo123", roles: [ "readWrite", "dbAdmin" ]})'
创建服务凭据
source admin-openrc.sh keystone user-create --name ceilometer --pass Abcd1234 keystone user-role-add --user ceilometer --tenant service --role admin keystone service-create --name ceilometer --type metering \ --description "Telemetry" keystone endpoint-create \ --service-id $(keystone service-list | awk '/ metering / {print $2}') \ --publicurl http://controller:8777 \ --internalurl http://controller:8777 \ --adminurl http://controller:8777 \ --region regionOne
安装和配置
模块监控组件
yum install -y openstack-ceilometer-api openstack-ceilometer-collector \ openstack-ceilometer-notification openstack-ceilometer-central openstack-ceilometer-alarm \ python-ceilometerclient
生成随机密码
openssl rand -hex 10 e254b69bbb58de5dcf90
编辑
/etc/ceilometer/ceilometer.conf
mv /etc/ceilometer/ceilometer.conf /etc/ceilometer/ceilometer.conf_bak vim /etc/ceilometer/ceilometer.conf [database] connection = mongodb://ceilometer:toyo123@controller:27017/ceilometer [DEFAULT] rpc_backend = rabbit rabbit_host = controller rabbit_password = Abcd1234 auth_strategy = keystone verbose = True [keystone_authtoken] auth_uri = http://controller:5000/v2.0 identity_uri = http://controller:35357 admin_tenant_name = service admin_user = ceilometer admin_password = Abcd1234 [service_credentials] os_auth_url = http://controller:5000/v2.0 os_username = ceilometer os_tenant_name = service os_password = Abcd1234 [publisher] metering_secret = e254b69bbb58de5dcf90
启动服务并设置为开机自启动
systemctl enable openstack-ceilometer-api.service openstack-ceilometer-notification.service \ openstack-ceilometer-central.service openstack-ceilometer-collector.service \ openstack-ceilometer-alarm-evaluator.service openstack-ceilometer-alarm-notifier.service systemctl start openstack-ceilometer-api.service openstack-ceilometer-notification.service \ openstack-ceilometer-central.service openstack-ceilometer-collector.service \ openstack-ceilometer-alarm-evaluator.service openstack-ceilometer-alarm-notifier.service
配置计算服务
yum install -y openstack-ceilometer-compute python-ceilometerclient python-pecan
编辑
/etc/ceilometer/ceilometer.conf
mv /etc/ceilometer/ceilometer.conf /etc/ceilometer/ceilometer.conf_bak vim /etc/ceilometer/ceilometer.conf [publisher] metering_secret = e254b69bbb58de5dcf90 [DEFAULT] rabbit_host = controller rabbit_password = Abcd1234 verbose = True instance_usage_audit = True instance_usage_audit_period = hour notify_on_state_change = vm_and_task_state notification_driver = messagingv2 [keystone_authtoken] auth_uri = http://controller:5000/v2.0 identity_uri = http://controller:35357 admin_tenant_name = service admin_user = ceilometer admin_password = Abcd1234 [service_credentials] os_auth_url = http://controller:5000/v2.0 os_username = ceilometer os_tenant_name = service os_password = Abcd1234 os_endpoint_type = internalURL os_region_name = regionOne
编辑
/etc/nova/nova.conf
vim /etc/nova/nova.conf [DEFAULT] instance_usage_audit = True instance_usage_audit_period = hour notify_on_state_change = vm_and_task_state notification_driver = messagingv2
启动服务并设置为开机自启动
systemctl enable openstack-ceilometer-compute.service systemctl start openstack-ceilometer-compute.service systemctl restart openstack-nova-compute.service