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

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
主站蜘蛛池模板: 当阳市| 金门县| 息烽县| 兴城市| 祁门县| 同心县| 湖州市| 金堂县| 柘城县| 同仁县| 澎湖县| 广元市| 翁牛特旗| 武夷山市| 芷江| 仙游县| 普格县| 长乐市| 宿迁市| 固阳县| 张家港市| 长春市| 永州市| 独山县| 彰化市| 建平县| 青阳县| 安西县| 定襄县| 高淳县| 广东省| 广灵县| 杨浦区| 盐源县| 仙游县| 田阳县| 防城港市| 蒙城县| 南靖县| 高要市| 渭南市|