在 Oracle® Solaris 中安装和配置 OpenStack (Kilo)

退出打印视图

更新时间: 2016 年 6 月
 
 

安装 MySQL

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

如何安装 MySQL 数据库

  1. 启用 RabbitMQ 服务。
    controller# svcadm enable rabbitmq
    controller# svcadm restart rad:local
  2. (u53ef选) 如果要将专用 IP 地址用于管理和 API 通信,并且在 /etc/mysql/5.5/my.cnf 中添加该地址:
    bind-address=$CONTROLLER_ADMIN_NODE_IP
  3. 启用 MySQL 服务。
    controller# svcadm enable mysql
  4. 设置 MySQL 服务器 root 口令。
    controller# mysqladmin -u root password MySQL-root-password
  5. 配置 MySQL。

    创建 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