KEYSTONE服务安装配置(controller)
##1. 创建数据库
mysql
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'KEYSTONE_DBPASS';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'KEYSTONE_DBPASS';
flush privileges;
exit
###2.安装和配置部件
yum --enablerepo=centos-openstack-train,epel -y install openstack-keystone openstack-utils python-openstackclient httpd mod_wsgi
###3.keystone.conf
[root@controller ~]# egrep -v "^$|^#" /etc/keystone/keystone.conf
[DEFAULT]
[application_credential]
[assignment]
[auth]
[cache]
memcache_servers = 10.0.0.10:11211
[catalog]
[cors]
[credential]
[database]
connection = mysql+pymysql://keystone:password@10.0.0.10/keystone
[domain_config]
[endpoint_filter]
[endpoint_policy]
[eventlet_server]
[federation]
[fernet_receipts]
[fernet_tokens]
[healthcheck]
[identity]
[identity_mapping]
[jwt_tokens]
[ldap]
[memcache]
[oauth1]
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_middleware]
[oslo_policy]
[policy]
[profiler]
[receipt]
[resource]
[revoke]
[role]
[saml]
[security_compliance]
[shadow_users]
[token]
provider = fernet
[tokenless_auth]
[totp]
[trust]
[unified_limit]
[wsgi]
###4.填充身份服务数据库
su -s /bin/sh -c "keystone-manage db_sync" keystone
###5.初始化Fernet密钥存储库
keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
###6.keystone身份认证bootstrap
keystone-manage bootstrap --bootstrap-password ADMIN_PASS \
--bootstrap-admin-url http://controller:5000/v3/ \
--bootstrap-internal-url http://controller:5000/v3/ \
--bootstrap-public-url http://controller:5000/v3/ \
--bootstrap-region-id RegionOne
###7.编辑/etc/httpd/conf/httpd.conf文件
###添加
ServerName controller
###8.
ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
###9.重启http
systemctl enable httpd.service
systemctl start httpd.service
2.验证
####1.创建openrc脚本
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN_PASS
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
export PS1='[\u@\h \W(keystone)]\$ '
###2.创建域,项目
openstack domain create --description "An Example Domain" example
openstack project create --domain default --description "Service Project" service
[root@controller ~(keystone)]# openstack domain create --description "An Example Domain" example
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | An Example Domain |
| enabled | True |
| id | b34586f5842541cfb1f6e84dba350c91 |
| name | example |
| options | {} |
| tags | [] |
+-------------+----------------------------------+
[root@controller ~(keystone)]# openstack project list
+----------------------------------+---------+
| ID | Name |
+----------------------------------+---------+
| c40f2fcf5b214fa1a36748d83aa73209 | service |
| e9db9fb01cfb4edea4390d6f66c49038 | admin |
+----------------------------------+---------+
[root@controller ~(keystone)]# openstack project show c40f2fcf5b214fa1a36748d83aa73209
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | Service Project |
| domain_id | default |
| enabled | True |
| id | c40f2fcf5b214fa1a36748d83aa73209 |
| is_domain | False |
| name | service |
| options | {} |
| parent_id | default |
| tags | [] |
+-------------+----------------------------------+
[root@controller ~(keystone)]# openstack token issue
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| expires | 2020-08-20T08:32:59+0000 |
| id | gAAAAABfPicrshuspD_ZOmMlgqAJyUgR1MR_ezOzWthl7Vwrp2O_E8S8YrIlQORjb5YKyEDBhGXK0M8B-oZl8xzV7WcFiXqtZnlt8nvFvspSbGwl4mtygrzmekwDfJolFV4OmXQj014qr7pzcFAe2o_C2UEko2MLt4SMMW4adnDVo9Q8ovOfgsQ |
| project_id | e9db9fb01cfb4edea4390d6f66c49038 |
| user_id | e8d9593bbed14173a3b5e62d9a3a534b |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
至此,keystone部分,ok!