目的
1. 配置 openstack 可用的 mariadb
2. mariadb 用于存储 openstack 中的所有信息
3. 暂不以高可用为目的
安装
yum install -y mariadb*
配置
必须要设定默认字符集为 utf8, 否则无法自动创建表
注 因测试环境, 暂无对 innodb 进行优化
/etc/my.cnf
[mysql]
default_character_set=utf8
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-name-resolve
max_connections = 1000
character_set_server = utf8
user=mysql
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
启动
service mysqld restart
验证
mysql 命令能够直接登入 mysql> 终端则可
创建用户
创建 keystone 用户
create database keystone character set utf8;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' identified by 'test123';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' identified by 'test123';
flush privileges;
创建 glance 用户
create database glance character set utf8;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' identified by 'glance';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' identified by 'glance';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'127.0.0.1' identified by 'glance';
flush privileges;
创建 cinder 用户
grant all on cinder.* to 'cinder'@'localhost' identified by 'cinder';
grant all on cinder.* to 'cinder'@'240.10.130.25' identified by 'cinder';
flush privileges;
create databae cinder character set utf8;
创建 neutron 用户
create database neutron_ml2 character set utf8;
GRANT ALL PRIVILEGES ON neutron_ml2.* TO 'neutron'@'%' identified by 'openstack';
GRANT ALL PRIVILEGES ON neutron_ml2.* TO 'neutron'@'localhost' identified by 'openstack';
GRANT ALL PRIVILEGES ON neutron_ml2.* TO 'neutron'@'127.0.0.1' identified by 'openstack';
flush privileges;
创建 nova 用户
CREATE DATABASE nova character set utf8;
GRANT ALL ON nova.* TO 'nova'@'%' IDENTIFIED BY 'openstack';
GRANT ALL ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'openstack';
FLUSH PRIVILEGES;