How to set up a cluster with CephAdm

We look into using the cephadm tooling to bootstrap and configure a small cluster with 3 drives and multiple hosts. We go into how cephadm administers different resources and shares them between hosts.

Installing main host

First we need curl in order to fetch the cephadm application

sudo apt install -y curl

Then we download the application and make it executable.

curl --silent --remote-name --location https://github.com/ceph/ceph/raw/pacific/src/cephadm/cephadm
chmod +x cephadm

CephAdm could be used to set which version we want to install. In this case we choose Pacific as this is the first version that has full support for cephadm install. We also will run the command to install the tooling locally.

sudo ./cephadm add-repo --release pacific
sudo ./cephadm install

Bootstraping a cluster means to install the packages required to run the cluster from this administration host. After that is done you will have a cluster with one host, not something you could run any services on but something that you could administrate and work with your cluster. Supplying the IP address is important for the cluster to know where to connect, when done you'll get an address, username and password to reach the administration GUI.

sudo cephadm bootstrap --mon-ip 192.168.6.98

In the administration GUI you could later add additional hosts and services but first we need to prepare those hosts.

Preparing additional hosts.

First we need to install packages required to set keys in our keystore.

sudo apt update
sudo apt install -y ca-certificates curl gnupg lsb-release

Downloading and installing the gpg key for docker into this local host.

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

We will then add the package repository to our system so we can download the packages required to install Docker.

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Update the repository and install packages required to run docker containers.

sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io

Last but not least we will install tooling to setup local volumes on this host, this will be used when making Object Storage Devices(OSD) on this host.

sudo apt install -y lvm2

Similar Posts

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.