许多 OpenStack 服务维护一个数据库来跟踪重要资源、使用情况和其他信息。尤其是对于多节点配置,请使用数据库(如 MySQL 数据库)存储此信息。
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