diff --git a/HowtoCeph.md b/HowtoCeph.md index 876921df..3d0dbddd 100644 --- a/HowtoCeph.md +++ b/HowtoCeph.md @@ -36,15 +36,78 @@ Cette section montre comment déployer un _cluster_ Ceph en suivant [la méthode 1. ajouter les OSD restants. +On souhaite avoir un _cluster_ de 7 machines : + +* 3 machines cephmon0[012] qui hébergent un démon _monitor_ ; + +* 4 machines cephosd0[1234] qui hébergent des démon OSD. + + ## Ajouter un premier moniteur -**TODO** +On commence par initialiser le cluster : créer le premier monitor sur une machine ceph-mon. C'est la section + +1. Initialiser la configuration du _cluster_. +``` +# echo '[global]' > /etc/ceph/ceph.conf +# chmod 644 /etc/ceph/ceph.conf +# uuidgen +# echo 'fsid = ' >> /etc/ceph/ceph.conf +# echo 'mon initial members = cephmon00' >> /etc/ceph/ceph.conf +# echo 'mon host = ' >> /etc/ceph/ceph.conf +``` +1. Créer l'utilisateur Ceph pour le _monitor_. +``` +# ceph-authtool --create-keyring /tmp/ceph.mon.keyring --gen-key -n mon. --cap mon 'allow *' +# 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 *' +# 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' +# ceph-authtool /tmp/ceph.mon.keyring --import-keyring /etc/ceph/ceph.client.admin.keyring +# ceph-authtool /tmp/ceph.mon.keyring --import-keyring /var/lib/ceph/bootstrap-osd/ceph.keyring +# chown ceph:ceph /tmp/ceph.mon.keyring +``` +1. Créer le _monitor_. +``` +# sudo -u ceph monmaptool --create --add cephmon00 --fsid /tmp/monmap +# sudo -u ceph mkdir /var/lib/ceph/mon/ceph-cephmon00 +# sudo -u ceph ceph-mon --cluster ceph --mkfs -i cephmon00 --monmap /tmp/monmap --keyring /tmp/ceph.mon.keyring +``` +1. Démarrer le service. +``` +# vi /etc/ceph/ceph.conf # TODO completer conf +# systemctl start ceph-mon@cephmon00 +``` + +À ce stade, exécuter la commande `ceph -s` doit afficher `HEALTH_OK`. + +Source : [Monitor Bootstrapping](https://docs.ceph.com/en/pacific/install/manual-deployment/#monitor-bootstrapping) ### Ajouter un _manager_ -Il est recommandé d'ajouter un _manager_ sur chaque machine où un moniteur est présent. +Note : il est recommandé d'ajouter un _manager_ sur chaque machine où un moniteur est présent. -**TODO** +La commande suivante affiche la valeur à entrer pour `` juste après. + +1. Créer l'utilisateur. +``` +# ceph auth get-or-create mgr.cephmon00 mon 'allow profile mgr' osd 'allow *' mds 'allow *' +``` +1. Créer le fichier contenant les identifiants de l'utilisateur. +``` +# sudo -u ceph mkdir /var/lib/ceph/mgr/ceph-cephmon00 +# sudo -u ceph tee /var/lib/ceph/mgr/ceph-cephmon00/keyring << . +[mgr.cephmon00] + key = +. +``` +1. Démarrer le service. +``` +# systemctl start ceph-mgr@cephmon00 +# systemctl status ceph-mgr@cephmon00 +``` + +La commande `ceph -s` doit afficher un serveur actif à la ligne `mgr:`. + +Source: [ceph-mgr administrator’s guide - Manual setup](https://docs.ceph.com/en/pacific/mgr/administrator/#manual-setup) ## Ajouter deux OSD