Panduan Setup Ceph Cluster di Single Node

Posted by

Untuk kebutuhan testing, kita bisa membuat ceph cluster dengan single node (satu machine). Pada tulisan kali ini, saya akan membuat ceph cluster single node di Rocky Linux 9. Ceph server ini diinstall di atas VM pada Proxmox VE

Adapun sistem requirement-nya:
– 4 disk (1 disk untuk OS dan 3 untuk OSD)
– Sistem Operasi Rocky Linux 9
– IP address yang digunakan 192.168.1.31

Untuk ukuran disk, bisa start dari 30GB

# Persiapan Sistem

– Konfigurasi /etc/hosts

127.0.0.1   localhost 
192.168.1.31	ceph-singlenode.imanudin.web.id    ceph-singlenode

– Konfigurasi Hostname

hostnamectl set-hostname ceph-singlenode.imanudin.web.id

– Disable Firewall

sed -i s/'SELINUX='/'#SELINUX='/g /etc/selinux/config
echo 'SELINUX=disabled' >> /etc/selinux/config
setenforce 0
service firewalld stop
service iptables stop
service ip6tables stop
systemctl disable firewalld
systemctl disable iptables
systemctl disable ip6tables

# Install Dependensi

dnf install podman python3 lvm2

# Install cephadm

CEPH_RELEASE=19.2.1
curl --silent --remote-name --location https://download.ceph.com/rpm-${CEPH_RELEASE}/el9/noarch/cephadm
chmod +x cephadm

Catatan: Untuk versi terbaru (CEPH_RELEASE), silakan cek active release pada tautan berikut: https://docs.ceph.com/en/latest/releases/#active-releases

# Add repo ceph squid

./cephadm add-repo --release squid
./cephadm install
cephadm install ceph-common

Untuk ceph versi latest dan stable, silakan cek berkala pada tautan berikut: https://docs.ceph.com/en/latest/releases/#active-releases

# Boostrap ceph

cephadm bootstrap \
--cluster-network 192.168.1.0/24 \
--mon-ip 192.168.1.31 \
--dashboard-password-noupdate \
--initial-dashboard-user admin \
--initial-dashboard-password ceph \
--allow-fqdn-hostname \
--single-host-defaults

Berikut contoh tampilan ketika proses bootstrap ceph selesai

Fetching dashboard port number...
Ceph Dashboard is now available at:

             URL: https://ceph-singlenode.imanudin.web.id:8443/
            User: admin
        Password: ceph

Enabling client.admin keyring and conf on hosts with "admin" label
Saving cluster configuration to /var/lib/ceph/e8e018b8-0fd2-11f0-bcca-bc2411e54572/config directory
You can access the Ceph CLI as following in case of multi-cluster or non-default config:

        sudo /usr/sbin/cephadm shell --fsid e8e018b8-0fd2-11f0-bcca-bc2411e54572 -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring

Or, if you are only running a single cluster on this host:

        sudo /usr/sbin/cephadm shell 

Bootstrap complete.

# Setup OSD

Jadikan 3 disk yang ada sebagai OSD

ceph orch apply osd --all-available-devices

Cek dengan perintah ceph -s atau ceph -w dan pastikan status health: HEALTH_OK

# Test akses ke dashboard

Login pada ceph dashboard dengan username admin dan password ceph sesuai dengan proses bootstrap di atas

# Testing membuat pool

ceph osd pool create rbdpool
ceph osd pool application enable rbdpool rbd

Perintah di atas membuat pool dengan nama rbdpool. Tipe aplication untuk pool tersebut adalah rbd

# Testing membuat RADOS Block Device

rbd create -p rbdpool vm-100 --size 30G
rbd create -p rbdpool vm-200 --size 50G
rbd list -p rbdpool
rbd info -p rbdpool vm-100
[root@ceph-singlenode ~]# rbd info -p rbdpool vm-100
rbd image 'vm-100':
        size 30 GiB in 7680 objects
        order 22 (4 MiB objects)
        snapshot_count: 0
        id: 37e1c5dad18a
        block_name_prefix: rbd_data.37e1c5dad18a
        format: 2
        features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
        op_features: 
        flags: 
        create_timestamp: Wed Apr  2 22:13:28 2025
        access_timestamp: Wed Apr  2 22:13:28 2025
        modify_timestamp: Wed Apr  2 22:13:28 2025

Selamat anda sudah berhasil membuat ceph cluster dengan single node (single machine). Ceph cluster tersebut dapat digunakan untuk testing integrasi dengan Proxmox VE ataupun yang lainnya.

Silakan dicoba dan semoga bermanfaat 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

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