12.OpenStack镜像和存储服务配置
配置镜像服务
编辑
/etc/glance/glance-api.conf
与
/etc/glance/glance-registry.conf添加以下内容
[DEFAULT] notification_driver = messagingv2 rpc_backend = rabbit rabbit_host = controller rabbit_password = Abcd1234
重启服务
systemctl restart openstack-glance-api.service openstack-glance-registry.service
配置块存储服务
编辑
/etc/cinder/cinder.conf
vim /etc/cinder/cinder.conf [DEFAULT] control_exchange = cinder notification_driver = messagingv2
重启服务
systemctl restart openstack-cinder-api.service openstack-cinder-scheduler.service
systemctl restart openstack-cinder-volume.service
配置对象存储服务
添加ceilometer用户
source admin-openrc.sh keystone role-create --name ResellerAdmin keystone user-role-add --tenant service --user ceilometer \ --role ResellerAdmin的id号
编辑
/etc/swift/proxy-server.conf
vim /etc/swift/proxy-server.conf [filter:keystoneauth] operator_roles = admin,_member_,ResellerAdmin [pipeline:main] pipeline = authtoken cache healthcheck keystoneauth proxy-logging ceilometer proxy-server [filter:ceilometer] use = egg:ceilometer#swift log_level = WARN
加入SWIFT系统用户并重启服务
usermod -a -G ceilometer swift
systemctl restart openstack-swift-proxy.service
验证
source admin-openrc.sh ceilometer meter-list glance image-download "cirros-0.3.3-x86_64" > cirros.img ceilometer meter-list ceilometer statistics -m image.download -p 60
安装数据库服务
安装程序包
yum install -y openstack-trove python-troveclient
创建用户
source ~/admin-openrc.sh keystone user-create --name trove --pass Abcd1234 keystone user-role-add --user trove --tenant service --role admin
编辑trove.conf trove-taskmanager.conf trove-conductor.conf
[DEFAULT] log_dir = /var/log/trove trove_auth_url = http://controller:5000/v2.0 nova_compute_url = http://controller:8774/v2 cinder_url = http://controller:8776/v1 swift_url = http://controller:8080/v1/AUTH_ sql_connection = mysql://trove:toyo123@controller/trove notifier_queue_hostname = controller rpc_backend = rabbit rabbit_host = controller rabbit_password = Abcd1234
获取 api-paste.ini 保存在 /etc/trove目录下
wget http://git.openstack.org/cgit/openstack/trove/plain/etc/trove/api-paste.ini?h=stable/juno mv api-paste.ini\?h\=stable%2Fjuno /etc/trove/api-paste.ini
编辑api-paste.ini
vim /etc/trove/api-paste.ini [filter:authtoken] auth_uri = http://controller:5000/v2.0 identity_uri = http://controller:35357 admin_user = trove admin_password = Abcd1234 admin_tenant_name = service signing_dir = /var/cache/trove
编辑
trove.conf
mv /etc/trove/trove.conf /etc/trove/trove.conf_bak vim /etc/trove/trove.conf [DEFAULT] default_datastore = mysql # Config option for showing the IP address that nova doles out add_addresses = True network_label_regex = ^NETWORK_LABEL$ api_paste_config = /etc/trove/api-paste.ini
编辑
/etc/trove/trove-taskmanager.conf
mv /etc/trove/trove-taskmanager.conf /etc/trove/trove-taskmanager.conf_bak vim /etc/trove/trove-taskmanager.conf [DEFAULT] nova_proxy_admin_user = admin nova_proxy_admin_pass = Abcd1234 nova_proxy_admin_tenant_name = service taskmanager_manager = trove.taskmanager.manager.Manager
配置数据库
mysql -uroot -ptoyo123 CREATE DATABASE trove; GRANT ALL PRIVILEGES ON trove.* TO trove@'localhost' \ IDENTIFIED BY 'toyo123'; GRANT ALL PRIVILEGES ON trove.* TO trove@'%' \ IDENTIFIED BY 'toyo123';
填充数据库
su -s /bin/sh -c "trove-manage db_sync" trove su -s /bin/sh -c "trove-manage datastore_update mysql ''" trove
创建并编辑trove-guestagent.conf
vim /etc/trove/trove-guestagent.conf [DEFAULT] rabbit_host = controller rabbit_password = Abcd1234 nova_proxy_admin_user = admin nova_proxy_admin_pass = Abcd1234 nova_proxy_admin_tenant_name = service trove_auth_url = http://controller:35357/v2.0
更新数据存储使用新的图像,使用 trove-manage管理的命令
trove-manage --config-file /etc/trove/trove.conf datastore_version_update \ mysql mysql-5.5 mysql glance_image_ID mysql-server-5.5 1
注册服务
source ~/admin-openrc.sh keystone service-create --name trove --type database \ --description "OpenStack Database Service" keystone endpoint-create \ --service-id $(keystone service-list | awk '/ trove / {print $2}') \ --publicurl http://controller:8779/v1.0/%\(tenant_id\)s \ --internalurl http://controller:8779/v1.0/%\(tenant_id\)s \ --adminurl http://controller:8779/v1.0/%\(tenant_id\)s \ --region regionOne
启动服务并设置开机自启动
systemctl enable openstack-trove-api.service openstack-trove-taskmanager.service \ openstack-trove-conductor.service systemctl restart openstack-trove-api.service openstack-trove-taskmanager.service \ openstack-trove-conductor.service
验证
source ~/demo-openrc.sh trove list