码迷,mamicode.com
首页 > 其他好文 > 详细

OpenStack Pike Minimal安装:二、身份认证

时间:2018-09-04 14:00:41      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:sep   cbe   bin   验证   oss   tst   minimal   alt   system   

1.在controller节点上安装keystone
root@controller ~]# yum install openstack-keystone httpd mod_wsgi -y

2.配置

[root@controller ~]# vim /etc/keystone/keystone.conf
[database]
connection = mysql+pymysql://keystone:keystone@controller/keystone
[token]
provider = fernet

3.填充数据库

[root@controller ~]# su -s /bin/sh -c "keystone-manage db_sync" keystone
#日志文件所处位置
[root@controller ~]# ll /var/log/keystone/keystone.log 
-rw-rw---- 1 root keystone 16062 Sep  4 01:05 /var/log/keystone/keystone.log
#查看数据库
[root@controller ~]# mysql -h controller -ukeystone -pkeystone -e "use keystone;show tables;"

4.初始化Fernet key

[root@controller ~]# keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
[root@controller ~]# keystone-manage credential_setup --keystone-user keystone --keystone-group keystone

5.初始化服务

# keystone-manage bootstrap --bootstrap-password admin \
--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

6.配置httpd

[root@controller ~]# vim /etc/httpd/conf/httpd.conf 
#修改ServerName为主机名
ServerName controller
[root@controller ~]# ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
[root@controller ~]# systemctl enable httpd.service
[root@controller ~]# systemctl start httpd.service

7.创建登陆脚本

[root@controller ~]# cat admin-openstack.sh 
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
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
[root@controller ~]# cat demo-openstack.sh 
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=demo
export OS_USERNAME=demo
export OS_PASSWORD=demo
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2

8.创建domain, projects, users, and roles

#先使用脚本登陆admin
[root@controller ~]# . admin-openstack.sh

①创建service project

openstack project create --domain default --description "Service Project" service
技术分享图片

②创建demo project

openstack project create --domain default --description "Demo Project" demo
技术分享图片

③创建demo user

openstack user create --domain default --password-prompt demo
技术分享图片

④创建 user role

openstack role create user
技术分享图片

⑤将user role添加到demo project和user

openstack role add --project demo --user demo user

9.验证操作

①注销登陆

[root@controller ~]# unset OS_AUTH_URL OS_PASSWORD

②验证admin用户

openstack --os-auth-url http://controller:35357/v3 --os-project-domain-name Default --os-user-domain-name Default --os-project-name admin --os-username admin token issue

技术分享图片

③验证demo用户

openstack --os-auth-url http://controller:5000/v3 --os-project-domain-name Default --os-user-domain-name Default --os-project-name demo --os-username demo token issue

技术分享图片
④使用脚本查看

[root@controller ~]# . admin-openstack.sh 
[root@controller ~]# openstack token issue

OpenStack Pike Minimal安装:二、身份认证

标签:sep   cbe   bin   验证   oss   tst   minimal   alt   system   

原文地址:http://blog.51cto.com/lullaby/2169980

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!