ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

ceph-ansible(host)

2022-01-11 23:00:00  阅读:255  来源: 互联网

标签:sample ceph host ansible stable cp yml


ceph-ansible官网

检查环境

  1. ansible主机

    • ansible安装

      yum install ansible -y

    • 设置host

      # vim /etc/ansible/hosts
      [mons]
      node01
      node02
      node03
      
      [mgrs]
      node01
      node02
      node03
      
      [osds]
      node01
      node02
      node03
      
      [rgws]
      node01
      node02
      node03
      
      [mdss]
      node01
      node02
      node03
      
      [grafana-server]
      node01
      
  2. ceph集群

    • 配置IP
    • 配置主机名
    • 配置HOSTS文件
    • 配置加速源(EPEL)
    • 配置时钟同步
    • 关闭 SELinux
    • 关闭Firewalld
    • 设置免密登录

选择ceph-ansible

安装不同的ceph版本需要选择不同的ceph-ansible,一般来说ansible不需要替换

按下图进行选择:

image-20210215172721682版本选择

例如选择nautilus

wget -q -O ceph-ansible-stable-4.0.zip https://codeload.github.com/ceph/ceph-ansible/zip/stable-4.0
unzip ceph-ansible-stable-4.0.zip
mv ceph-ansible-stable-4.0.zip ceph-ansible

设置ymal文件

  1. 修改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 #此处需要注意一下 centos7不能无法自动设置dashboard,需要置为false
    dashboard_admin_user: admin
    dashboard_admin_password: [email protected]
    grafana_admin_user: admin
    grafana_admin_password: [email protected]
    
  2. osd配置

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

    此处需要特别注意下:

    devices这里的"#"也需要注释掉,否则无法识别到盘

  3. 其他配置

    # 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
    
  4. 安装文件配置(site.yaml)

    不需要的功能注释掉

  5. 安装

    ansible-playbook site.yml

  6. 安装完成

  1. 重置ceph集群

    1. 需要先将group_vars/下的内容复制到/etc/ansible/group_vars/下面(group_vars/需要自己创建),如果不这样做,会找不到ceph集群

    2. 执行命令 ansible-playbook infrastructure-playbooks/purge-cluster.yml

遇到的坑

  1. 安装mon的时候报错

    依赖没有装,装上就可以了

  2. 安装mgr遇到无法安装

    直接在ceph集群中的机器上面测试

    yum install ceph-mgr -y

    测试ceph源是否有问题

  3. 重置集群之后可能会导致安装包产生冲突

    Transaction Check Error:

    conflicts with file from package

    解决方案:卸载后面一个包

参考

标签:sample,ceph,host,ansible,stable,cp,yml
来源: https://blog.csdn.net/weixin_42340926/article/details/122407926

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有