如何使用Ceph 14.2.22原生命令搭建单机版Ceph集群?

摘要:本文将介绍如何在 ubuntu 18.04 中使用 ceph 原生命令部署一个完整的 ceph 集群,ceph 版本为 14.2.22。
1. 前言 上表中是 Ceph 官方文档给出的 Ceph 14 版本的系统和内核推荐,其中在 centos 7、ubuntu 14.04、ubuntu 16.04、ubuntu 18.04 上都做了完整的测试。本文将介绍如何在 ubuntu 18.04 中使用 ceph 原生命令部署一个完整的 ceph 集群,ceph 版本为 14.2.22。 2. 环境配置 2.1. 关闭防火墙 systemctl stop ufw.service systemctl disable ufw.service 2.2. 设置 ceph apt 源 为了加快下载速度,此处使用阿里云开源镜像站: echo "deb [trusted=yes] https://mirrors.aliyun.com/ceph/debian-nautilus/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/ceph.list trusted=yes 表示临时禁用 GPG 验证,从而避免必须添加 ceph release.asc 密钥。 2.3. 更新 apt clean && apt update 3. 基础集群部署 3.1. 基础集群规划 node name node ip component name ------------------------------------------------- node0 192.168.3.10 [mon.a, mon.b, mon.c, mgr.a, mgr.b, mgr.c, osd.0, osd.1, osd.2] 上述集群中只有 node0 一个节点,该节点上会部署 3 个 mon 服务,3 个 mgr 服务,3 个 osd 服务。 3.2. 安装 ceph apt install ceph ceph-mon ceph-mgr ceph-osd ceph-mds radosgw 3.3. 创建 client.admin key 在 Ceph 的 cephx 认证体系中,client.admin 是一个预定义的特殊用户,拥有对整个集群的完全访问权限,它可以执行几乎所有管理操作。没有 client.admin,你就没有一个默认的“root”账户来管理集群。换句话说,client.admin 是部署和运维的操作入口。 几乎所有 Ceph 命令行工具(如 ceph, rados, rbd, cephfs 等)在未指定用户时,默认尝试加载 client.admin 的密钥。ceph 14.2.22 中不会自动创建 client.admin key,必须手动创建。测试发现 client.admin key 必须在初始化 mon 之前就创建好,否则后续不好导入到 mon 的 auth 库中,导致 ceph 所有命令都无法使用。
阅读全文