一、ceph介绍

  1. 操作系统需要内核版本在kernel 3.10+或CentOS7以上版本中部署
  2. 通过deploy工具安装简化部署过程,本文中选用的ceph-deploy版本为1.5.39
  3. 至少准备6个环境,分别为1个ceph-admin管理节点、3个mon/mgr/mds节点、2个osd节点

二、ceph安装

1. 部署ceph-admin

  • a) 配置主机名,配置hosts文件。
shell> hostnamectl --static set-hostname shyt-ceph-admin
shell> cat /etc/hosts
10.52.0.181 shyt-ceph-mon1
10.52.0.182 shyt-ceph-mon2
10.52.0.183 shyt-ceph-mon3
10.52.0.201 shyt-ceph-osd-node1
10.52.0.202 shyt-ceph-osd-node2
  • b) 生成ssh key文件并复制到各个节点
shell> ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:TvZDQwvZpIKFAeSyh8Y1QhEOG9EzKaHaNN1rMl8kxfI root@shyt-ceph-admin
The key's randomart image is:
+---[RSA 2048]----+
|=O=o.o... .      |
|*+=..+...=      |
|+++=o +o= o      |
|o*o..  =Eo .    |
|+oo o o S +      |
|..  = = o .    |
|      . . o      |
|          .    |
|                |
+----[SHA256]-----+shell> ssh-copy-id shyt-ceph-mon1
shell> ssh-copy-id shyt-ceph-mon2
shell> ssh-copy-id shyt-ceph-mon3
shell> ssh-copy-id shyt-ceph-osd-node1
shell> ssh-copy-id shyt-ceph-osd-node2
  • c) 安装ceph-deploy
# 修改本地yum源
shell> wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
shell> yum clean all
shell> yum makecacheshell> yum -y install https://mirrors.aliyun.com/ceph/rpm-mimic/el7/noarch/ceph-deploy-1.5.39-0.noarch.rpm
shell> ceph-deploy --version
1.5.39
  • d) 创建部署目录
shell> mkdir deploy_ceph_cluster && cd deploy_ceph_cluster

2. 部署mon/mgr/mds节点

  • a) 配置主机名
shell> hostnamectl --static set-hostname shyt-ceph-mon1
  • b) 修改yum源
shell> wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
shell> wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
shell> yum clean all
shell> yum makecache
  • c) 创建Ceph Monitor节点(在ceph-admin中执行)
# 生成ceph配置文件、monitor秘钥文件以及部署日志文件。
shell> ceph-deploy new shyt-ceph-mon1 shyt-ceph-mon2 shyt-ceph-mon3
  • d) 在ceph.conf配置中增加以下信息(注释版详见附件)
shell> cat /etc/ceph/ceph.conf
[global]osd pool default size = 3osd pool default min size = 1public network = 10.52.0.0/24cluster network = 10.52.0.0/24cephx require signatures = truecephx cluster require signatures = truecephx service require signatures = truecephx sign messages = true[mon]mon data size warn = 15*1024*1024*1024mon data avail warn = 30mon data avail crit = 10# 由于ceph集群中存在异构PC,导致时钟偏移总是大于默认0.05s,为了方便同步直接把时钟偏移设置成0.5smon clock drift allowed = 2mon clock drift warn backoff = 30mon allow pool delete = truemon osd allow primary affinity = true[osd]osd journal size = 10000osd mkfs type = xfsosd max write size = 512osd client message size cap = 2147483648osd deep scrub stride = 131072osd op threads = 16osd disk threads = 4osd map cache size = 1024osd map cache bl size = 128#osd mount options xfs = "rw,noexec,nodev,noatime,nodiratime,nobarrier"osd recovery op priority = 5osd recovery max active = 10osd max backfills = 4osd min pg log entries = 30000osd max pg log entries = 100000osd mon heartbeat interval = 40ms dispatch throttle bytes = 148576000objecter inflight ops = 819200osd op log threshold = 50osd crush chooseleaf type = 0filestore xattr use omap = truefilestore min sync interval = 10filestore max sync interval = 15filestore queue max ops = 25000filestore queue max bytes = 1048576000filestore queue committing max ops = 50000filestore queue committing max bytes = 10485760000filestore split multiple = 8filestore merge threshold = 40filestore fd cache size = 1024filestore op threads = 32journal max write bytes = 1073714824journal max write entries = 10000journal queue max ops = 50000journal queue max bytes = 10485760000[mds]debug ms = 1/5[client]rbd cache = truerbd cache size = 335544320rbd cache max dirty = 134217728rbd cache max dirty age = 30rbd cache writethrough until flush = falserbd cache max dirty object = 2rbd cache target dirty = 235544320
  • e) 安装ceph软件包
shell> ceph-deploy install shyt-ceph-mon1 shyt-ceph-mon2 shyt-ceph-mon3 \
--release mimic \
--repo-url http://mirror.tuna.tsinghua.edu.cn/ceph/rpm-mimic/el7/ \
--gpg-url http://mirror.tuna.tsinghua.edu.cn/ceph/keys/release.asc
  • f) 配置初始monitor、并收集所有密钥
shell> ceph-deploy mon create-initial
  • g) 分发配置文件
# 通过ceph-deploy将配置文件以及密钥拷贝至其他节点,使得不需要指定mon地址以及用户信息就可以直接管理我们的ceph集群
shell> ceph-deploy admin shyt-ceph-mon1 shyt-ceph-mon2 shyt-ceph-mon3
  • h)配置mgr
# 运行ceph health,打印
# HEALTH_WARN no active mgr
# 自从ceph 12开始,manager是必须的,应该为每个运行monitor的机器添加一个mgr,否则集群处于WARN状态。
shell> ceph-deploy mgr create shyt-ceph-mon1:cephsvr-16101 shyt-ceph-mon2:cephsvr-16102 shyt-ceph-mon3:cephsvr-16103# 提示:当ceph-mgr发生故障,相当于整个ceph集群都会出现严重问题,
# 建议在每个mon中都创建独立的ceph-mgr(至少3个ceph mon节点),只需要在每个mon节点参考上面的方法进行创建即可(每个mgr需要不同的独立命名)。 # 关闭ceph-mgr的方式
shell> systemctl stop ceph-mgr@cephsvr-16101

3. 部署osd节点

  • a) 配置主机名
shell> hostnamectl --static set-hostname shyt-ceph-osd-node1
  • b) 修改yum源
shell> wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
shell> wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
shell> yum clean all
shell> yum makecache
  • c) 安装ceph软件包
shell> ceph-deploy install shyt-ceph-osd-node1 shyt-ceph-osd-node2 \
--release mimic \
--repo-url http://mirror.tuna.tsinghua.edu.cn/ceph/rpm-mimic/el7/ \
--gpg-url http://mirror.tuna.tsinghua.edu.cn/ceph/keys/release.asc
  • d) 配置osd节点
shell> ceph-deploy disk zap shyt-ceph-osd-node1:sdb shyt-ceph-osd-node1:sdc shyt-ceph-osd-node1:sdd
shell> ceph-deploy osd create shyt-ceph-osd-node1:sdb shyt-ceph-osd-node1:sdc shyt-ceph-osd-node1:sdd
  • e) 分发配置文件
shell> ceph-deploy admin shyt-ceph-osd-node1 shyt-ceph-osd-node2# 查看ceph osd节点状态
shell> ceph -s
shell> ceph osd tree

三、启用Dashboard

  • 在任意节点中执行,开启dashboard支持
# 启用dashboard插件
shell> ceph mgr module enable dashboard
# 生成自签名证书
shell> ceph dashboard create-self-signed-cert
Self-signed certificate created
# 配置dashboard监听IP和端口
shell> ceph config set mgr mgr/dashboard/server_port 8080
# 配置dashboard认证
shell> ceph dashboard set-login-credentials root 123456
Username and password updated
# 关闭SSL支持,只用HTTP的方式访问
shell> ceph config set mgr mgr/dashboard/ssl false
# 每个mon节点重启dashboard使配置生效
shell> systemctl restart ceph-mgr.target
# 浏览器访问 http://10.52.0.181:8080# 查看ceph-mgr服务
shell> ceph mgr services
{"dashboard": "http://shyt-ceph-mon1:8080/"
}

四、创建Ceph MDS角色

1. 安装ceph mds

# 为防止单点故障,需要部署多台MDS节点
shell> ceph-deploy mds create shyt-ceph-mon1 shyt-ceph-mon2 shyt-ceph-mon3

2、手动创建data和metadata池

shell> ceph osd pool create data 128 128
shell> ceph osd pool create metadata 128 128
shell> ceph fs new cephfs metadata data
shell> ceph mds stat
cephfs-1/1/1 up {0=shyt-ceph-mon3=up:active}, 2 up:standby

3、挂载cephfs文件系统

shell> wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
shell> wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
shell> cat >> /etc/yum.repos.d/ceph.repo << EOF
[ceph]
name=Ceph packages for $basearch
baseurl=http://mirror.tuna.tsinghua.edu.cn/ceph/rpm-mimic/el7/$basearch
enabled=1
gpgcheck=1
priority=1
type=rpm-md
gpgkey=http://mirror.tuna.tsinghua.edu.cn/ceph/keys/release.asc[ceph-noarch]
name=Ceph noarch packages
baseurl=http://mirror.tuna.tsinghua.edu.cn/ceph/rpm-mimic/el7/noarch
enabled=1
gpgcheck=1
priority=1
type=rpm-md
gpgkey=http://mirror.tuna.tsinghua.edu.cn/ceph/keys/release.asc[ceph-source]
name=Ceph source packages
baseurl=http://mirror.tuna.tsinghua.edu.cn/ceph/rpm-mimic/el7/SRPMS
enabled=0
gpgcheck=1
type=rpm-md
gpgkey=http://mirror.tuna.tsinghua.edu.cn/ceph/keys/release.asc
priority=1EOFshell> yum clean all
shell> yum makecache
shell> yum -y install https://mirrors.aliyun.com/ceph/rpm-mimic/el7/x86_64/ceph-fuse-13.2.5-0.el7.x86_64.rpm
# 创建ceph目录,将ceph.client.admin.keyring和ceph.conf文件拷贝到该目录下。
shell> mkdir /etc/ceph/
# 创建挂载目录
shell> mkdir /storage
shell> ceph-fuse /storage
# 加入开机启动项
shell> echo "ceph-fuse /storage" >> /etc/rc.d/rc.local

转载于:https://www.cnblogs.com/91donkey/p/10938488.html

通过ceph-deploy搭建ceph 13.2.5 mimic相关推荐

  1. ceph1--ceph基础/搭建ceph高可用集群

    一.ceph基础 0.存储分类 单机存储 SCSI/IDE/SATA//SAS/USB/PCI-E/SSD/M.2NVME协议(提升性能) https://item.jd.com/4962067795 ...

  2. 最新版本 release版本 ceph分布式存储搭建(rook-1.8.6)

    rook+ceph ceph简介: Rook 是 Kubernetes 的开源云原生存储编排器,为各种存储解决方案提供平台.框架和支持,以与云原生环境进行原生集成. Rook 将存储软件转变为自我管理 ...

  3. Kubernetes 集群基于 Rook 搭建 Ceph 分布式存储系统

    文章目录 1.Rook & Ceph 介绍 1.1.Rook 1.2.Ceph 2.环境.软件准备 3.Kubernetes HA 集群搭建 4.部署 Rook Operator 5.配置 R ...

  4. 学习CentOS7下使用ceph-deploy搭建Ceph

    Ceph 独一无二地在一个统一的系统中同时提供了对象.块.和文件存储功能. Ceph 简介 http://docs.ceph.org.cn/start/intro/ 不管你是想为云平台提供Ceph 对 ...

  5. cephadm搭建ceph集群

    **前言:**2022年7月26日,使用cephadm进行ceph集群的搭建,使用ceph octopus版本,v15.2.16. 一.cephadm简介 Cephadm通过manager daemo ...

  6. ubuntu 搭建 ceph

    ubuntu 搭建 ceph 首先理解三个概念: 文件存储系统,快存储系统,对象存储系统 准备工作: 虚拟机三台: ip: 192.168.87.132 ceph-admin ip: 192.168. ...

  7. Ceph存储搭建及在k8s中的使用

    一.基础环境准备 主机IP 主机名 部署服务 备注 192.168.0.91 admin-node ceph.ceph-deploy.mon mon节点又称为master节点 192.168.0.92 ...

  8. ceph怎么搭建文件存储_SUSE专家谈Ceph落地之最佳实践

    点击上方"蓝字",欢迎关注! 软件定义存储业内的重要开源项目Ceph可以说是目前业内最流行,应用最广泛的开源软件定义存储.近日,在第三届软件定义存储线上峰会上,SUSE中国区技术总 ...

  9. CentOS 7 搭建 Ceph 集群(nautilus 版本)

    推荐阅读 Helm3(K8S 资源对象管理工具)视频教程:https://edu.csdn.net/course/detail/32506 Helm3(K8S 资源对象管理工具)博客专栏:https: ...

最新文章

  1. MBaen+Timer=减少数据库调用
  2. Running /usr/bin/wineserver -w. This will hang until all wine processes XXXX terminate
  3. 适用于python机器学习与实践的twenty_newsgroups.py文件内容
  4. 原型模式——创建型模式
  5. FFT字符串匹配(解决通配符问题)
  6. 检查列表中的所有元素在Python中是否相同
  7. Android SqlLite数据库的创建、增、删、改、查、使用事务
  8. redis中集群的故障恢复
  9. MySQL 创建注册页面_网站添加注册/登录界面
  10. 《从Excel到R 数据分析进阶指南》一2.6 查看数据表数值
  11. 文件扩展名(后缀名)是什么?win10怎么显示扩展名?
  12. BMS一体机 锂电池管理系统
  13. Android Studio 工具栏添加图标
  14. 系统之家xp服务器系统怎么安装,系统之家教你如何用u盘装xp系统
  15. Codeforces Round #717 (Div. 2)-A. Tit for Tat-题解
  16. 王者荣耀微信哪个服务器怎么选,王者荣耀:国服战力对比!手Q和微信哪个大区的战力更胜一筹?...
  17. LibreOffice for Mac(Office办公套件)
  18. C4D R25调节网格间距的方法
  19. 苹果换芯简史:芯片如何改变苹果的电脑产品线?
  20. 0009基于51单片机智能门禁系统设计

热门文章

  1. An Algorithm Summary of Programming Collective Intelligence (1)
  2. scipy是python下的什么_SciPy是什么
  3. linux光标美化包,使用 [ powerlevel10k ] 美化你的WSL (Linux)
  4. rust python对比_Python Rust 迭代器对比
  5. hashset去重原理_基于simhash的文本去重原理
  6. CSDN挑战编程——《数学问题》
  7. C/C++编译、测试须知、须会,CMake、Boost等
  8. 《MySQL——数据表设计三大范式》
  9. 源码 状态机_[源码阅读] 阿里SOFA服务注册中心MetaServer(1)
  10. java多线程知识_学习知库丨Java多线程知识大全