In queste istruzioni si crea un file system (in questo esempio con 2 "top level directory" : /terabit-home e /slurm-controller) che si appoggia su 3 MDS: 2 attivi e uno in stand-by
Quindi il prerequisto e' avere prima creato 3 MDS
Creo i pool per dati e metadati.
Opportuno crearli in replica 3 e opportuno che quello di metadati siano su ssd
Code Block |
---|
ceph osd pool create cephfs_data 32 32
ceph osd pool set cephfs_data crush_rule replicated_hdd
ceph osd pool create cephfs_metadata 32 32
ceph osd pool set cephfs_metadata crush_rule replicated_ssd |
Creo il filesystem:
Code Block |
---|
ceph fs new cephfs cephfs_metadata cephfs_data |
Dovrei ora vedere un MDS active e 2 in standby:
Code Block |
---|
root@c-mds-03 ceph]# ceph mds stat
cephfs:1 {0=c-mds-01=up:active} 2 up:standby
|
Configuro questo file system in modo che usi 2 MDS attivi:
Code Block |
---|
[root@c-mds-03 ceph]# ceph fs set cephfs max_mds 2 |
Verifico:
Code Block |
---|
[root@c-mds-03 ceph]# ceph mds stat
cephfs:2 {0=c-mds-01=up:active,1=c-mds-03=up:active} 1 up:standby |
Creo un client per ogni "top level directory" per questo filesystem:
Code Block |
---|
[root@c-mon-1 almalinux]# ceph fs authorize cephfs client.terabithome /terabithome rw | tee /etc/ceph/ceph.client.terabithome.keyring
[client.terabithome]
key = AQA9FIlnaJ5SFBAAdT8gzFgfOp9jq3meON0o+g==
[root@c-mon-1 almalinux]# ceph fs authorize cephfs client.slurmctrl /slurmctrl rw | tee /etc/ceph/ceph.client.slurmctrl.keyring
[client.slurmctrl]
key = AQB4FIlng39/JhAAloEnVIZDpfMz/Zijwjou5Q== |
Il file /etc/ceph/ceph.client.*.keyring serviranno poi nei nodi dove si monta il file system
Mount del filesystem su un client
Disabilito selinux e installo gli rpms di ceph:
rpm -Uvh https://download.ceph.com/rpm-quincy/el9/noarch/ceph-release-1-1.el9.noarch.rpm
yum clean all
yum update
yum install ceph
shutdown -r now
Su un monitor:
ceph config generate-minimal-conf | sudo tee ~/ceph.conf.min
e poi copio ceph.conf.min come /etc/ceph/ceph.conf nel client node
Copio nel client node anche il file /etc/ceph/ceph.client.cephfs.keyring prima generato (deve avere mode 0600 e appartenere a root.root)
Creo anche il file /etc/ceph/cephfs.secret che contiene la sola chiave (quella che compare in /etc/ceph/ceph.client.cephfs.keyring)
Per montare il file system:
mount -t ceph cephfs@.cephfs=/ /mnt/mycephfs -o mon_addr=10.70.42.10:6789/10.70.42.9:6789/10.70.42.8:6789,secretfile=/etc/ceph/cephfs.secret
Con il senno di poi: questo esempio non e' il massimo perche' ho usato cephfs sia come nome del file system, sia come il nome dello user ceph (quello per cui ho creato il client).
In bold faccio riferimento allo username, in italic al nome del file system ceph
L'entry corrispondente in fstab e' questa:
cephfs@.cephfs=/ /mnt/mycephfs ceph mon_addr=10.70.42.10:6789/10.70.42.9:6789/10.70.42.8:6789,secretfile=/etc/ceph/cephfs.secret,noatime,_netdev 0 0