YJWANG

[Ceph] Ceph Ansible [Ubuntu 20.04] 본문

60.Cloud/61.Ceph

[Ceph] Ceph Ansible [Ubuntu 20.04]

왕영주 2021. 3. 17. 18:15

refer to :


 

Deploy Cluster


필요 패키지 설치 & SSH key copy

# apt update;apt -y install python3-pip
# git clone https://github.com/ceph/ceph-ansible.git;cd ceph-ansible/
# pip3 install -r requirements.txt

# ssh-keygen -N "" -f /root/.ssh/id_rsa
# ssh-copy-id 10.99.70.30
# ssh-copy-id 10.99.70.31
# ssh-copy-id 10.99.70.32

 

inventory 설정

root@yjwang0-ceph-01:~/ceph-ansible# cat inventory.ini 
[mons]
yjwang0-ceph-01 ansible_host="10.99.70.30"
yjwang0-ceph-02 ansible_host="10.99.70.31"
yjwang0-ceph-03 ansible_host="10.99.70.32"

[osds:children]
mons

[mgrs:children]
mons

[monitoring:children]
mons

[clients:children]
mons

[mdss:children]
mons

 

group_vars 파일 복사

root@yjwang0-ceph-01:~/ceph-ansible# mv group_vars/all.yml.sample group_vars/all.yml
root@yjwang0-ceph-01:~/ceph-ansible# mv group_vars/osds.yml.sample group_vars/osds.yml

 

[1] group_vars 수정 (Docker Image로 배포)

  • cluster_network : OSD 복제등 사용
  • public_network : Client 및 Monitor 이용시 사용
root@yjwang0-ceph-01:~/ceph-ansible# grep -vE '^#|^$' group_vars/all.yml 
---

dummy:  
cluster: ceph  
ntp_service_enabled: true  
ntp_daemon_type: chronyd

monitor_interface: ens3  
public_network: "10.99.70.0/24"  
cluster_network: "10.99.99.0/24"  
ip_version: ipv4

containerized_deployment: true  
ceph_docker_image: "ceph/daemon"  
ceph_docker_image_tag: latest-master  
ceph_docker_registry: docker.io  
ceph_docker_registry_auth: false  
ceph_client_docker_image: "{{ ceph_docker_image }}"  
ceph_client_docker_image_tag: "{{ ceph_docker_image_tag }}"  
ceph_client_docker_registry: "{{ ceph_docker_registry }}"

dashboard_enabled: True  
dashboard_protocol: https  
dashboard_port: 8443  
dashboard_admin_user: admin  
dashboard_admin_user_ro: false  
dashboard_admin_password: p@ssw0rd  
grafana_admin_user: admin  
grafana_admin_password: admin

 

[2] group_vars 수정 [Minimal Interface]

현재 master branch를 사용 중이기 때문에 quincy로 해야만 진행이 됩니다. pacific 버전으로 진행하고 싶은 경우 tag를 확인한 후 # git tag -f v6.0.11 명령을 통해 변경하고 진행하시기 바랍니다.

# grep -vE '^#|^$' group_vars/all.yml
---
dummy:
cluster: ceph
ntp_service_enabled: true
ceph_origin: repository
ceph_repository: community
ceph_mirror: https://download.ceph.com
ceph_stable_key: https://download.ceph.com/keys/release.asc
ceph_stable_release: quincy
ceph_stable_repo: "{{ ceph_mirror }}/debian-pacific"
monitor_interface: ens2
public_network: 10.99.99.0/24
dashboard_enabled: False

 

osds group_vars 수정

root@yjwang0-ceph-01:~/ceph-ansible# grep -vE '^#|^$' group_vars/osds.yml 
---
dummy:
copy_admin_key: true
devices:
  - /dev/vda

 

Ansible Playbook 실행

root@yjwang0-ceph-01:~/ceph-ansible# ansible-playbook -i inventory.ini site-container.yml.sample 

 

위 배포가 끝나면 osd가 총 3개인 Cluster가 생성된다.

root@yjwang0-ceph-01:~/ceph-ansible# docker exec ceph-mon-yjwang0-ceph-01 ceph -s
  cluster:
    id:     590e311e-f12f-4d3e-ac01-89a8e039dae3
    health: HEALTH_OK

  services:
    mon: 3 daemons, quorum yjwang0-ceph-01,yjwang0-ceph-02,yjwang0-ceph-03 (age 18m)
    mgr: yjwang0-ceph-02(active, since 8m), standbys: yjwang0-ceph-03, yjwang0-ceph-01
    osd: 3 osds: 3 up (since 13m), 3 in (since 14m)

  data:
    pools:   1 pools, 128 pgs
    objects: 0 objects, 0 B
    usage:   19 MiB used, 28 GiB / 28 GiB avail
    pgs:     128 active+clean
반응형