每天学习opensatck(10)

接下来继续安装认证服务:

1.keystone介绍

keystone在openstack框架中负责身份验证,服务规则令牌的功能,使用restful接口来提供认证和授权服务。任何服务之间的访问,都需要经过keystone的身份认证。获取目标服务的endpoint。

2.keystone基本概念

user:用户,代表可以通过keystone进行访问的程序或者人

tenant: 租户

role:角色,代表一组用户可以访问资源的权限

service:服务

endpoint:可以理解为api,程序访问接口

3.先决条件

创建keystone数据库并授权:

create database keystone;

grant all privileges on keystone.* to "keystone"@"localhost" identified by "123456";

grant all privileges on keystone.* to "keystone"@"%" identified by "123456";

4.安装并配置组件

安装软件包:

 yum install openstack-keystone httpd mod_wsgi
修改配置文件/etc/keystone/keystone.conf:

分别添加如下内容:

admin_token =85a18ebf9306d572b902
connection = mysql+pymysql://keystone:123456@192.168.141.170/keystone  【database】
servers = 192.168.141.170:11211  【memcache】
provider = fernet 【token】
driver = memcache 【token】

注意:admin_token为随机生成的字符串token。命令为:openssl rand -hex 10

初始化身份认证服务器:

 su -s /bin/sh -c "keystone-manage db_sync" keystone
初始化Fernet key:

# keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
# keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
Bootstrap the Identity service:

# keystone-manage bootstrap --bootstrap-password ADMIN_PASS \
  --bootstrap-admin-url http://controller:35357/v3/ \
  --bootstrap-internal-url http://controller:35357/v3/ \
  --bootstrap-public-url http://controller:5000/v3/ \
  --bootstrap-region-id RegionOne

配置apache http服务器:

1.编辑``/etc/httpd/conf/httpd.conf`` 文件,配置``ServerName`` 选项为控制节点:

ServerName ip:80
2.创建一个链接到``/usr/share/keystone/wsgi-keystone.conf``文件

ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
启动 Apache HTTP 服务并配置其随系统启动:

# systemctl enable httpd.service
# systemctl start httpd.service
配置admin账号:

$ export OS_USERNAME=admin
$ export OS_PASSWORD=ADMIN_PASS
$ export OS_PROJECT_NAME=admin
$ export OS_USER_DOMAIN_NAME=default
$ export OS_PROJECT_DOMAIN_NAME=default
$ export OS_AUTH_URL=http://controller:35357/v3
$ export OS_IDENTITY_API_VERSION=3

以上认证服务keystone安装的版本为N版本opensatck。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值