Deploying docker-based CEPH cluster using ceph-ansible
Install ansible
For installing ansible and configuring secret-free login between nodes, this is not covered here. Please refer to Official Documents.
Download ceph-ansible
git clone https://github.com/ceph/ceph-ansible.git cd ceph-ansible # Refer to the official document of ceph-ansible http://docs.ceph.com/ceph-ansible/master for branch instructions./ # stable-3.1 Support for Ceph version luminous and mimic. This branch supports Ansible version 2.4. git checkout stable-3.1
Configure ceph-ansible
cp group_vars/all.yml.sample group_vars/all.yml cp group_vars/osds.yml.sample group_vars/osds.yml cp site-docker.yml.sample site-docker.yml
Edit the group_vars/all.yml file. The following information should be adapted according to the actual situation.
generate_fsid: true monitor_interface: ens5f0 journal_size: 5120 public_network: 192.168.74.0/24 cluster_network: 192.168.74.0/24 ceph_docker_image: "ceph/daemon" ceph_docker_image_tag: master-d4b8dde-mimic-centos-7-x86_64 containerized_deployment: true ceph_docker_registry: docker.io radosgw_interface: ens5f0
Edit the group_vars/osds.yml file. The following information should be adapted according to the actual situation.
osd_scenario: non-collocated osd_objectstore: bluestore dmcrypt: false devices: - /dev/sda - /dev/sdb - /dev/sdc dedicated_devices: - /dev/sdd - /dev/sdd - /dev/sdd bluestore_wal_devices: - /dev/sdd - /dev/sdd - /dev/sdd
Create hosts file, the following information should be adapted according to the actual situation.
[mons] 192.168.74.200 ansible_connection=ssh ansible_ssh_user=root ansible_ssh_pass=Met@2020comp 192.168.74.201 ansible_connection=ssh ansible_ssh_user=root ansible_ssh_pass=Met@2020comp 192.168.74.202 ansible_connection=ssh ansible_ssh_user=root ansible_ssh_pass=Met@2020comp [mgrs] 192.168.74.200 ansible_connection=ssh ansible_ssh_user=root ansible_ssh_pass=Met@2020comp 192.168.74.201 ansible_connection=ssh ansible_ssh_user=root ansible_ssh_pass=Met@2020comp 192.168.74.202 ansible_connection=ssh ansible_ssh_user=root ansible_ssh_pass=Met@2020comp [osds] 192.168.74.200 ansible_connection=ssh ansible_ssh_user=root ansible_ssh_pass=Met@2020comp 192.168.74.201 ansible_connection=ssh ansible_ssh_user=root ansible_ssh_pass=Met@2020comp 192.168.74.202 ansible_connection=ssh ansible_ssh_user=root ansible_ssh_pass=Met@2020comp [rgws] 192.168.74.200 ansible_connection=ssh ansible_ssh_user=root ansible_ssh_pass=Met@2020comp 192.168.74.201 ansible_connection=ssh ansible_ssh_user=root ansible_ssh_pass=Met@2020comp 192.168.74.202 ansible_connection=ssh ansible_ssh_user=root ansible_ssh_pass=Met@2020comp
Start deployment
If the following command fails, the log file defaults to / var/log/ansible.log, you can refer to the error log for processing. (Note: During deployment, docker will be installed by default on each node. This step script does not determine whether the current machine has docker installed. If the target machine has docker installed, there may be errors. The solution is to comment out the corresponding steps to install docker. The corresponding contents are roles/ceph-docker-common/tasks/pre_requisites/pre requisites. Ites.yml.)
ansible-playbook site-docker.yml -i hosts
Destroying Clusters (Caution)
Doker is uninstalled by default. If you don't want to uninstall the docker, comment out the corresponding code in infrastructure-playbooks/purge-docker-cluster.yml.
ansible-playbook infrastructure-playbooks/purge-docker-cluster.yml -i hosts