Publié le: 2021-01-25

Ceph on Debian

This article is a pure draft, it’s not intended to be published yet

sudo mount -o remount,user_xattr /data/
[global]
    auth supported = cephx
    keyring = /etc/ceph/keyring.admin

[osd]
    osd data = /data/ceph/osd$id
    osd journal = /data/ceph/osd$id/journal
    osd journal size = 512
    keyring = /etc/ceph/keyring.$name

    ; working with ext4 (sileht: disable because xfs is used)
    ;filestore xattr use omap = true

    ; solve rbd data corruption (sileht: disable by default in 0.48)
    filestore fiemap = false

[osd.11]
    host = ceph1.k8s.lan
    cluster addr = 10.0.0.241:6800
    public addr = 10.0.0.241:6801
    devs = /dev/sda1

[osd.12]
    host = ceph1.k8s.lan
    cluster addr = 10.0.0.241:6802
    public addr = 10.0.0.241:6803
    devs = /dev/sda1

[osd.21]
    host = ceph2.k8s.lan
    cluster addr = 10.0.0.242:6800
    public addr = 10.0.0.242:6801
    devs = /dev/sda1

[osd.22]
    host = ceph2.k8s.lan
    cluster addr = 10.0.0.242:6802
    public addr = 10.0.0.242:6803
    devs = /dev/sda1

[osd.31]
    host = ceph3.k8s.lan
    cluster addr = 10.0.0.243:6800
    public addr = 10.0.0.243:6801
    devs = /dev/sda1

[osd.32]
    host = ceph3.k8s.lan
    cluster addr = 10.0.0.243:6802
    public addr = 10.0.0.243:6803
    devs = /dev/sda1

[mon]
    mon data = /data/ceph/mon$id
[mon.1]
    host = ceph1.k8s.lan
    mon addr = 10.0.0.241:6789
[mon.2]
    host = ceph2.k8s.lan
    mon addr = 10.0.0.242:6789
[mon.3]
    host = ceph3.k8s.lan
    mon addr = 10.0.0.243:6789
ceph-authtool --create-keyring /etc/ceph/keyring.admin --gen-key -n client.admin --cap mon 'allow *' --cap osd 'allow *' --cap mds 'allow *' --cap mgr 'allow *'
chown -R ceph. /etc/ceph/keyring.admin
ceph-authtool --create-keyring /tmp/ceph.mon.keyring --gen-key -n mon. --cap mon 'allow *'
ceph-authtool /tmp/ceph.mon.keyring --import-keyring /etc/ceph/keyring.admin
ceph-mon -i 3 --mkfs --setuser ceph --setgroup ceph --fsid 85de7039-4ae1-4536-9b22-3a8e37095234
cp /tmp/ceph.mon.keyring /data/ceph/mon3/keyring
chown ceph. /data/ceph/mon3/keyring
systemctl restart ceph

copy the admin keyring & ceph config, then redo the other steps on other servers