mirror of https://gitlab.crans.org/nounous/nixos
96 lines
2.5 KiB
Markdown
96 lines
2.5 KiB
Markdown
# 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
|
|
```
|
|
|
|
On check si le service monitor start bien
|
|
|
|
Pour voir le status du cluster
|
|
```bash
|
|
sudo ceph -s
|
|
```
|
|
|
|
|
|
# Dashboard
|
|
- check si le module dashboard est activé
|
|
```
|
|
sudo ceph mgr module ls
|
|
```
|
|
- pour activer si pas activer
|
|
```bash
|
|
ceph mgr module enable dashboard
|
|
```
|
|
|
|
Dans un premier temps pour le test j'ai desactiver le ssl :
|
|
```bash
|
|
ceph config set mgr mgr/dashboard/ssl false
|
|
```
|
|
|
|
Pour voir sur quoi le dashboard ecoute (apres avoir desactive ssl)
|
|
```bash
|
|
sudo ceph mgr services
|
|
```
|
|
|
|
Pour les user check https://docs.ceph.com/en/latest/mgr/dashboard/#username-and-password
|
|
|
|
# OSD
|
|
|
|
Pour créer un osd (attention de prendre le bon disque parce que ca supprime les données du disque) :
|
|
```bash
|
|
sudo ceph-volume lvm create --data /dev/sdf --no-systemd
|
|
```
|
|
|
|
# Info
|
|
|
|
- Monitor : c'est lui qui garde la map d'ou est quoi
|
|
- Manager : il check si tout va bien, c'est lui qui a le dashboard
|
|
- OSD : ca gere 1 disque physique
|
|
|
|
|
|
# Proposition Architecture
|
|
|
|
CephFS:
|
|
- home-adh
|
|
- home-nounou
|
|
|
|
RBD (raw block devices):
|
|
- vm-adh
|
|
- vm-nounou
|