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

  • Mastering Ceph
  • Nick Fisk
  • 348字
  • 2021-07-09 19:55:15

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
主站蜘蛛池模板: 忻州市| 临沭县| 远安县| 黄骅市| 沈阳市| 东乌珠穆沁旗| 玉山县| 漠河县| 嘉祥县| 鱼台县| 苏州市| 和田市| 广水市| 兴国县| 翼城县| 普定县| 洛阳市| 大同县| 海阳市| 崇信县| 乐安县| 台南市| 北辰区| 资源县| 花莲市| 武邑县| 蒙自县| 高平市| 苍山县| 皋兰县| 大连市| 东阳市| 绥棱县| 泰安市| 云霄县| 泗水县| 闽侯县| 荔波县| 自贡市| 内黄县| 永修县|