Deploying a test cluster with Ansible

There are several examples on the Internet which contain a fully configured Vagrantfile and associated Ansible playbooks which allows you to bring up a fully functional Ceph environment with just one command. As handy as this may be it doesn't help to learn how to correctly configure and use the Ceph Ansible modules as you would if you were deploying a Ceph cluster on real hardware in a production environment. As such, this book will guide you through configuring Ansible from the scratch, although running on Vagrant provisioned servers.

At this point your Vagrant environment should be up and running, and Ansible should be able to connect to all six of your Ceph servers. You should also have a cloned copy of the Ceph Ansible module:

  1. Create a file called /etc/ansible/group_vars/ceph:
       ceph_origin: 'upstream'
ceph_stable: true # use ceph stable branch
ceph_stable_key: https://download.ceph.com/keys/release.asc
ceph_stable_release: jewel # ceph stable release
ceph_stable_repo: "http://download.ceph.com/debian-{{
ceph_stable_release }}"monitor_interface: enp0s8 #Check ifconfig
public_network: 192.168.0.0/24
journal_size: 1024
  1. Create a file called /etc/ansible/group_vars/osds:
       devices:
- /dev/sdb
journal_collocation: true
  1. Create a fetch folder and change the owner to the vagrant user:
       sudo mkdir /etc/ansible/fetch
sudo chown vagrant /etc/ansible/fetch
  1. Run the Ceph cluster deployment playbook:
       cd /etc/ansible
sudo mv site.yml.sample site.yml
ansible-playbook -K site.yml

The K parameter tells Ansible that it should ask you for the sudo password.

Now sit back and watch Ansible deploy your cluster:

Once done, assuming Ansible completed without errors, SSH into mon1 and run the following code. If Ansible did encounter errors, scroll up and look for the part which errored, the error text should give you a clue as to why it failed.

vagrant@mon1:~$ sudo ceph -s:

And that concludes the deployment of a fully functional Ceph cluster via Ansible.

If you want to be able to stop the Vagrant Ceph cluster without losing your work so far, you can run the following command:

    vagrant suspend

This will pause all the VMs in their current state.

The following command will power the VMs on and resume running at the state you left them:

    vagrant resume
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.181.57