Openstack 与 Ceph集群搭建(上): 规划与准备

文章目录

  • 一、写在前面
    • [1. 网络架构](#1. 网络架构)
    • [2. 节点规划](#2. 节点规划)
    • [3. 软件版本](#3. 软件版本)
    • [4. 避坑指南](#4. 避坑指南)
  • 二、基础配置
    • [1. host配置](#1. host配置)
    • [2. 修改hostname名称](#2. 修改hostname名称)
    • [3. 确保root账号能登录系统](#3. 确保root账号能登录系统)
    • [4. 配置NTP](#4. 配置NTP)
    • [5. 配置免密登录](#5. 配置免密登录)

一、写在前面

近期将进行三节点的Openstack、Ceph集群混合部署,本人将详细记录该过程。在此之前,本文为Openstack与ceph集群搭建的上篇,主要展现集群的整体规划与注意事项。中、下篇将详细介绍ceph与Openstack的安装细节。

在生产环境建议将Openstack节点与Ceph节点分开部署

1. 网络架构

所有节点网络结构都相同,图中只画了两个节点。在后续部署过程中需要确保所有节点能连接互联网。

以上架构图中在服务器的物理层面是2个(实际可支持多端口捆绑)10G端口通过链路聚合连接到物理交换机, 底层接口类型配置为Trunk模式。在操作系统层面将统一呈现为bond0逻辑接口。

在混合部署模式中,为了区分openstack和ceph流量,在方案设计时我们基于bond0口划分了VLAN。 VLAN1250 用作Openstack;VLAN1249用作Ceph。
所以在安装系统时一定要选择创建bond接口, 如下:

2. 节点规划

节点名称 IP 物理(逻辑)接口 Idrac 其他说明
node-01 vlan1250 172.16.250.250 vlan1249 172.16.249.250 vlan1250(Op、Ceph、物理环境管理网) vlan1249(ceph集群内部通信) bond0(OpenStack 虚拟机使用的物理网络) OpenStack 控制、计算节点、部署节点、OSD节点
node-02 vlan1250 172.16.250.249 vlan1249 172.16.249.249 vlan1250(Op、Ceph、物理环境管理网) vlan1249(ceph集群内部通信) bond0(OpenStack 虚拟机使用的物理网络) OpenStack 计算节点、OSD节点
node-03 vlan1250 172.16.250.248 vlan1249 172.16.249.248 vlan1250(Op、Ceph、物理环境管理网) vlan1249(ceph集群内部通信) bond0(OpenStack 虚拟机使用的物理网络) OpenStack 计算节点、Ceph 控制节点、OSD节点、Ceph部署节点

3. 软件版本

软件名称 软件版本 其他
Ubuntu 22.04 (Jammy Jellyfish) 截止目前24.04还不支持Openstack
CEPH Reef 18.2.2 Ceph也不支持24.04 ,有小bug
OpenStack 2024.1

4. 避坑指南

一、 原则强烈不建议CEPH 与OpenStack管理节点部署在同一台服务器上,因为由很多端口会冲突。比如grafana 3000端口。

二、若强行将ceph管理节点与Openstack管理节点部署在同一台物理机,则安装以下顺序进行部署:

  1. Ceph
  2. OpenStack(不要配置ceph对接配置),且关闭grafana3000端口。
  3. 重新配置OpenStack对接Ceph
    以上顺序可避免Openstack部署过程中docker不能重启的问题;

二、基础配置

以下基础配置需要在每台节点上执行。

1. host配置

在所有节点上编辑 /etc/hosts文件添加以下信息

bash 复制代码
172.16.250.250 node-01
172.16.250.249 node-02
172.16.250.248 node-03
172.16.249.250 node-01
172.16.249.249 node-02
172.16.249.248 node-03

2. 修改hostname名称

按照规划表修改节点名称

bash 复制代码
sudo hostnamectl hostname node-01 --static
sudo hostnamectl hostname node-02 --static
sudo hostnamectl hostname node-03 --static

3. 确保root账号能登录系统

配置root密码

bash 复制代码
sudo psswd root 

编辑各节点etc/ssh/sshd_config 文件,允许root 登录

bash 复制代码
PermitRootLogin yes

然后重启sshd服务生效

bash 复制代码
systemctl restart sshd

4. 配置NTP

集群中每节点时间必须同步,否则可能出现因时间不一致导致的各种奇奇怪怪问题。我们采用chrony软件来同步时间。在所有节点上执行以下代码

bash 复制代码
sudo apt install chrony
chronyc tracking
chronyc sources

5. 配置免密登录

需要确保 部署节点能 免密登录到其他节点,如: node01 能免密ssh到node02、node03

确保部署节点(CEPH、OpenStack)能无密码登录其他主机进行部署。

kolla-ansible, 是openstack官方基于ansible开发的openstack部署工具,底层基于ansible;ansible实现原理是提前在部署节点编辑好配置,然后通过ssh到各目标节点进行部署。故需要保证部署节点在部署过程中可实现无密码ssh到目标节点。

bash 复制代码
# 生成ssh-key密钥对,一路回车
root@node-01:~# ssh-keygen
Generating public/private ed25519 key pair.
Enter file in which to save the key (/root/.ssh/id_ed25519): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_ed25519
Your public key has been saved in /root/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:erhS2TrsCRVDdVFOwhdlmUJ/lTxwOR9xsNQO77Yc1z8 root@node-01
The key's randomart image is:
+--[ED25519 256]--+
|      ....++=+BB*|
|     .   ..+o+=O+|
|      o    ...o+*|
|       o       .+|
|      .oS      ..|
|     .oo.      .=|
|    .oo..     ..=|
|    ..++       E.|
|     o+.        .|
+----[SHA256]-----+

将公钥同步同步到每一个节点:

bash 复制代码
ssh-copy-id -i /root/.ssh/id_rsa.pub note-01
ssh-copy-id -i /root/.ssh/id_rsa.pub node-02
ssh-copy-id -i /root/.ssh/id_rsa.pub node-03
# 其他节点自行补充

输出如下:

bash 复制代码
root@deploypoint:~# ssh-copy-id -i /root/.ssh/id_rsa.pub compute01
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host 'compute01 (192.168.220.61)' can't be established.
ED25519 key fingerprint is SHA256:DVS6AOAOnzLBOU237qgWLs3LhECGhEYe3udS910X2ek.
This host key is known by the following other names/addresses:
    ~/.ssh/known_hosts:1: [hashed name]
    ~/.ssh/known_hosts:4: [hashed name]
    ~/.ssh/known_hosts:5: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@compute01's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'compute01'"
and check to make sure that only the key(s) you wanted were added.
相关推荐
爱Go的小蚊子2 天前
聊聊学习openstack的感受
学习·openstack
查士丁尼·绵2 天前
openstack之cinder介绍
openstack·cinder
OceanBase数据库官方博客5 天前
OpenStack × OceanBase: 打造高可用可扩展的基础设施平台
开源·openstack·oceanbase·分布式数据库·生态工具
奋斗的松鼠6 天前
2.1ceph集群部署准备-硬件及拓扑
linux·服务器·ceph
才学7 天前
在VMware中的centos stream 9上用packstack安装openstack的单机版
linux·centos·openstack
沐芊屿7 天前
CentOS Stream 8 通过 Packstack 安装开源 OpenStack(V版)
openstack
企鹅侠客9 天前
openstack 虚拟机网卡被重名为cirename0
linux·网络·openstack
hejingdong12310 天前
ceph-iscsi 手动安装过程中的一些问题记录以及解决办法
ceph
奋斗的松鼠10 天前
2.2ceph集群部署准备-软件准备上
分布式·ceph
henan程序媛11 天前
云原生存储Rook部署Ceph
ceph·云原生·rook