首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >使用ceph-ansible部署Ceph Octopus

使用ceph-ansible部署Ceph Octopus

作者头像
tanmx
发布2021-01-03 20:43:12
4.1K0
发布2021-01-03 20:43:12
举报

之前用的是 ceph-deploy 部署 ceph 集群,在官网的最新介绍中有如下描述:

ceph-deploy is no longer actively maintained. It is not tested on versions of Ceph newer than Nautilus. It does not support RHEL8, CentOS 8, or newer operating systems.

ceph-deploy 已经不在维护,并且在 ceph Nautilus 之后都没有很好的测试,不支持 RHEL8、CentOS8等系统。对比了 ceph-ansible 和 cephadm 这两个工具,最终选择的 ceph-ansible 作为部署工具。

主机角色

Hostname

Role

Admin/Public Network

Cluster Network

OS

node01.ceph.local

ceph-ansible,mon,mgr,osd,rgw,mds,grafana

192.168.198.131/24

172.20.1.131/24

CentOS Linux release 8.3.2011

node02.ceph.local

mon,mgr,osd,rgw,mds

192.168.198.132/24

172.20.1.132/24

CentOS Linux release 8.3.2011

node03.ceph.local

mon,mgr,osd,rgw,mds

192.168.198.133/24

172.20.1.133/24

CentOS Linux release 8.3.2011

前期准备

包括配置IP配置主机名配置HOSTS文件配置加速源(EPEL)配置时钟同步关闭 SELinux关闭Firewalld设置免密登录等,不再赘述。

Ansible配置

1.ansible安装

使用以下命令安装 ansible, ceph-ansible stable 5.x 需要 ansible 2.9 源中的版本满足需求,可以直接 yum 安装

# yum install ansible -y

2.主机配置

编辑 /etc/ansible/hosts 加入以下内容

# vim /etc/ansible/hosts

[mons]
node01.ceph.local
node02.ceph.local
node03.ceph.local

[mgrs]
node01.ceph.local
node02.ceph.local
node03.ceph.local

[osds]
node01.ceph.local
node02.ceph.local
node03.ceph.local

[rgws]
node01.ceph.local
node02.ceph.local
node03.ceph.local

[mdss]
node01.ceph.local
node02.ceph.local
node03.ceph.local

[grafana-server]
node01.ceph.local

ceph-ansible配置

1.下载 ceph-ansible

下载 5.x 版本的 ceph-ansible

# wget https://github.com/ceph/ceph-ansible/archive/v5.0.3.tar.gz

2.安装 ceph-ansible 依赖

# tar zxvf v5.0.3.tar.gz
# yum install python-pip
# pip install -r ceph-ansible/requirements.txt

3.修改安装 ceph 配置

# cd ceph-ansible/group_vars/
# mv all.yml.sample all.yml
# grep -Ev '^#|^$' all.yml
---
dummy:
ceph_repository_type: repository
ceph_origin: repository
ceph_repository: community
ceph_mirror: https://mirrors.tuna.tsinghua.edu.cn/ceph/
ceph_stable_key: https://mirrors.tuna.tsinghua.edu.cn/ceph/keys/release.asc
ceph_stable_release: octopus
ceph_stable_repo: https://mirrors.tuna.tsinghua.edu.cn/ceph/rpm-15.2.7/el7/
monitor_interface: eth0
public_network: 192.168.198.0/24
cluster_network: 172.20.1.0/24
osd_objectstore: bluestore
radosgw_civetweb_port: 8080
radosgw_interface: eth0
dashboard_enabled: True
dashboard_admin_user: admin
dashboard_admin_password: [email protected]
grafana_admin_user: admin
grafana_admin_password: [email protected]

4.osd配置

按照服务器配置的磁盘修改以下配置文件

# cp osds.yml.sample osds.yml
# grep -Ev '^#|^$' osds.yml
---
dummy:
devices:
  - /dev/sdb
  - /dev/sdc

5.其他配置

复制其他的配置文件

# cp clients.yml.sample clients.yml
# cp mons.yml.sample mons.yml
# cp mgrs.yml.sample mgrs.yml
# cp rgws.yml.sample rgws.yml

# cd ../
# cp site.yml.sample site.yml

开始安装

执行以下命令开始安装

# ansible-playbook site.yml

完成安装后查看集群状态:

# ceph -s
  cluster:
    id:     6e344dd2-341a-4bb6-aafa-4299a0ebbe51
    health: HEALTH_OK

  services:
    mon: 3 daemons, quorum node01.ceph.local,node02.ceph.local,node03.ceph.local (age 6m)
    mgr: node01.ceph.local(active, since 40s), standbys: node02.ceph.local, node02.ceph.local
    mds: cephfs:1 {0=node01.ceph.local=up:active} 2 up:standby
    osd: 12 osds: 12 up (since 2m), 12 in (since 23m)
    rgw: 3 daemons active (node01.ceph.local.rgw0, node02.ceph.local.rgw0, 3.ceph.local.rgw0)

  data:
    pools:   6 pools, 144 pgs
    objects: 212 objects, 6.4 KiB
    usage:   12 GiB used, 9.8 TiB / 9.8 TiB avail
    pgs:     144 active+clean

清理安装

如果安装出错,或者遇到其他问题,可以清理集群后再次尝试安装

# ansible-playbook infrastructure-playbooks/purge-cluster.yml
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-12-31,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 主机角色
  • 前期准备
  • Ansible配置
    • 1.ansible安装
      • 2.主机配置
      • ceph-ansible配置
        • 1.下载 ceph-ansible
          • 2.安装 ceph-ansible 依赖
            • 3.修改安装 ceph 配置
              • 4.osd配置
                • 5.其他配置
                • 开始安装
                • 清理安装
                相关产品与服务
                Grafana 服务
                Grafana 服务(TencentCloud Managed Service for Grafana,TCMG)是腾讯云基于社区广受欢迎的开源可视化项目 Grafana ,并与 Grafana Lab 合作开发的托管服务。TCMG 为您提供安全、免运维 Grafana 的能力,内建腾讯云多种数据源插件,如 Prometheus 监控服务、容器服务、日志服务 、Graphite 和 InfluxDB 等,最终实现数据的统一可视化。
                领券
                问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档