您现在的位置是:网站首页> 编程资料编程资料
OpenStack 安装 Keystone的过程详解_相关技巧_
2023-05-25
341人已围观
简介 OpenStack 安装 Keystone的过程详解_相关技巧_
OpenStack 安装 Keystone
本篇主要记录一下 如何安装 openstack的 第一个组件 keystone 认证授权组件
openstack 版本 我选的是queens 版本

1.OpenStack 官网
看了一下官网 文档还是蛮全的,我采用 centos7 来做实验
https://docs.openstack.org/keystone/queens/install/

2.KeyStone 概述
Keystone 是openstack 体系下面的认证、授权、和 目录服务管理 的一个重要的组件,keystone 通常是我们接触openstack 的第一个组件,它可以管理其他openstack service ,每个服务都可以有一个或者多个endpoints,并且 endpoint 被分为 3种类型: admin 、internal、public, 通过名称我们也能大概知道 就是其他服务所暴露的终端地址 给不通场景使用,public 一般是对外的 internal 一般是服务之间的通信地址,admin 一般管理员操作的地址,并且 endpoint 具有 region 类型,既可以对 endpoint 进行局域划分 ,我们默认使用RegionOne
具体看 https://docs.openstack.org/keystone/queens/install/
3.安装 OpenStack packages
前置 需要准备一个 centos7 系统
1.Upgrade the packages on all nodes:
yum upgrade
注意:If the upgrade process includes a new kernel, reboot your host to activate it.
2.Install the appropriate OpenStack client for your version.
# yum install python-openstackclient
For CentOS 7 and RHEL 7
# yum install python-openstackclient
For CentOS 8 and RHEL 8
# yum install python3-openstackclient
3.RHEL and CentOS enable SELinux by default. Install the openstack-selinux package to automatically manage security policies for OpenStack services:
# yum install openstack-selinux
或者通过手动关闭selnux
4.Network Time Protocol (NTP ) (必须)
openstack 各个组件之间 需要进行频繁的调用,所以他们的 时间一点要保持一致,所以这个 NTP 必须要进行处理
centos7 已经推荐使用 chrony 了 ,我看 openstack 官方文档也是这样操作的
4.1 安装 chrony
yum -y install chrony
4.2 编辑/etc/chrony.conf
#注释 这4个 #server 0.centos.pool.ntp.org iburst #server 1.centos.pool.ntp.org iburst #server 2.centos.pool.ntp.org iburst #server 3.centos.pool.ntp.org iburst #添加阿里云 ntp 服务器 server ntp1.aliyun.com iburst #允许同步的网段 我的是这个,根据情况自己配置 allow 192.168.56.0/24
4.3 启动 chrony
注意是 chronyd.service
systemctl enable chronyd.service systemctl start chronyd.service
4.4 执行同步 chronyc sources -v

4.5 其他nodes 节点也需要安装 chrony
nodes 其他节点 直接同步 上面的 controller节点即可
server 192.168.56.30

注意: 由于chrony 使用 udp 端口 123 和 323 ,所以 注意关闭 防火墙,或者把端口打开!
5. 安装 mariadb
由于 keystone 中相关的 services 信息 都需要存储的地方 ,所以 需要安装 mariadb ,不过也支持其他
5.1 Install the packages: 安装 mariadb 包
# yum install mariadb mariadb-server python2-PyMySQL
5.2 编辑 /etc/my.cnf.d/openstack.cnf
Create and edit the /etc/my.cnf.d/openstack.cnf file (backup existing configuration files in /etc/my.cnf.d/ if needed) and complete the following actions:
- Create a
[mysqld]section, and set thebind-addresskey to the management IP address of the controller node to enable access by other nodes via the management network. Set additional keys to enable useful options and the UTF-8 character set:
[mysqld] bind-address = 192.168.56.30 default-storage-engine = innodb innodb_file_per_table = on max_connections = 4096 collation-server = utf8_general_ci character-set-server = utf8
注意 在 /etc/my.cnf.d/openstack.cnf 下面进行编辑 然后 bind-address 可以指定为 controller 节点ip
5.3 启动 mariadb 服务
systemctl enable mariadb.service systemctl start mariadb.service
5.4 安全设置向导
mysql_secure_installation #一步步配置即可

6.安装 rabbitmq (本篇可选,由于本篇只是安装keystone)
OpenStack 使用消息队列来协调服务之间的操作和状态信息。消息队列服务通常在控制器节点上运行。OpenStack支持多种消息队列服务,包括RabbitMQ,Qpid和ZeroMQ。
6.1 安装 rabbitmq-server
yum install rabbitmq-server
6.2 启动
systemctl enable rabbitmq-server.service systemctl start rabbitmq-server.service
6.3 配置 openstack rabiitmq 用户
rabbitmqctl add_user openstack RABBIT_PASS #注意替换 RABBIT_PASS 密码
6.4 Permit configuration, write, and read access for the openstack user:
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
7. 安装 Keystone 和 必要配置
官网地址:https://docs.openstack.org/keystone/queens/install/index-rdo.html

7.1 配置 mysql
上面已经安装了 mariadb 服务,这里需要开始对它进行配置
Before you install and configure the Identity service, you must create a database.
使用root用户登录 mysql :
$ mysql -u root -p
创建 keystone database:
MariaDB [(none)]> CREATE DATABASE keystone;
Grant proper access to the keystone database:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \ IDENTIFIED BY 'KEYSTONE_DBPASS'; MariaDB [(none)]> GRAN
相关内容
- 详解Git 的 rebase 命令使用方法_相关技巧_
- 知识蒸馏联邦学习的个性化技术综述_相关技巧_
- FedAvg联邦学习FedProx异质网络优化实验总结_相关技巧_
- 反向传播BP学习算法Gradient Descent的推导过程_相关技巧_
- 级联分类器算法原理解析_相关技巧_
- kafka rabbitMQ及rocketMQ队列的消息可靠性保证分析_相关技巧_
- 目标检测mAP的概念及公式详解_相关技巧_
- 教你使用Typora + 阿里云OSS + PicGo 搭建私人图床(最新)_相关技巧_
- win7/win10+vs2015+pcl1.8.0配置方案详解_相关技巧_
- Git配置.gitignore文件忽略被指定的文件上传_相关技巧_
点击排行
本栏推荐
