tech:notes_stockage_ceph
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:notes_stockage_ceph [2025/10/28 12:13] – Jean-Baptiste | tech:notes_stockage_ceph [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes stockage CEPH | ||
| + | |||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Voir aussi : | ||
| + | * SeaweedFS | ||
| + | * JuiceFS | ||
| + | |||
| + | ~~~bash | ||
| + | ceph status | ||
| + | |||
| + | ceph-deploy admin serveur | ||
| + | ~~~ | ||
| + | |||
| + | 30 TB | ||
| + | 30 TB | ||
| + | 30 TB | ||
| + | -------- | ||
| + | 90 TB | ||
| + | |||
| + | |||
| + | DFS | ||
| + | 100 TB | ||
| + | SMB | ||
| + | Windows DFS | ||
| + | |||
| + | Lexique | ||
| + | |||
| + | OSD (pour Object Storage Daemon), un disque | ||
| + | |||
| + | |||
| + | |||
| + | Etapes : | ||
| + | Monter un CEPH | ||
| + | Monter un Samba | ||
| + | DFS | ||
| + | Droits lectures pour tout auth | ||
| + | Synchro les données | ||
| + | |||
| + | |||
| + | U: | ||
| + | |||
| + | http:// | ||
| + | |||
| + | |||
| + | |||
| + | ## Prérequis | ||
| + | |||
| + | Matériel | ||
| + | Voir : https:// | ||
| + | |||
| + | Logiciel ; | ||
| + | http:// | ||
| + | |||
| + | Liste : | ||
| + | * Réseau (Ceph préconise l’utilisation de 2 interfaces réseau) | ||
| + | * /etc/hosts | ||
| + | * NTP | ||
| + | * Ceph deploy user (with passwordless sudo privileges) | ||
| + | * SSH passwordless | ||
| + | * Sudo tty (Si `requiretty` => `Defaults: | ||
| + | * SELinux | ||
| + | |||
| + | ### Composants | ||
| + | |||
| + | |||
| + | |||
| + | #### MDS (Meta Data Server) | ||
| + | Consomme du CPU et de la RAM (1 Gi de mémoire par instance). Utile que si l'on planifie d' | ||
| + | |||
| + | #### Monitors | ||
| + | For small clusters, 1-2 GB is generally sufficient | ||
| + | |||
| + | #### OSD (Object Storage Daemon) | ||
| + | |||
| + | Du côté de la mémoire, 512 Mi par instance sont suffisants sauf lors de la récupération où 1 Gi de mémoire par Ti de données et par instance est conseillé. | ||
| + | |||
| + | ## Installation | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Les users CEPH ne doivent pas être des utilisateurs standard, mais des utilisateurs de services eux même chargés d’une gestion fine des droits | ||
| + | Ceph préconise l’utilisation de 2 interfaces réseau | ||
| + | |||
| + | ~~~bash | ||
| + | echo "deb http:// | ||
| + | |||
| + | apt-get update | ||
| + | apt-get install -t buster-backports ceph | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | zcat / | ||
| + | ~~~ | ||
| + | |||
| + | ~~~ | ||
| + | # uuidgen | ||
| + | 67274814-239f-4a05-8415-ed04df45876c | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | [global] | ||
| + | ### http:// | ||
| + | |||
| + | fsid = 67274814-239f-4a05-8415-ed04df45876c | ||
| + | public network | ||
| + | cluster network | ||
| + | |||
| + | # Replication level, number of data copies. | ||
| + | # Type: 32-bit Integer | ||
| + | # (Default: 3) | ||
| + | osd pool default size = 2 | ||
| + | |||
| + | ## Replication level in degraded state, less than 'osd pool default size' value. | ||
| + | # Sets the minimum number of written replicas for objects in the | ||
| + | # pool in order to acknowledge a write operation to the client. If | ||
| + | # minimum is not met, Ceph will not acknowledge the write to the | ||
| + | # client. This setting ensures a minimum number of replicas when | ||
| + | # operating in degraded mode. | ||
| + | # Type: 32-bit Integer | ||
| + | # (Default: 0), which means no particular minimum. If 0, minimum is size - (size / 2). | ||
| + | ;osd pool default min size = 2 | ||
| + | osd pool default min size = 1 | ||
| + | |||
| + | [mon] | ||
| + | ### http:// | ||
| + | ### http:// | ||
| + | |||
| + | # The IDs of initial monitors in a cluster during startup. | ||
| + | # If specified, Ceph requires an odd number of monitors to form an | ||
| + | # initial quorum (e.g., 3). | ||
| + | # Type: String | ||
| + | # (Default: None) | ||
| + | mon initial members | ||
| + | |||
| + | [mon.kub1] | ||
| + | host = kub1 | ||
| + | mon addr = 192.168.56.21: | ||
| + | |||
| + | [mon.kub2] | ||
| + | host = kub2 | ||
| + | mon addr = 192.168.56.22: | ||
| + | |||
| + | [mon.kub3] | ||
| + | host = kub3 | ||
| + | mon addr = 192.168.56.23: | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | ceph-authtool --create-keyring / | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | [client.admin] | ||
| + | key = AQBGuWRfchSlDRAA3/ | ||
| + | caps mds = " | ||
| + | caps mon = "allow *" | ||
| + | caps osd = "allow *" | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | ceph-authtool --create-keyring / | ||
| + | ceph-authtool --create-keyring / | ||
| + | ceph-authtool --create-keyring / | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | systemctl enable ceph.target | ||
| + | systemctl start ceph.target | ||
| + | |||
| + | systemctl enable ceph-mon@$(hostname -s) | ||
| + | systemctl start ceph-mon@$(hostname -s) | ||
| + | systemctl status ceph-mon@$(hostname -s).service | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ~~~ | ||
| + | # ceph health detail | ||
| + | HEALTH_WARN 3 monitors have not enabled msgr2 | ||
| + | MON_MSGR2_NOT_ENABLED 3 monitors have not enabled msgr2 | ||
| + | mon.kub1 is not bound to a msgr2 port, only v1: | ||
| + | mon.kub2 is not bound to a msgr2 port, only v1: | ||
| + | mon.kub3 is not bound to a msgr2 port, only v1: | ||
| + | # ceph mon enable-msgr2 | ||
| + | # ceph health detail | ||
| + | HEALTH_OK | ||
| + | ~~~ | ||
| + | |||
| + | ### OSD | ||
| + | |||
| + | Voir : https:// | ||
| + | |||
| + | **ceph-volume** remplace **ceph-disk** | ||
| + | ~~~bash | ||
| + | ceph-volume inventory | ||
| + | ceph-volume inventory /dev/sdb | ||
| + | ceph-volume lvm batch --bluestore /dev/sda /dev/sdb /dev/sdc | ||
| + | CEPH_VOLUME_DEBUG=1 ceph-volume inventory /dev/sdb | ||
| + | ceph-volume lvm zap /dev/sdb --destroy | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | ceph-osd -i 0 --mkfs --mkkey --osd-uuid 13b2da5a-033f-4d58-b106-2f0212df6438 | ||
| + | chown -R ceph:ceph / | ||
| + | ceph auth list | ||
| + | ceph auth add osd.0 osd 'allow *' mon 'allow profile osd' -i / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | [osd.0] | ||
| + | key = AQBizGxGhJcwJxAAHhOGHXQuCUTktxNszj62aQ== | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | ceph --cluster ceph osd crush add-bucket kub1 host | ||
| + | ceph osd crush move kub1 root=default | ||
| + | chown -R ceph:ceph / | ||
| + | ceph --cluster ceph osd crush add osd.0 1.0 host=kub1 | ||
| + | |||
| + | |||
| + | ceph-volume raw prepare --bluestore --data /dev/sdb1 | ||
| + | |||
| + | systemctl start ceph-osd@1 | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### CephFS | ||
| + | |||
| + | ~~~bash | ||
| + | cd /etc/ceph | ||
| + | sudo mkcephfs -a -c / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Administration | ||
| + | |||
| + | Ceph health | ||
| + | ~~~bash | ||
| + | ceph -s | ||
| + | ceph mon_status -f json-pretty | ||
| + | ceph -w | ||
| + | ceph df | ||
| + | ceph health detail | ||
| + | ceph -n client.admin --keyring=/ | ||
| + | ceph pg dump | ||
| + | ceph pg X.Y query | ||
| + | ceph pgdump_stuck inactive | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### OSD | ||
| + | |||
| + | ~~~bash | ||
| + | ceph osd tree | ||
| + | watch ceph osd pool stats | ||
| + | ceph osd map | ||
| + | ~~~ | ||
| + | |||
| + | Suppression OSD | ||
| + | ~~~bash | ||
| + | ceph osd crush reweight osd.XX 0. | ||
| + | # Passage du poids de l’OSD à 0 | ||
| + | ceph osd out XX | ||
| + | # Marquage de l’OSD comme non disponible au cluster | ||
| + | # 1er mouvement de données, ~10To rebalancés | ||
| + | #stop ceph-osd id=XX | ||
| + | systemctl stop ceph-osd@XX.service | ||
| + | # arrêt de l' | ||
| + | ceph osd crush remove osd.XX | ||
| + | # Sortie logique de l’OSD du cluster | ||
| + | # 2nd mouvement de données (non prévu), ~10To rebalancés | ||
| + | ceph auth del osd.{osd-num} | ||
| + | # suppression des clés d’authentification de l’OSD au cluster | ||
| + | ceph osd rm {osd-num} | ||
| + | # suppression définitive de l’OSD du cluster | ||
| + | | ||
| + | # | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ## Autres | ||
| + | |||
| + | ~~~bash | ||
| + | ceph mgr module l | ||
| + | ceph mgr module enable plop | ||
| + | ~~~ | ||
| + | |||
| + | ## Client | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | ~~~bash | ||
| + | mount -t ceph 128.114.86.4: | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ | ||
| + | 128.114.86.4: | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | ceph-fuse -m 128.114.86.4: | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
