openstack实验(二):认证服务

一、认证服务概览

  • OpenStack:term:Identity
    service为认证管理,授权管理和服务目录服务管理提供单点整合。其它OpenStack服务将身份认证服务当做通用统一API来使用。此外,提供用户信息但是不在OpenStack项目中的服务(如LDAP服务)可被整合进先前存在的基础设施中。
    为了从identity服务中获益,其他的OpenStack服务需要与它合作。当某个OpenStack服务收到来自用户的请求时,该服务询问Identity服务,验证该用户是否有权限进行此次请求
  • 身份服务包含这些组件:
  • 服务器:一个中心化的服务器使用RESTful 接口来提供认证和授权服务。
    驱动:驱动或服务后端被整合进集中式服务器中。它们被用来访问OpenStack外部仓库的身份信息, 并且它们可能已经存在于OpenStack被部署在的基础设施(例如,SQL数据库或LDAP服务器)中。
    模块:中间件模块运行于使用身份认证服务的OpenStack组件的地址空间中。这些模块拦截服务请求,取出用户凭据,并将它们送入中央是服务器寻求授权。中间件模块和OpenStack组件间的整合使用Python Web服务器网关接口。
    当安装OpenStack身份服务,用户必须将之注册到其OpenStack安装环境的每个服务。身份服务才可以追踪那些OpenStack服务已经安装,以及在网络中定位它们。

二、安装和配置
1.创建数据库

(1)以 root 用户连接到数据库服务器

[root@controller ~]# mysql -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.1.20-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

(2)创建 keystone 数据库

MariaDB [(none)]> CREATE DATABASE keystone;
Query OK, 1 row affected (0.00 sec)

(3)对keystone数据库授予恰当的权限

MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \ 
    ->   IDENTIFIED BY 'keystone';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%'    IDENTIFIED BY 'keystone';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye

2.安装软件

[root@controller ~]# yum install openstack-keystone httpd mod_wsgi -y
[root@controller ~]# cd /etc/keystone/
[root@controller keystone]# ls
default_catalog.templates  keystone-paste.ini  policy.json
keystone.conf              logging.conf        sso_callback_template.html

3.生成一个随机值在初始的配置中作为管理员的令牌

[root@controller keystone]# openssl rand -hex 10
8de2ba44be7bdf6dde76

4.编辑文件 /etc/keystone/keystone.conf

[root@controller keystone]# vim keystone.conf 

定义初始管理令牌的值:
[DEFAULT]
admin_token = 8de2ba44be7bdf6dde76
配置数据库访问
[database]
connection = mysql+pymysql://keystone:keystone@controller/keystone
配置Fernet UUID令牌的提供者
[token]
provider = fernet

5.初始化身份认证服务的数据库:

[root@controller keystone]# su -s /bin/sh -c "keystone-manage db_sync" keystone

6.进入数据库查看

[root@controller keystone]# mysql -p keystone
Enter password: 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.1.20-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [keystone]> show tables;
+------------------------+
| Tables_in_keystone     |
+------------------------+
| access_token           |
| assignment             |
| config_register        |
| consumer               |
| credential             |
| domain                 |
| endpoint               |
| endpoint_group         |
| federated_user         |
| federation_protocol    |
| group                  |
| id_mapping             |
| identity_provider      |
| idp_remote_ids         |
| implied_role           |
| local_user             |
| mapping                |
| migrate_version        |
| password               |
| policy                 |
| policy_association     |
| project                |
| project_endpoint       |
| project_endpoint_group |
| region                 |
| request_token          |
| revocation_event       |
| role                   |
| sensitive_config       |
| service                |
| service_provider       |
| token                  |
| trust                  |
| trust_role             |
| user                   |
| user_group_membership  |
| whitelisted_config     |
+------------------------+
37 rows in set (0.00 sec)

7.初始化Fernet keys

[root@controller keystone]# keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
[root@controller keystone]# ls
default_catalog.templates  keystone-paste.ini  sso_callback_template.html
fernet-keys                logging.conf
keystone.conf              policy.json

8.查看Fernet keys

[root@controller keystone]# cd fernet-keys/
[root@controller fernet-keys]# ls
0  1
[root@controller fernet-keys]# ll
total 8
-rw------- 1 keystone keystone 44 Jun 23 11:25 0
-rw------- 1 keystone keystone 44 Jun 23 11:25 1

9.配置 Apache HTTP 服务器

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

[root@controller fernet-keys]# vim /etc/httpd/conf/httpd.conf 
ServerName controller

(2)创建文件 /etc/httpd/conf.

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
一、Virtual Box的安装 1、安装Virtual Box 2、 Virtual Box网络设定 3、 安装操作系统 、 环境预配置 1、 网路设置 2、 分别修改三个虚拟机的主机名 3、 主机地址映射配置 4、 禁用selinux 5、 CentOS6本地yum源配置 注:先加载镜像 6、 NTP安装服务 三、 本地源制作 1. Centos6.6本地base、extra源制作 2. 本地base、extra源制作 3. 本地epel、openstack源制作 4. ftp服务安装 5. 修改yum源仓库指向文件 四、 keystone安装(上) 1. 安装Mysql服务 2. 安装rabbitmq消息队列 3. 为nova,neutron,cinder.heat创建用户并授权 五、 keystone安装(下) 1. 创建库和授权 2. 创建库和授权 3. 生成PKI认证所需要的证书文件 4. 同步keystone数据库,生成keystone所需的表 5. 启动keystone服务和校验服务状态 6. 创cron任务,配置定期清理过期的token 7. keystone创建user,tenant,role和endpoint 六、 Glance安装 1. Glance的安装 2. 配置glance-api服务 3. 配置glance-registry服务 4. 启动并校验glance服务 57 七、 Nova安装 59 1. nova的安装与配置 59 2. 安装和配置nova 60 八、 Neutron安装 63 1. neutron的安装与配置 63 2.Neutron使用层组件 66 3. 配置OVS层插件 67 4. 配置nova支持neutron 67 5. 启动neutron-server服务 68 6. 重启nova服务和neutron联动 69 7. 重启neutron-server 69 8. controller0上校验neutron的配置 69 九、 Horizon安装 71 1. Horizon组件的安装与配置 71 十、 Compute0安装nova 74 1. nova的安装与配置(compute0-10.20.0.30) 74 2. nova的安装与配置 75 十一、 Compute0安装neutron 78 1. neutron的安装与配置(compute0) 78 十、 Network0安装neutron 83 1. neutron的安装与配置 83 十三、 新建网络 91 1. 配置安全组规则 91 2. 新建网络 92 3 .创建云主机 99 4 .分配浮动ip 101 十四、 心得体会 107

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值