51学通信论坛2017新版

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1231|回复: 0
打印 上一主题 下一主题

openstack之keystone安装

[复制链接]

 成长值: 15613

  • TA的每日心情
    开心
    2022-7-17 17:50
  • 2444

    主题

    2544

    帖子

    7万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    74104
    跳转到指定楼层
    楼主
    发表于 2017-9-16 21:31:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    在controller node上安装MySQL和keystone1、安装MySQL


    sudo apt-get install mysql-server
    Sudo apt-get install mysql-client
    Sudo apt-get install libmysqlclient-dev2、root用户登录MySQL:


    # mysql3、创建名为keystone的数据库:


    CREATE DATABASE keystone;4、对keystone数据库授权:


    GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \
    IDENTIFIED BY 'KEYSTONE_DBPASS';
    GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' \
    IDENTIFIED BY 'KEYSTONE_DBPASS';
    用自己的密码替换命令中的KEYSTONE_DBPASS5、退出数据库客户端.

    6、安装keystone:


    apt install keystone7、修改配置文件/etc/keystone/keystone.conf


    a、 [database]
    connection = mysql+pymysql://keystone:KEYSTONE_DBPASS@controller/keystone
    其中KEYSTONE_DBPASS是数据库登录密码
    b、[token]
    provider = fernet8、数据库同步:


    su -s /bin/sh -c "keystone-manage db_sync" keystone9、初始化数据库:


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


    keystone-manage bootstrap --bootstrap-password ADMIN_PASS \
    --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
    其中Replace ADMIN_PASS with a suitable password for an administrative user11、配置Apache2的配置/etc/apache2/apache2.conf


    文件中加入一行:ServerName controller12、重启服务:


    service apache2 restart
    rm -f /var/lib/keystone/keystone.db13、添加环境变量:


    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
    其中Replace ADMIN_PASS with the password used in the keystone-manage bootstrap command in keystone-install-configure.14、执行命令:


    openstack project create --domain default \
    --description "Service Project" service15、执行命令:


    openstack project create --domain default \
    --description "Demo Project" demo16、执行命令:


    openstack user create --domain default \
    --password-prompt demo17、执行命令:


    openstack role create user18、执行命令:


    openstack role add --project demo --user demo user19、执行命令:


    Edit the /etc/keystone/keystone-paste.ini file and remove admin_token_auth from the [pipeline:public_api], [pipeline:admin_api], and [pipeline:api_v3] sections.20、执行命令:


    unset OS_AUTH_URL OS_PASSWORD21、执行命令:


    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 issue22、执行命令:


    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 issue23、执行命令:


    vim /etc/admin-openrc
    添加如下内容:
    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_PASS
    export OS_AUTH_URL=http://controller:35357/v3
    export OS_IDENTITY_API_VERSION=3
    export OS_IMAGE_API_VERSION=2
    其中Replace ADMIN_PASS with the password you chose for the admin user in the Identity service.24、执行命令:


    vim /etc/demo-openrc
    添加如下内容:
    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_PASS
    export OS_AUTH_URL=http://controller:5000/v3
    export OS_IDENTITY_API_VERSION=3
    export OS_IMAGE_API_VERSION=2
    其中Replace DEMO_PASS with the password you chose for the demo user in the Identity service25、执行命令:


    . admin-openrc26、执行命令:


    openstack token issue

    声明:本文转载自网络。版权归原作者所有,如有侵权请联系删除。
    扫描并关注51学通信微信公众号,获取更多精彩通信课程分享。
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|51学通信技术论坛

    GMT+8, 2025-1-31 14:59 , Processed in 0.059966 second(s), 32 queries .

    Powered by Discuz! X3

    © 2001-2013 Comsenz Inc.

    快速回复 返回顶部 返回列表