openstack安装笔记 keystone(一)

安装keystone

rpm --import RPM-GPG-KEY-RDO-Icehouse
yum install -y openstack-keystone openstack-utils

开始需要两个环境变量

export SERVICE_TOKEN=$(openssl rand -hex 10)
echo $SERVICE_TOKEN >/root/ks_admin_token
export SERVICE_TOKEN=`cat /root/ks_admin_token`
export SERVICE_ENDPOINT=http://172.16.21.233:35357/v2.0

cat keystone_admin
export OS_USERNAME=admin
export OS_TENANT_NAME=admin
export OS_PASSWORD=openstack
export OS_AUTH_URL=http://192.168.1.233:35357/v2.0/
export PS1='[\u@\h \W(keystone_admin)]\$

. keystone_admin



vim /etc/keystone/keystone.conf

openstack-config --set /etc/keystone/keystone.conf DEFAULT admin_token $SERVICE_TOKEN
openstack-config --set /etc/keystone/keystone.conf token provider keystone.token.providers.uuid.Provider
openstack-config --set /etc/keystone/keystone.conf sql connection mysql://keystone:keystone@172.16.21.233/keystone
openstack-db --init --service keystone --password keystone --rootpw openstack

chown -R keystone:keystone /etc/keystone
/etc/init.d/openstack-keystone start
chkconfig openstack-keystone on


role表默认有一条数据
migrate_version默认有一条数据
domain默认有一条数据(或者是建完user加的,不确定。。。。)

[code="java"]
# keystone service-create --name=keystone --type=identity --description="Keystone Identity Service"
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | Keystone Identity Service |
| id | f4bee3cd979c45bd8313cc9464168190 |
| name | keystone |
| type | identity |
+-------------+----------------------------------+
[/code]
----haoning:这个会写 数据库service表
[code="java"]
# keystone endpoint-create --service keystone --publicurl 'http://172.16.21.233:5000/v2.0' --adminurl 'http://172.16.21.233:35357/v2.0' --internalurl 'http://172.16.21.233:5000/v2.0' --region beijing
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| adminurl | http://172.16.21.233:35357/v2.0 |
| id | 62c2694bfcaf4d85a82c7115f61d8e41 |
| internalurl | http://172.16.21.233:5000/v2.0 |
| publicurl | http://172.16.21.233:5000/v2.0 |
| region | beijing |
| service_id | f4bee3cd979c45bd8313cc9464168190 |
+-------------+----------------------------------+
#
[/code]
这里endpoint会写入三条数据
serivce_id和上一个的id相关联

[code="java"]
# keystone user-create --name admin --pass openstack
+----------+----------------------------------+
| Property | Value |
+----------+----------------------------------+
| email | |
| enabled | True |
| id | 7a20c7e0d027483991675465be1eb9d0 |
| name | admin |
| username | admin |
+----------+----------------------------------+
#
[/code]
user表加了一条数据

[code="java"]
# keystone role-create --name admin
+----------+----------------------------------+
| Property | Value |
+----------+----------------------------------+
| id | 23cf4e66fe3445afbb65af9c614efb91 |
| name | admin |
+----------+----------------------------------+
#
[/code]
role表会加一条数据,原来默认就有一条了
[code="java"]
# keystone tenant-create --name admin
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | |
| enabled | True |
| id | c5cac2c737b0401b90e07a0542fa42c4 |
| name | admin |
+-------------+----------------------------------+
#
[/code]
project表会加一条数据

keystone user-role-add --user admin  --role admin  --tenant admin

assignment这个表建立了一条数据

一般建一个用户需要

keystone user-create --name userb --pass openstack
keystone tenant-create --name tenantb
keystone user-role-add --user userb --role Member --tenant tenantb

在user,project,assignment
表添加一条数据

keystone user-list

查看用户
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值