DEV Community

Cover image for MicroCeph: Setting up a single-node Ceph cluster
Sergio Peris
Sergio Peris

Posted on • Originally published at sertxu.dev

MicroCeph: Setting up a single-node Ceph cluster

MicroCeph is a utility mantained by Canonical that allows us to deploy a Ceph cluster without dealing with all the configurations and commands usually required.

Install MicroCeph

We're going to install and hold MicroCeph as a snap package.

sudo snap install microceph
sudo snap refresh --hold microceph
Enter fullscreen mode Exit fullscreen mode

Bootstrap the cluster

Once we've installed MicroCeph, we bootstrap the Ceph cluster.

sudo microceph cluster bootstrap --public-network 0.0.0.0/0
Enter fullscreen mode Exit fullscreen mode

A few seconds later, we can check the cluster status.

sudo microceph status
Enter fullscreen mode Exit fullscreen mode
 MicroCeph deployment summary:
 - eu-central-1.binarycomet.net (100.42.187.104)
   Services: mds, mgr, mon
   Disks: 0
Enter fullscreen mode Exit fullscreen mode

As you can see the cluster is running with one node containing three services, but storage is allocated yet.

Add storage

As there are required at least three OSDs (Object Storage Daemons) to work, we're going to create three loop files of 4 GB each one.

sudo microceph disk add loop,4G,3
Enter fullscreen mode Exit fullscreen mode
+-----------+---------+
|   PATH    | STATUS  |
+-----------+---------+
| loop,4G,3 | Success |
+-----------+---------+
Enter fullscreen mode Exit fullscreen mode

The OSD and the loop file are stored at /var/snap/microceph/common/data/osd.

If we check the cluster status again, we can see it now contains three disks.

sudo microceph status
Enter fullscreen mode Exit fullscreen mode
 MicroCeph deployment summary:
 - eu-central-1.binarycomet.net (100.42.187.104)
   Services: mds, mgr, mon, osd
   Disks: 3
Enter fullscreen mode Exit fullscreen mode

We can also check the status using the native Ceph tooling:

sudo ceph status
Enter fullscreen mode Exit fullscreen mode
cluster:
  id:     755f2ac4-cd4e-44c9-8bd6-70cc8c95af5b
  health: HEALTH_OK

services:
  mon: 1 daemons, quorum eu-central-1.binarycomet.net (age 10m)
  mgr: eu-central-1.binarycomet.net(active, since 9m)
  osd: 3 osds: 3 up (since 4m), 3 in (since 4m)

data:
  pools:   1 pools, 1 pgs
  objects: 2 objects, 577 KiB
  usage:   82 MiB used, 12 GiB / 12 GiB avail
  pgs:     1 active+clean
Enter fullscreen mode Exit fullscreen mode

Now we have a working Ceph cluster with one node and three OSDs.

Top comments (0)