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

  • 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
主站蜘蛛池模板: 武川县| 南溪县| 龙门县| 永修县| 从化市| 迭部县| 滦南县| 浮山县| 通辽市| 涡阳县| 封丘县| 濮阳县| 沾化县| 洞头县| 合肥市| 辉南县| 宜兴市| 丽水市| 呼和浩特市| 慈溪市| 博客| 大理市| 昌都县| 桂林市| 池州市| 安陆市| 乐亭县| 龙州县| 双城市| 德格县| 克东县| 定安县| 昌黎县| 蓬莱市| 景洪市| 宣城市| 自治县| 德惠市| 汝城县| 嵩明县| 尤溪县|