Installation ¶
CEPH is a distributed network storage system that supports S3, iSCSI, RBD, etc. It’s a great solution, with plenty of documentation available, but it can be tricky to figure out the correct installation method at first.
Rook ¶
The officially recommended way to install CEPH on Kubernetes. You can read about the experience of the team at Flant here.
Cephadm ¶
Based on this, I wrote some Ansible playbooks and successfully managed a cluster deployed on a host. It accepted 40 GiB over the local network in 2 minutes and remained stable :)
Deprecated / Not Recommended ¶
The methods I tried that turned out to be either non-working or deprecated:
- ceph-deploy: somewhere in the documentation, I found that this method is not recommended. Unfortunately, I had already spent a couple of days on it. I can’t provide a link since their SSL certificate expired, and I’m blocked from accessing the site due to HSTS.
- ceph ansible: comprehensive and feature-rich, but CentOS 7 is no longer supported on the master branch, and the monitors didn’t synchronize. I couldn’t find a way to install the dashboard without monitoring, so I implemented it myself. I gained experience with Ansible, but then new issues arose, prompting me to switch to cephadm, which I’m glad I did.
Useful Commands ¶
Here’s a cheatsheet I found helpful.
To view the list of disks in use on the servers:
|
|
To check the space usage summary:
|
|
To view the cluster status:
|
|
To see the infrastructure, including which services/containers are running and where:
|
|
Replacing an OSD ¶
Here’s a good article from the same Flant team, along with a useful comment that complements it well. I recreated the OSD when I expanded the block device on the server (virtual machine) to add space to the cluster. I followed this process:
- The cluster must be in HEALTH_OK state.
- Remove the OSD from the cluster.
- Delete the daemon (container) holding this OSD.
- Purge the OSD.
- Clear the partition.
- Reconnect it.
- Wait for HEALTH_OK.
|
|
In my experience, replacing an OSD with 15 GiB of data took about 30 minutes. This was tested on three CX21 Hetzner instances.
RBD and Docker ¶
Setting up RBD and integrating it with Docker:
- Create a pool.
- Initialize the pool.
- Create a user for the setup.
- Disable unnecessary features. Some RBD features aren’t supported in Linux kernels before 4.17, so they had to be disabled. You can check the options with:
|
|
- Install the Docker volume plugin.
- Test on the container.
- Mount the volume and verify the file.
|
|
I used this volume driver. Other options I found hadn’t been updated in 3-4 years and seemed abandoned. This driver doesn’t require anything to run on the side and integrates directly into Docker. Install it like this:
|
|
Run a simple Docker Compose stack and mount the image:
|
|
Run and verify:
|
|