Ceph自動化部署----Ceph-ansible


Ceph自動化部署----Ceph-ansible

一、前言——Ceph的幾種不同的部署方式

  • 手動部署
  • Helm+kubernetes部署
  • Ceph-deploy部署
  • Ceph-ansible部署

操作系統:CentOS-7.6(1810)

二、使用Ceph-ansible部署Ceph

  1. 從GIT上面拷貝源代碼到本地

    # git clone https://github.com/ceph/ceph-ansible.git 
    
  2. 切換到stable-3.1版本(git的相關使用方式,詳情請自行查詢)

    # cd  ceph-ansible     //進入到ceph-ansible目錄下
    # git branch -r   //查看系統分支
    # git fetch origin stable-3.1  //將遠端得3.1拉到本地
    # git chechout  stable-3.1  //切換到3.1分支
    
  3. 安裝ansible,使用pip去安裝ansible。

    # pip install -r requirements.txt
    
  4. 創建Inventory列表

    只 創建如下角色,我們只部署Ceph得基本功能

    [mons]
    node1
    node2
    node3
    
    [osds]
    node1
    node2
    node3
    
    [rgws]
    node1
    node2
    node3
    
    [clients]
    node1
    node2
    node3
    
    [mgrs]
    node1
    node2
    node3
    
  5. 拷貝group_vars/all.yml.sample 到group_vars/all.yml,並修改all.yml 文件,添加如下參數:

    ceph_origin: repository
    ceph_repository: community
    ceph_mirror: https://mirrors.163.com/ceph/
    ceph_stable_release: luminous
    ceph_stable_repo: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}"
    ceph_stable_redhat_distro: el7
    monitor_interface: eth1
    journal_size: 1024
    public_network: 192.168.9.0/24
    cluster_network: 192.168.10.0/24
    osd_objectstore: filestore
    radosgw_interface: "{{ monitor_interface }}"
    osd_auto_discovery: true
    
  6. 拷貝site.yml.sample 到site.yml(注釋掉一些host,效果如下:)

    - hosts:
      - mons
      - agents
      - osds
     # - mdss
      - rgws
     # - nfss
     # - restapis
     # - rbdmirrors
      - clients
      - mgrs
     # - iscsigws
     # - iscsi-gws # for backward compatibility only!
    
    
  7. 執行部署操作

    ansible-playbook  -i hosts  site.yml
    

注意事項:

部署集群之前,還要做一些操作:

1、每台服務器上做地址解析

2、服務器之間做互信(可以免密登錄)

3、使用chrony 做時間同步

三、后續更新。。。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM