ceph相关概念和部署

Ceph 可用于向云提供 Ceph 对象存储 平台和 Ceph 可用于提供 Ceph 块设备服务 到云平台。Ceph 可用于部署 Ceph 文件 系统。所有 Ceph 存储集群部署都从设置 每个 Ceph 节点,然后设置网络。

Ceph 存储集群需要满足以下条件:至少一个 Ceph 监控器,并且 至少一个 Ceph 管理器,以及至少与副本一样多的 Ceph OSD 存储在 Ceph 集群上的对象(例如,如果给定的三个副本 对象存储在 Ceph 集群上,则至少必须存在三个 OSD 那个 Ceph 集群)。

Ceph 元数据服务器是运行 Ceph 文件系统客户端所必需的。

crash ceph 的 crash模块用来收集守护进程出现 crashdumps (崩溃)的信息,并将其存储在ceph集群中,以供以后分析。默认信息是保存在/var/lib/ceph/crash/posted 中。

部署方式:

Cephadm 安装并管理 Ceph 使用容器和 systemd 并与 CLI 紧密集成的集群 和仪表板图形用户界面。

CEPHADM 仅支援 Octopus 及更新版本。

cephadm 与编排 API 完全集成,完全支持 用于管理群集部署的 CLI 和仪表板功能。

cephadm 需要容器支持(以 Podman 或 Docker 的形式)和 蟒蛇 3.

Rook 部署和管理正在运行的 Ceph 集群 在 Kubernetes 中,同时还支持存储资源的管理和 通过 Kubernetes API 进行配置。我们推荐 Rook 作为运行 Ceph 的方式 Kubernetes 或将现有的 Ceph 存储集群连接到 Kubernetes。

Rook 仅支持 Nautilus 和较新版本的 Ceph。

Rook 是在 Kubernetes 上运行 Ceph 的首选方法,或者 将 Kubernetes 集群连接到现有(外部)Ceph 簇。

Rook 支持业务流程协调程序 API。CLI 中的管理功能和 完全支持仪表板。

Ceph-Ansible 被广泛部署。

ceph-ansible 但是仪表板集成不是 在通过 ceph-ansible 部署的 Ceph 集群中可用。

Ceph-Deploy 是一个 可用于快速部署集群的工具。它已被弃用

cephadm :

cephadm管理 Ceph 集群的整个生命周期。此生命周期开始 通过引导过程,当在 上创建一个微小的 Ceph 集群时 单个节点。此群集由一个监视器和一个管理器组成。 然后使用编排接口扩展集群,添加 主机和配置 Ceph 守护程序和服务。此生命周期的管理 可以通过 Ceph 命令行界面 (CLI) 或通过 仪表板 (GUI)

cephadm在 Ceph 版本 v15.2.0中引入 (centos7只能安装到15.2.17,更高版本要是用centos8)

安装依赖包和工具:

复制代码
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
yum install net-tools wget lsof  python3 bash-completion   lvm2 -y
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
#安装docker
yum install -y docker-ce

下载cephadm:

复制代码
CEPH_RELEASE=17.2.6 # replace this with the active release
curl --silent --remote-name --location https://download.ceph.com/rpm-${CEPH_RELEASE}/el9/noarch/cephadm
chmod +x cephadm
./cephadm add-repo --release quincy
./cephadm install
which cephadm  如果/usr/sbin/cephadm 就表示安装成功了
安装ceph-common ceph-fuse (可选,安装是为了直接使用ceph命令  当然也可以不安装使用后面的cephadm shell)
cephadm install ceph-common ceph-fuse

指定ceph安装使用的源
cat >/etc/yum.repos.d/ceph.repo <<EOF
[Ceph]
name=Ceph packages for \$basearch
baseurl=http://mirrors.aliyun.com/ceph/rpm-octopus/el8/\$basearch
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=https://download.ceph.com/keys/release.asc

[Ceph-noarch]
name=Ceph noarch packages
baseurl=http://mirrors.aliyun.com/ceph/rpm-octopus/el8/noarch
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=https://download.ceph.com/keys/release.asc

[ceph-source]
name=Ceph source packages
baseurl=http://mirrors.aliyun.com/ceph/rpm-octopus/el8/SRPMS
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=https://download.ceph.com/keys/release.asc
EOF

配置节点免密:

注意每个节点要配置hosts

172.16.88.13 ceph-1

172.16.88.14 ceph-2

172.16.88.15 ceph-3

for i in tail -n 4 /etc/hosts | awk '{print $1}'; do ssh-copy-id -i ~/.ssh/id_rsa.pub $i;done

初始化集群:

复制代码
cephadm bootstrap --mon-ip *<mon-ip>* 然后你会看到该输出

Waiting for mgr epoch 9...
mgr epoch 9 is available
Generating a dashboard self-signed certificate...
Creating initial admin user...
Fetching dashboard port number...
Ceph Dashboard is now available at:
	     URL: https://ceph-88-13:8443/
	    User: admin
	Password: 3w0ujolsfi
Enabling client.admin keyring and conf on hosts with "admin" label
Saving cluster configuration to /var/lib/ceph/788b7912-4ac8-11ed-bef2-005056bc091f/config directory
Enabling autotune for osd_memory_target
You can access the Ceph CLI as following in case of multi-cluster or non-default config:

使用cephadm shell  然后ceph status 或者是ceph  status命令可查看集群状态(注意cephadm shell是新启动一个容器然后调用ceph命令)

#查看所有组件运行状态
ceph orch ps

#查看某组件运行状态
ceph orch ps --daemon-type mon
ceph orch ps --daemon-type mgr
ceph orch ps --daemon-type mds
#查看集群状态
ceph status
#查看版本
ceph -v
相关推荐
天翼云开发者社区3 天前
0.4元/TB/月!天翼云HBlock打响软件定义存储价格战
存储·天翼云hblock
斯普信专业组7 天前
Ceph集群OSD运维手册:基础操作与节点扩缩容实战
运维·ceph
10000hours9 天前
【SGL】Scatter-Gather List内存传输技术
linux·数据结构·网络协议·list·存储·sgl
code_shenbing18 天前
C# 实现列式存储数据
开发语言·c#·存储
天翼云开发者社区25 天前
教育考试院存储系统焕新:轻量升级,无缝切换!
存储
Hehuyi_In25 天前
阿里云Clickhouse 冷热数据分层存储 实战记录
clickhouse·oss·存储·归档·冷热分层
时空无限1 个月前
CEPH OSD_SLOW_PING_TIME_FRONT/BACK 警告处理
ceph
云计算运维丁丁1 个月前
ceph集群架构阐述
ceph·架构
liuy52771 个月前
dmsetup 清理ceph osd残留磁盘分区
ceph
斯普信专业组1 个月前
ceph数据迁移数据迁移与bacula配置调整优化实战
前端·ceph·github