I spent a couple of nights trying to build Ceph from source. Finally, with a bit of fiddling, I was able to get a working build. But first, what is Ceph? Ceph is an open source software-defined storage solution that uses object storage on a single distributed computer cluster. Ceph replicates data and makes it fault-tolerant while offering disaster recovery using techniques such as replication, erasure coding, snapshots, and storage cloning.
Let’s get started!
I have a 10 year old Mac mini with just 16 GB of RAM and an Intel Core i5 processor. I just note this in case you wonder why it takes so long for my builds to complete! I am running RHEL 8.6 vm in VirtualBox. The build of Ceph does take a bit of disk space. I used a VM with 100 GB of disk space.
Procedure
-
Download the Ceph source code:
[root@localhost ~]# git clone https://github.com/ceph/ceph.git
-
Change to the ceph directory and install the library and tools dependencies:
[root@localhost ceph]# ./install-deps.sh
-
I had to install ccache by doing the following:
[root@localhost ceph]# dnf install https://dl.fedoraproject.org/pub/epel-release-latest-8.noarch.rpm
[root@localhost ceph]# dnf install ccache
-
I built ceph with the following option to create a performance sensitive build instead of debug:
[root@localhost ceph]# ARGS=”-DCMAKE_BUILD_TYPE=RelWithDebInfo” ./do_cmake.sh
-
Change directory to build and then run ninja install to install:
[root@localhost build]# ninja install
-
Run a test cluster:
[root@localhost build]# ninja vstart
-
Now you can run some command and test:
[root@localhost build]# ./bin/ceph -s
Testing the new tuned-profile feature:
Shut down the test cluster:
[root@localhost build]# ./bin/init-ceph stop
Conclusion
It was a fun experiment to build Ceph from source for testing purposes. In an upcoming tutorial, I’ll create installation packages from the latest code using rpmbuild.