官术网_书友最值得收藏!

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
主站蜘蛛池模板: 冕宁县| 文成县| 偏关县| 同仁县| 沈阳市| 永康市| 图木舒克市| 无锡市| 宁都县| 东平县| 车致| 阿图什市| 旬邑县| 延吉市| 蒲江县| 新竹市| 蓝田县| 疏附县| 余姚市| 始兴县| 青阳县| 宜都市| 博爱县| 旬阳县| 永德县| 沙湾县| 榕江县| 尉犁县| 射洪县| 且末县| 横峰县| 玉龙| 林周县| 赣州市| 都江堰市| 白山市| 临海市| 泗阳县| 托克托县| 太康县| 商南县|