Deploy Ceph in a Raspberry Pi cluster

Ceph is an open supply software program storage platform that gives object, block, and filesystem storage in a unified storage cluster. I first used Ceph after I integrated it with OpenStack. At first, I used to be confused about why I ought to use Ceph since storage gadgets are broadly accessible. However after utilizing it for greater than three years, the platform’s stability and integrity have confirmed its worth time and again.

This text will present you easy methods to set up Ceph utilizing ceph-ansible (an formally supported Ansible playbook for Ceph) and deploy it in a Raspberry Pi cluster.

Supplies:

  1. 4 Raspberry Pi 4B 4GB fashions
  2. 4 32GB microSD playing cards (boot OS)
  3. 4 Raspberry Pi circumstances with followers and heatsinks (essential)
  4. 4 Raspberry Pi chargers
  5. Six 32GB USB flash drives (for the Ceph OSD nodes)

Structure:

Relating to the configuration:

  • Each the front-end and back-end networks are in the identical subnet
  • The Ceph Monitor software program makes use of a Raspberry Pi 4B with 4GB RAM
  • The Ceph OSD nodes use the identical Raspberry Pi mannequin however with two USB flash drives for the OSD disks

Deploy Ceph utilizing ceph-ansible

Utilizing Ceph’s Ansible repository makes the deployment clean and easy.

1. Copy ssh keys to all servers

I’ve a standard consumer referred to as cephadmin on all servers (every Raspberry Pi is a server on this context). The cephadmin consumer is configured with passwordless sudo to make issues simpler.

After producing a key utilizing ssh-keygen, deploy all keys utilizing ssh-copy-id.

I take advantage of a Bash for-loop as a result of I am utilizing constant and incremental hostnames:

$ for i in ;
do ssh-copy-id cephadmin@rpi4b4-$i;
finished

That you must settle for and enter your password on each, however you’ll be able to automate this with count on.

2. Clone ceph-ansible and set up necessities

Set up Git to clone the repository:

$ sudo yum set up git -y

Clone the ceph-ansible repository:

$ git clone https://github.com/ceph/ceph-ansible.git
$ cd ceph-ansible/

I am utilizing an AArch64 construct of CentOS 7, so I have to set up some required packages earlier than persevering with.

First, Python pip:

$ sudo yum set up python3-pip -y

Then the packages ceph-ansible wants:

$ sudo yum set up python3-devel libffi-devel openssl-devel -y

Lastly, the necessities ceph-ansible wants:

$ pip3 set up -r necessities.txt –user

I obtained this error:

You might be linking in opposition to OpenSSL 1.0.2, which is now not supported by the OpenSSL venture.
To make use of this model of cryptography you have to improve to a more moderen model of OpenSSL. For
this model solely it’s also possible to set the atmosphere variable
CRYPTOGRAPHY_ALLOW_OPENSSL_102 to permit OpenSSL 1.0.2.

This can be associated to the structure, as a result of I can not replicate the error in a CentOS 7 digital machine.

For deployment, export CRYPTOGRAPHY_ALLOW_OPENSSL_102 to True in order that Ansible can run:

$ export CRYPTOGRAPHY_ALLOW_OPENSSL_102=True

3. Configure ceph-ansible for deployment

Now you are able to deploy Ceph utilizing ceph-ansible.

Copy web site.yml.pattern to web site.yml:

$ mv web site.yml.pattern web site.yml

Create all.yml within the group_vars listing:

$ cat << EOF >> group_vars/all.yml
ceph_origin: repository
ceph_repository: neighborhood
ceph_repository_type: cdn
ceph_stable_release: nautilus
monitor_interface: wlan0
public_network: “192.168.100.0/24”
cluster_network: “192.168.100.0/24”
dashboard_enabled: false
configure_firewall: false
EOF

Create osds.yml within the group_vars listing:

$ cat << EOF >> group_vars/all.yml
osd_scenario: collocated
gadgets:
– /dev/sda
– /dev/sdb
EOF

Create a list file:

$ cat << EOF >> stock
[mons]
rpi4b4-0

[osds]
rpi4b4-1
rpi4b4-2
rpi4b4-3
EOF

As of this writing, there’s a bug within the ceph-ansible repository (in response to this bug ticket). You may mitigate the bug by modifying line 85 and 86 of the roles:

– (wait_for_all_osds_up.stdout | from_json)[“osdmap”][“num_osds”] | int > 0
– (wait_for_all_osds_up.stdout | from_json)[“osdmap”][“num_osds”] == (wait_for_all_osds_up.stdout | from_json)[“osdmap”][“num_up_osds”]

4. Deploy Ceph

Run the Ansible playbook together with your stock file:

$ ansible-playbook -i stock web site.yml

After 15–20 minutes, it is best to see this end result:

Subsequent steps

Beforehand, I manually deployed an OpenStack cluster in one other Raspberry Pi cluster. I hope to combine it with this one. I am additionally wanting into deploying with TripleO.

The chances for Raspberry Pi, Ansible, and OpenStack are limitless. Get began with your personal experiment, and let me know the way it goes within the feedback.

Supply

Germany Devoted Server

Leave a Reply