Ceph自動化部署----Ceph-ansible
一、前言——Ceph的幾種不同的部署方式
- 手動部署
- Helm+kubernetes部署
- Ceph-deploy部署
- Ceph-ansible部署
操作系統:CentOS-7.6(1810)
二、使用Ceph-ansible部署Ceph
-
從GIT上面拷貝源代碼到本地
# git clone https://github.com/ceph/ceph-ansible.git
-
切換到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分支
-
安裝ansible,使用pip去安裝ansible。
# pip install -r requirements.txt
-
創建Inventory列表
只 創建如下角色,我們只部署Ceph得基本功能
[mons] node1 node2 node3 [osds] node1 node2 node3 [rgws] node1 node2 node3 [clients] node1 node2 node3 [mgrs] node1 node2 node3
-
拷貝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
-
拷貝site.yml.sample 到site.yml(注釋掉一些host,效果如下:)
- hosts: - mons - agents - osds # - mdss - rgws # - nfss # - restapis # - rbdmirrors - clients - mgrs # - iscsigws # - iscsi-gws # for backward compatibility only!
-
執行部署操作
ansible-playbook -i hosts site.yml
注意事項:
部署集群之前,還要做一些操作:
1、每台服務器上做地址解析
2、服務器之間做互信(可以免密登錄)
3、使用chrony 做時間同步
三、后續更新。。。