4.1 创建Keystone相关数据库
mysql -uroot -pabc-123
---
create database keystone;
grant all privileges on keystone.* to 'keystone'@'localhost' identified by 'keystone';
grant all privileges on keystone.* to 'keystone'@'%' identified by 'keystone';
flush privileges;
exit
4.2 安装配置Keystone
4.2.1 安装Keystone
yum install httpd mod_wsgi openstack-keystone python-keystoneclient openstack-utils python-openstackclient openstack-selinux -y
4.2.2 配置Keystone
openstack-config --set /etc/keystone/keystone.conf database connection mysql+pymysql://keystone:keystone@controller/keystone
openstack-config --set /etc/keystone/keystone.conf token provider fernet
---
grep '^[a-z]' /etc/keystone/keystone.conf
4.3 初始化Keystone数据库
4.3.1 同步Keystone数据库
su -s /bin/sh -c "keystone-manage db_sync" keystone
4.3.2 验证数据库
mysql -h127.0.0.1 -ukeystone -pkeystone -e "use keystone;show tables;"
4.4 初始化Fernet令牌库
keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
4.5 配置启动Apache
4.5.1 修改Apache配置文件
sed -i "s/#ServerName www.example.com:80/ServerName controller/" /etc/httpd/conf/httpd.conf
4.5.2 配置虚拟主机
ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
4.5.3 启动并且配置自启动
systemctl start httpd.service
systemctl status httpd.service
systemctl enable httpd.service
4.6 初始化Keystone认证服务
4.6.1 创建Keystone用户
keystone-manage bootstrap --bootstrap-password abc-123 --bootstrap-admin-url http://controller:5000/v3/ --bootstrap-internal-url http://controller:5000/v3/ --bootstrap-public-url http://contro