记 OpenStack 环境配置 学习笔记2

本文档详细记录了OpenStack环境配置的过程,包括安装ntpdate、设置Keystone数据库、配置memcached以及创建用户和项目,并赋予相应权限。主要涉及Keystone、Glance、Nova等服务的初始化和配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

openstack 基础环境配置,按照官方文档
https://docs.openstack.org/newton/zh_CN/install-guide-ubuntu/keystone-install.html

 

 

yum install -y ntpdate  #安装ntpdate  用于同步时间

rabbitmq-plugins enable

认证服务KeyStone
用户认证:用户权限与行为的跟踪
服务目录:提供一个服务目录,包括所有服务项与相关api端口
用户,项目,角色,服务,端点

数据库创建:

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

MariaDB [(none)]> create database glance;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> create database nova;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> create database nova_api;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> create database neutron;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> create database cinder;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all on keystone.* to 'keystone'@'localhost' identified by 'keystone';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all on keystone.* to 'keystone'@'%' identified by 'keystone';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all on glance.* to 'glance'@'localhost' identified by 'glance';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all on glance.* to 'glance'@'%' identified by 'glance';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all on nova.* to 'nova'@'localhost' identified by 'nova';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all on nova.* to 'nova'@'%' identified by 'nova';
Query OK, 0 rows affected (0.01 sec)

MariaDB [(none)]> grant all on nova_api.* to 'nova'@'localhost' identified by 'nova';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all on nova_api.* to 'nova'@'%' identified by 'nova';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all on neutron.* to 'neutron'@'localhost' identified by 'neutron';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all on neutron.* to 'neutron'@'%' identified by 'neutron';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all on cinder.* to 'cinder'@'localhost' identified by 'cinder';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all on cinder.* to 'cinder'@'%' identified by 'cinder';
Query OK, 0 rows affected (0.00 sec)

show databases #检查是否创建成功

配置memcached

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

 配置环境变量
export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_DOMAIN_NAME=default
export OS_AUTH_URL=http://192.168.56.11:35357/v3
export OS_IDENTITY_API_VERSION=3

openstack user list #查看用户列表

创建用户,添加用户到项目并赋予admin权限
openstack user create --domain default   --password-prompt glance
openstack role add --project service --user glance admin
openstack user create --domain default   --password-prompt nova
openstack role add --project service --user nova admin
openstack user create --domain default   --password-prompt neutron
openstack role add --project service --user neutron admin
openstack user create --domain default   --password-prompt cinder
openstack role add --project service --user cinder admin


openstack --os-auth-url http://192.168.56.11:35357/v3 \
  --os-project-domain-name default --os-user-domain-name default \
  --os-project-name admin --os-username admin token issue
  
Glance-api  9292端口
Glance-Registry  云系统的镜像注册服务  9191

  

创建镜像服务的 API 端点:

openstack endpoint create --region RegionOne \
  image public http://192.168.56.11:9292
  
openstack endpoint create --region RegionOne \
  image internal  http://192.168.56.11:9292

openstack endpoint create --region RegionOne \
  image admin http://192.168.56.11:9292

openstack endpoint list

Nova

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值