标签:sep cbe bin 验证 oss tst minimal alt system
1.在controller节点上安装keystoneroot@controller ~]# yum install openstack-keystone httpd mod_wsgi -y
[root@controller ~]# vim /etc/keystone/keystone.conf
[database]
connection = mysql+pymysql://keystone:keystone@controller/keystone
[token]
provider = fernet
[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;"
[root@controller ~]# keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
[root@controller ~]# keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
# 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
[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
[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
#先使用脚本登陆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
①注销登陆
[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