`

openstack安装--keystone

阅读更多
安装在controller节点
一、数据库
1、要求controller和compute节点的数据库能互相访问
grant all on *.* to root@'%' identified by "mima" WITH GRANT OPTION;         
flush privileges;

2、 mysql -u root -p
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \
  IDENTIFIED BY 'KEYSTONE_DBPASS';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' \
  IDENTIFIED BY 'KEYSTONE_DBPASS';

3、生成一个随机的字符串
openssl rand -hex 10
假设为aaaaa

二、
1、安装memcached
yum install openstack-keystone httpd mod_wsgi memcached python-memcached
systemctl enable memcached.service
systemctl start memcached.service

2、Edit the /etc/keystone/keystone.conf file and complete the following actions:
[DEFAULT]
admin_token = ADMIN_TOKEN(aaaaa)
verbose = True
[database]
connection = mysql://keystone:KEYSTONE_DBPASS@controller/keystone
[memcache]
servers = localhost:11211
[token]
provider = uuid
driver = memcache
[revoke]
driver = sql

同步keystone数据库
su -s /bin/sh -c "keystone-manage db_sync" keystone
注意:如果报错No handlers could be found for logger "oslo_config.cfg"
解决办法:去掉verbose = True这行

3、配置Apache
Edit the /etc/httpd/conf/httpd.conf file and configure the ServerName option to reference the controller node:

ServerName controller

Create the /etc/httpd/conf.d/wsgi-keystone.conf file with the following content:
Listen 5000
Listen 35357

<VirtualHost *:5000>
    WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
    WSGIProcessGroup keystone-public
    WSGIScriptAlias / /usr/bin/keystone-wsgi-public
    WSGIApplicationGroup %{GLOBAL}
    WSGIPassAuthorization On
    <IfVersion >= 2.4>
      ErrorLogFormat "%{cu}t %M"
    </IfVersion>
    ErrorLog /var/log/httpd/keystone-error.log
    CustomLog /var/log/httpd/keystone-access.log combined

    <Directory /usr/bin>
        <IfVersion >= 2.4>
            Require all granted
        </IfVersion>
        <IfVersion < 2.4>
            Order allow,deny
            Allow from all
        </IfVersion>
    </Directory>
</VirtualHost>

<VirtualHost *:35357>
    WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
    WSGIProcessGroup keystone-admin
    WSGIScriptAlias / /usr/bin/keystone-wsgi-admin
    WSGIApplicationGroup %{GLOBAL}
    WSGIPassAuthorization On
    <IfVersion >= 2.4>
      ErrorLogFormat "%{cu}t %M"
    </IfVersion>
    ErrorLog /var/log/httpd/keystone-error.log
    CustomLog /var/log/httpd/keystone-access.log combined

    <Directory /usr/bin>
        <IfVersion >= 2.4>
            Require all granted
        </IfVersion>
        <IfVersion < 2.4>
            Order allow,deny
            Allow from all
        </IfVersion>
    </Directory>
</VirtualHost>


配置之后启动http服务
systemctl enable httpd.service
 systemctl start httpd.service


三、
1.设置环境变量
export OS_TOKEN=ADMIN_TOKEN(aaaaa)
export OS_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3


2.Create the service entity and API endpoints

openstack service create  --name keystone --description "OpenStack Identity" identity

报错:Unable to establish connection to http://controller:35357/v3/services
检查35357端口是否已经被监听,如果没有,就检查配置文件是否写错

3.创建endpoint
Create the Identity service API endpoints:
openstack endpoint create --region RegionOne identity public http://controller:5000/v2.0
 openstack endpoint create --region RegionOne identity internal http://controller:5000/v2.0
 openstack endpoint create --region RegionOne identity admin http://controller:35357/v2.0

四、创建project、user、role并关联
1.admin
openstack project create --domain default \
  --description "Admin Project" admin
 openstack user create --domain default \
  --password-prompt admin
User Password:
Repeat User Password:
openstack role create admin
openstack role add --project admin --user admin admin


2.demo
openstack project create --domain default \
  --description "Service Project" service
 openstack project create --domain default \
  --description "Demo Project" demo
 openstack user create --domain default \
  --password-prompt demo
User Password:
Repeat User Password:
openstack role create user
openstack role add --project demo --user demo user


五、
1、For security reasons, disable the temporary authentication token mechanism:
Edit the /usr/share/keystone/keystone-dist-paste.ini file and remove admin_token_auth from the [pipeline:public_api], [pipeline:admin_api], and [pipeline:api_v3] sections.
2、
unset OS_TOKEN OS_URL

3、As the admin user, request an authentication token:
 openstack --os-auth-url http://controller:35357/v3 \
  --os-project-domain-id default --os-user-domain-id default \
  --os-project-name admin --os-username admin --os-auth-type password \
  token issue
Password:

用这一长串访问keystone时,不能有相关的环境变量,所以要unset
4、As the demo user, request an authentication token:
openstack --os-auth-url http://controller:5000/v3 \
  --os-project-domain-id default --os-user-domain-id default \
  --os-project-name demo --os-username demo --os-auth-type password \
  token issue
Password:


六、
1.Creating the scripts
vim admin-openrc.sh

export OS_PROJECT_DOMAIN_ID=default
export OS_USER_DOMAIN_ID=default
export OS_PROJECT_NAME=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN_PASS //注意替换
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3

vim demo-openrc.sh
export OS_PROJECT_DOMAIN_ID=default
export OS_USER_DOMAIN_ID=default
export OS_PROJECT_NAME=demo
export OS_TENANT_NAME=demo
export OS_USERNAME=demo
export OS_PASSWORD=DEMO_PASS //注意替换
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3


2.Using the scripts
source admin-openrc.sh


Request an authentication token:
 openstack token issue

分享到:
评论
1 楼 haoningabc 2016-06-28  
好厉害,偶像

相关推荐

    Openstack keystone 安装包

    4. **初始化Keystone**:使用keystone-manage工具初始化数据库和配置文件。例如: ``` keystone-manage db_sync ``` 5. **配置Keystone**:编辑`/etc/keystone/keystone.conf`配置文件,配置数据库连接信息、...

    openstack-barbican-keystone-listener-9.0.0-1.el8.noarch.rpm

    官方离线安装包,亲测可用

    openstack-keystone-doc-13.0.2-1.el7.noarch.rpm

    官方离线安装包,测试可用。请使用rpm -ivh [rpm完整包名] 进行安装

    openstack-keystone-doc-15.0.0-1.el7.noarch.rpm

    官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装

    openstack-keystone-doc-16.0.0-0.2.0rc2.el7.noarch.rpm

    官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装

    OpenStackKilo-中文安装指南

    ### OpenStack Kilo 中文安装指南 #### 概述 OpenStack Kilo版本是一个重要的里程碑,在这个版本中引入了许多新特性以及对现有功能的重大改进。本文档为Red Hat Enterprise Linux 7、CentOS 7及Fedora 20等操作...

    openstack-keystone-doc-16.0.2-1.el8.noarch.rpm

    官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装

    openstack-keystone-13.0.1-1.el7.noarch.rpm

    官方离线安装包,测试可用。请使用rpm -ivh [rpm完整包名] 进行安装

    OpenStack自动安装-Fuel.zip

    在这个"OpenStack自动安装-Fuel.zip"压缩包中,包含了一个视频教程,旨在指导用户如何使用Fuel进行OpenStack的自动化安装和使用。 首先,OpenStack的安装通常涉及到多个步骤,包括配置硬件环境、安装基础操作系统、...

    InstallGuide--openstack--ocata.pdf

    ### 安装指南:OpenStack Ocata版本 #### 概述 OpenStack 是一个开源的云计算平台,它支持各种类型的云计算环境,并以其简单的实施、大规模的可扩展性和丰富的功能特性而著称。该平台由来自全球各地的云计算专家...

    openstack-keystone

    OpenStack Keystone token机制详解 OpenStack Keystone 是 OpenStack 的身份验证机制,token 是用户的一种凭证,需拿正确的用户名/密码向 Keystone 申请才能得到。token 是 OpenStack 中的核心概念之一,用户访问 ...

    openstack--L版本

    1.手动安装 liberty 版本 openstack 环境 2.手动安装 liberty 版本 openstack ...3.手动安装liberty版本openstack环境(allinone)---安装keystone 4.手动安装 liberty 版本 openstack 环境(allinone)---安装 glance

    OpenStack培训-完整实验手册

    OpenStack培训-完整实验手册

    openeuler-22.03-LTS安装openstack-train

    例如,使用`openstack-db`命令创建数据库,用`keystone-manage`初始化Keystone服务。 ```bash sudo openstack-db --service nova --create --user nova --password nova sudo openstack-db --service neutron --...

    openstack-rpm

    6. **Keystone**: 认证服务,为OpenStack的所有服务提供身份验证和授权。 7. **Horizon**: Web门户,用户可以通过它来交互式地管理和控制OpenStack资源。 8. **Ceilometer**: 监控服务,收集各种资源的使用情况数据...

    云计算HCIE 2.0 周末班73课.zip

    6-2Openstack-keystone 6-3Openstack-keystone 6-4Openstack-keystone 6-5Openstack-keystone 6-6Openstack-rabbitmq 7-1Openstack-cinder 7-2Openstack-cinder 7-3Openstack-cinder 7-4Openstack-swift 7-5...

    OpenStack 安装 Keystone.doc

    OpenStack 安装 Keystone OpenStack 安装 Keystone 是 OpenStack 体系下面的认证、授权、和目录服务管理的重要组件。Keystone 通常是我们接触 OpenStack 的第一个组件,它可以管理其他 OpenStack 服务,每个服务都...

    openstack-cinder-15.0.0-0.2.0rc2.el7.noarch.rpm

    官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装

    openstack-install-guide-apt-juno

    ### OpenStack在Ubuntu 14.04上的安装指南 #### 概述 本文档旨在指导用户如何在Ubuntu 14.04上安装并配置OpenStack,版本为Juno。OpenStack是一款开源云操作系统,它由多个独立但又相互关联的服务组成。这些服务...

    openstack-keystone-13.0.4-1.el7.noarch.rpm

    官方离线安装包,测试可用。请使用rpm -ivh [rpm完整包名] 进行安装

Global site tag (gtag.js) - Google Analytics