1.创建keystone数据库并授权
-u后面是用户名,-p后面填写密码(注意,-p不能有空格)
mysql -uroot -p
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY '123456';
2.安装、配置组件
yum install openstack-keystone httpd mod_wsgi -y
生成一个随机值在初始的配置中作为管理员的令牌。
openssl rand -hex 10
得到admin_token = xxxxxxxxx
3.编辑 /etc/keystone/keystone.conf
[DEFAULT]
admin_token = xxxxxx #输入你上面获得的令牌
[database]
connection = mysql+pymysql://keystone:123456@controller/keystone
[token]
provider = fernet
4.同步keystone数据库
su -s /bin/sh -c "keystone-manage db_sync" keystone
5.数据库初始化
keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
6.引导身份认证服务
keystone-manage bootstrap --bootstrap-password 123456 --bootstrap-admin-url http://controller:35357/v3/ --bootstrap-internal-url http://controller:5000/v3/ --bootstrap-public-url http://controller:5000/v3/ --bootstrap-region-id RegionOne