Skip to content

Instantly share code, notes, and snippets.

@kalaspuffar
Last active February 1, 2024 03:00
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save kalaspuffar/92e8108c472f367be28c31f3bd29f5ef to your computer and use it in GitHub Desktop.
Save kalaspuffar/92e8108c472f367be28c31f3bd29f5ef to your computer and use it in GitHub Desktop.
Installing ceph cluster using the cephadm tooling

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
@kmkkmk24
Copy link

[root@kmk-autolin-1 ceph-admin]# ./cephadm add-repo --release pacific
ERROR: Ceph does not support pacific or later for this version of this linux distro and therefore cannot add a repo for it

[root@kmk-autolin-1 ceph-admin]# cat /etc/release
CentOS Linux release 7.9.2009 (Core)
Derived from Red Hat Enterprise Linux 7.9 (Source)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment