{ pkgs, ... }: { # La doc ceph : https://docs.ceph.com/en/quincy/install/manual-deployment/ services.ceph = { enable = true; # osd, 1 deamon/disk avec un id unique dans le cluster. osd = { enable = true; # je propose comme convention, entier suivi de l'id à 2 chiffre de la machine # les machines physique ont des id < 100, donc ca fonctionne daemons = ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11"]; extraConfig = { "public_addr" = "172.16.4.3"; "cluster_addr" = "172.16.6.3"; }; }; # monitor, garde la map du cluster mon = { enable = true; extraConfig = { "mon host" = "172.16.4.3"; "mon initial members" = "cephiroth"; }; daemons = ["cephiroth"]; }; # Dashboard mgr = { enable = true; daemons = ["cephiroth"]; extraConfig = { "mgr_initial_modules" = "dashboard prometheus"; # TODO: setup prometheus listen addr # le port de prometheus est 9283 pour ceph }; }; # pour cephFS mds = { enable = true; daemons = ["cephiroth"]; }; global = { # Comme nom de cluster on choisit `ceph` (la valeur par défaut), # car on aura qu'un cluster. clusterName = "ceph"; # fsid unique par node, généré avec `uuidgen` fsid = "af0a334a-3356-4fb6-800c-95b4a99232c0"; monHost = "172.16.4.3"; monInitialMembers = "cephiroth"; publicNetwork = "172.16.4.0/24"; clusterNetwork = "172.16.6.0/24"; }; client = { enable = true; }; }; # automaticaly start osd when we restart the server systemd.services.ceph-mesh = { enable = true; description = "Ceph OSD Bindings"; unitConfig = { After = "local-fs.target"; Wants = "local-fs.target"; }; serviceConfig = { Type = "oneshot"; KillMode = "none"; Environment = "CEPH_VOLUME_TIMEOUT=10000 PATH=$PATH:/run/current-system/sw/bin/"; ExecStart = "/bin/sh -c 'timeout $CEPH_VOLUME_TIMEOUT /run/current-system/sw/bin/ceph-volume lvm activate --all --no-systemd'"; TimeoutSec = 0; }; wantedBy = ["multi-user.target"]; }; environment.systemPackages = [ pkgs.ceph pkgs.smartmontools ]; }