许多 OpenStack 服务维护一个数据库来跟踪重要资源、使用情况和其他信息。缺省情况下,针对此目的指定了单独的 SQLite 数据库,此数据库对于单节点配置很有用。对于多节点配置,特别是在生产环境中,建议使用其他数据库(如 MySQL 数据库)存储此信息。
OpenStack 服务之间的通信通过高级消息排队协议 (Advanced Message Queuing Protocol, AMQP) 执行。在 Oracle Solaris 中,AMQP 通过 RabbitMQ 实现。RabbitMQ 是一项必需的服务。通常会在云中单独配置一个节点来运行 RabbitMQ。在此体系结构中,RabbitMQ 配置为在控制器节点上运行。
controller# svcadm enable rabbitmq controller# svcadm restart rad:local
bind-address=$CONTROLLER_ADMIN_NODE_IP
controller# svcadm enable mysql
controller# mysqladmin -u root password MySQL-root-password
创建 OpenStack 将使用的表。向控制器节点上的服务授予特权,以便提供对于这些数据库的独占访问。
controller# mysql -u root -p Enter password: MySQL-root-password mysql> drop database if exists nova; mysql> drop database if exists cinder; mysql> drop database if exists glance; mysql> drop database if exists keystone; mysql> drop database if exists neutron; mysql> drop database if exists heat; mysql> create database cinder default character set utf8 default collate utf8_general_ci; mysql> grant all privileges on cinder.* to 'cinder'@'$CONTROLLER_ADMIN_NODE' identified by 'service-password'; mysql> create database glance default character set utf8 default collate utf8_general_ci; mysql> grant all privileges on glance.* to 'glance'@'$CONTROLLER_ADMIN_NODE' identified by 'service-password'; mysql> create database keystone default character set utf8 default collate utf8_general_ci; mysql> grant all privileges on keystone.* to 'keystone'@'$CONTROLLER_ADMIN_NODE' identified by 'service-password'; mysql> create database nova default character set utf8 default collate utf8_general_ci; mysql> grant all privileges on nova.* to 'nova'@'$CONTROLLER_ADMIN_NODE' identified by 'service-password'; mysql> create database neutron default character set utf8 default collate utf8_general_ci; mysql> grant all privileges on neutron.* to 'neutron'@'$CONTROLLER_ADMIN_NODE' identified by 'service-password'; mysql> create database heat default character set utf8 default collate utf8_general_ci; mysql> grant all privileges on heat.* to 'heat'@'$CONTROLLER_ADMIN_NODE' identified by 'service-password'; mysql> flush privileges; mysql> quit