OpenStack 部署记录
This post was last updated 184 days ago and the information may have changed.

OpenStack 部署记录

OpenStack

在三台服务器上部署 OpenStack,毕设课题的一部分。

课题名称是“基于NFV的虚拟网络设计”,实际上就是帮老师在新采购的三台服务器上部署 OpenStack 构建私有云。

设备

Ubuntu1:

  • Intel Xeon Silver 4210 @2.20GHz
  • Samsung 16G RDIMM DDR4 with ECC @2666MHz (M393A2K40CB2-CTD)
  • Toshiba 2T HDD @7200RPM (MG04ACA)
  • Ubuntu 18.04 LTS

CentOS1, CentOS2:

  • Intel Xeon Silver 4210 @2.20GHz
  • Samsung RDIMM with ECC 16G DDR4 @2933MHz * 4 (M393A2K40CB2-CVF)
  • Toshiba 2T HDD @7200RPM (MG04ACA)
  • CentOS 7

直接以系统 + 数字命名设备,服务器的配置很奇妙。Ubuntu 仅仅只有 16G 的内存,剩下两台服务器莫名其妙要装 CentOS。明明装 Ubuntu 的原因是不熟悉 CentOS,为了更长的支持时间也可以选择 Ubuntu 20.04 LTS。

架构

从默认源安装,Ubuntu 18.04 TLS 只有 Queens,而 CentOS 可以选择 Train, Stein, Rocky, Queens。

Ubuntu TLS 可以使用 UCA 支持 Ussuri, Train, Stein。

自然是尽可能选择新版本,部署最小化安装的 OpenStack Train

Ubuntu: 控制节点

  • Keystone, identity service
  • Glance, image service
  • Placement, placement service
  • Neutron, networking service
  • Horizon, dashboard

CentOS1: 计算节点

  • Nova, compute service

CentOS2: 计算节点

  • Nova, compute service

手动部署

Docs: <https://docs.openstack.org/queens/install/index.html>

Environment

Docs: <https://docs.openstack.org/install-guide/environment.html>

最开始没注意到这一部分,里面有硬件配置要求,以及一些必须的相关环境的配置。

Keystone

Docs: <https://docs.openstack.org/keystone/queens/install/keystone-install-ubuntu.html>

su -s /bin/sh -c "keystone-manage db_sync" keystone

这里有个坑,在运行完这条命令之后,神奇地不会有任何 Console 输出,即使有错误运行失败也一样。导致开始安装 Glance 后我才发现有问题,且不知道问题出在哪。

运行完之后一定要在 MariaDB 里执行 USE keystone; SHOW TABLES;,手动检查数据库初始化是否成功。

如果运行失败需,查看日志需要使用 --log-file 参数指定输出日志文件。

这条命令在 Debain/Ubuntu 默认的 MariaDB/MySQL 配置下运行是一定会出现错误的。

Index column size too large. The maximum column size is 767 bytes.

Debain/Ubuntu 的 MariaDB/MySQL 默认使用 utf8mb4 作为字符集,造成 InnoDB 表索引字段长度超过限制。需要修改数据库的字符集为 utf8,同时修改相应的字符序。

Glance

Docs: <https://docs.openstack.org/glance/queens/install/>

su -s /bin/sh -c "glance-manage db_sync" glance

部署 Glance 运行类似的语句,又神奇的会有 Console 输出,没有错误也有输出。

Placement

Docs: <https://docs.openstack.org/placement/train/install/>

Nova

Docs: <https://docs.openstack.org/nova/train/install/>

Neutron

Docs: <https://docs.openstack.org/neutron/train/install/>

Networking Options: <https://docs.openstack.org/install-guide/overview.html#networking>

网络架构选择 Self-service networks,不依赖于物理网络服务提供 Layer-3 服务,提供对 Layer-3 的虚拟化支持。

su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron

Ubuntu 18.04 LTS 默认源的 MariaDB 10.1,运行这句会报错。根据 Q&AIssue,需要更新 MariaDB 至 10.4 以上才能绕过。

sudo apt-get install software-properties-common dirmngr apt-transport-https
sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] https://mirrors.tuna.tsinghua.edu.cn/mariadb/repo/10.5/ubuntu bionic main'
sudo apt update
sudo apt install mariadb-server

使用 MariaDB 的官方源更新 MariaDB 10.5。

Horizon

Docs: <https://docs.openstack.org/horizon/train/install/>

OpenStack Dashboard

优化

MariaDB 在 Ubuntu 18.04 LTS 上的默认最大连接数是 151,即使是最小化部署的 OpenStack 也不够用。随便操作几下就是报 too many connections,导致卡死整个 OpenStack。

最简单的方法是修改 MariaDB 的 max_connections,还可以修改各个组件 [database]/[api_database] 项里面 max_pool_sizemax_overflow 的值,限制 SQL 的最大连接数。

OpenStack大规模部署优化之一:并发业务优化有一些优化方法,简明扼要。


Header picture:<https://www.openstack.org>

No Comments

Send Comment Edit Comment


|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
Previous
Next