这篇文章内容主要描述如何配置keystone
先生成一个token
[root@localhost ~]# openssl rand -hex 10
f0d1ce6d4da5928849fa
修改/etc/keystone/keystone.conf
admin_token = f0d1ce6d4da5928849fa
verbose = true
[database]
connection = mysql://keystone:keystone@192.168.1.151/keystone
# mysql://keystone:your_password_of_user_keystone@192.168.1.151/keystone
# 生产环境密码要换一下
[memcache]
servers = 192.168.1.151:11211
[revoke]
driver = sql
[token]
provider = fernet
driver = memcache
内容有点乱, 再对比一下,一共7处改动
[root@localhost ~]# cat /etc/keystone/keystone.conf|grep -v "^#"|grep -v "^$"
[DEFAULT]
admin_token = f0d1ce6d4da5928849fa
verbose = true
[assignment]
[auth]
[cache]
[catalog]
[cors]
[cors.subdomain]
[credential]
[database]
connection = mysql://keystone:keystone@192.168.1.151/keystone
[domain_config]
[endpoint_filter]
[endpoint_policy]
[eventlet_server]
[eventlet_server_ssl]
[federation]
[fernet_tokens]
[identity]
[identity_mapping]
[kvs]
[ldap]
[matchmaker_redis]
[matchmaker_ring]
[memcache]
servers = 192.168.1.151:11211
[oauth1]
[os_inherit]
[oslo_messaging_amqp]
[oslo_messaging_qpid]
[oslo_messaging_rabbit]
[oslo_middleware]
[oslo_policy]
[paste_deploy]
[policy]
[resource]
[revoke]
driver = sql
[role]
[saml]
[signing]
[ssl]
[token]
provider = fernet
driver = memcache
[tokenless_auth]
[trust]
调用
keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
创建数据库表
su -s /bin/sh -c "keystone-manage db_sync" keystone
oslo_config.cfg的错误可以忽略,另外如果你像我一样使用root用户,可以省略su -s
[root@localhost ~]# /bin/sh -c "keystone-manage db_sync" keystone
No handlers could be found for logger "oslo_config.cfg"
[root@localhost ~]#
这里会自动创建一个名为keystone的用户,密码也是keystone,测试一下登录
mysql -h 192.168.1.151 -u keystone -p
启动并且设置开机启动memcached
systemctl ena