==== Ceph deploy via Ansible [Ubuntu 20.04] ====
==== Ссылка на документацию: ====
----
* [[https://docs.ceph.com/projects/ceph-ansible/en/latest/https://docs.ceph.com/projects/ceph-ansible/en/latest/|https://docs.ceph.com/projects/ceph-ansible/en/latest/https://docs.ceph.com/projects/ceph-ansible/en/latest/]]
==== Развертываем кластер ====
----
Установите необходимые пакеты и копию ключа SSH
# 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
=== Изменить group_vars (разверните как образ Docker) ===
**cluster_network:** сеть кластера ceph, используется для репликацию OSD и т. д.
**public_network:** используется для клиентов и монитора, публичная сеть
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
=== Изменить group_vars [Минимальный интерфейс] ===
Master branch содержит ветку quincy. Если вы хотите продолжить работу с pacific, проверьте тег и измените дистрибутив с помощью команды # 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 Playbooks
root@yjwang0-ceph-01:~/ceph-ansible# ansible-playbook -i inventory.ini site-container.yml.sample
Когда всё закончится, будет создан кластер с 3 OSD.
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