From 4ac21e0d4c42cfaec7bb3a01a2492f30809e2da1 Mon Sep 17 00:00:00 2001 From: Lzebulon Date: Thu, 29 Jan 2026 18:19:30 +0100 Subject: [PATCH] enable monitor --- hosts/physiques/cephiroth/ceph.md | 41 ++++++++++++++++++++++++++++++ hosts/physiques/cephiroth/ceph.nix | 4 +-- 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 hosts/physiques/cephiroth/ceph.md diff --git a/hosts/physiques/cephiroth/ceph.md b/hosts/physiques/cephiroth/ceph.md new file mode 100644 index 0000000..6d59bbd --- /dev/null +++ b/hosts/physiques/cephiroth/ceph.md @@ -0,0 +1,41 @@ +# Ceph + +Ce fichier explique les tests et etapes effectue avec ceph. + + + ++ Déployer une conf minimal avec ceph et `services.ceph.global` deploye. ++ Creer une clé pour le cluster +```bash +sudo ceph-authtool --create-keyring /tmp/ceph.mon.keyring --gen-key -n mon. --cap mon 'allow *' +``` ++ Creer un client admin +```bash +sudo ceph-authtool --create-keyring /etc/ceph/ceph.client.admin.keyring --gen-key -n client.admin --cap mon 'allow *' --cap osd 'allow *' --cap mds 'allow *' --cap mgr 'allow *' +``` ++ Creer un bootstrap osd +```bash +sudo ceph-authtool --create-keyring /var/lib/ceph/bootstrap-osd/ceph.keyring --gen-key -n client.bootstrap-osd --cap mon 'profile bootstrap-osd' --cap mgr 'allow r' +``` ++ On ajoute les cle generer au keyring +```bash +sudo ceph-authtool /tmp/ceph.mon.keyring --import-keyring /etc/ceph/ceph.client.admin.keyring +sudo ceph-authtool /tmp/ceph.mon.keyring --import-keyring /var/lib/ceph/bootstrap-osd/ceph.keyring +``` +(ca copie juste les deux clé précédente dans `/tmp/ceph.mon.keyring`) ++ on donne le keyring a l'user ceph +```bash +sudo chown ceph:ceph /tmp/ceph.mon.keyring +``` ++ Créer une monitor map +```bash +monmaptool --create --add {hostname} {ip-address} --fsid {uuid} /tmp/monmap +``` ++ Créer un dossier pour le monitor +```bash +sudo mkdir /var/lib/ceph/mon/{cluster-name}-{hostname} +``` ++ On ajoute la monitor map et le keyring au monitor +```bash +sudo -u ceph ceph-mon [--cluster {cluster-name}] --mkfs -i {hostname} --monmap /tmp/monmap --keyring /tmp/ceph.mon.keyring +``` diff --git a/hosts/physiques/cephiroth/ceph.nix b/hosts/physiques/cephiroth/ceph.nix index 6ba44f5..28f77c6 100644 --- a/hosts/physiques/cephiroth/ceph.nix +++ b/hosts/physiques/cephiroth/ceph.nix @@ -17,12 +17,12 @@ # monitor mon = { - enable = false; + enable = true; extraConfig = { "mon host" = "172.16.6.3"; "mon initial members" = "cephiroth"; }; - daemons = ["1"]; + daemons = ["cephiroth"]; }; global = {