目 录CONTENT

文章目录

ceph部署

所念皆星河
2024-01-02 / 0 评论 / 0 点赞 / 56 阅读 / 3497 字

前期配置免密登入 hosts配置

一、配置ceph源

# cat /etc/yum.repos.d/ceph.repo
[ceph]
name=Ceph packages for $basearch
baseurl=http://mirrors.aliyun.com/ceph/rpm-luminous/el7/$basearch
enabled=1
gpgcheck=1
priority=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-luminous/el7/noarch
enabled=1
gpgcheck=1
priority=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-luminous/el7/SRPMS
enabled=0
gpgcheck=1
type=rpm-md
gpgkey=https://download.ceph.com/keys/release.asc
priority=1

# yum clean all
# yum makecache

二、安装cep-deploy工具

# yum -y remove epel-release
# yum install ceph-deploy -y

三、部署MON服务

1.创建文件目录

# mkdir /root/my-cluster
# cd /root/my-cluster

2.进入到管理目录,执行以下命令创建集群

ceph-deploy new qigx1 qigx2 qigx3

创建集群后,部署路径下生成三个文件,ceph.conf是Ceph的配置文件,ceph-deploy-ceph.log是Ceph的日志文件,ceph.mon.keyring是Ceph的MON的认证文件

3.修改配置文件

[global]
fsid = d970d425-1422-400c-9511-3298138fb054
mon_initial_members = qigx1, qigx2, qigx3
mon_host = 172.21.9.80,192.168.121.130,192.168.121.129
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx

public network =192.168.10.0/23 #外部访问集群的网络
cluster network =192.168.10.0/23 #集群内部网络
#默认osd pool的数量,此配置要和用于做存储的磁盘数量一致
osd pool default size = 3
rbd_default_format = 2
#设置monitor之间的时差,默认为0.5
mon clock drift allowed = 2
mon clock drift warn backoff = 30

[osd]
osd data = /var/lib/ceph/osd/ceph-$id

# 允许删除pool
mon_allow_pool_delete = true
[mgr]
# 开启WEB仪表盘
mgr modules = dashboard

4.安装ceph服务

ceph-deploy install qigx1 qixg2 qixg3

5.初始化监控节点

# ceph-deploy mon create-initial

6.有问题清理配置重新来过

清理 Ceph 安装包
ceph-deploy purge qigx1 qigx2 qigx3
清理 Ceph 配置文件
ceph-deploy purgedata qigx1 qigx2 qigx3
ceph-deploy forgetkeys

7.赋予所有mon节点管理员权限

[root@storage01 my-cluster]# ceph-deploy admin storage01 storage02 storage03

0

评论区