You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »


Installo sistema operativo (Alma9)


Disabilito SELinux


yum install epel-release


Installo 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

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

Metto il nodo sotto puppet nell'hostgroup  hosts_all/CephProd (questo tra l'altro permettera' di settare il file di conf ceph.conf)


Copio da un altro nodo  il file /etc/ceph/ceph.client.admin.keyring che dovra' avere questa ownership/protezioni:


-rw-------. 1 ceph ceph 137 Feb 20 13:51 /etc/ceph/ceph.client.admin.keyring


A questo punto un "ceph status" dovrebbe funzionare


Configurazione mds:


mkdir /var/lib/ceph/mds/ceph-`hostname -s`
chown ceph.ceph /var/lib/ceph/mds/ceph-`hostname -s`
ceph auth get-or-create mds.`hostname -s` mon 'profile mds' mgr 'profile mds' mds 'allow *' osd 'allow *' > /var/lib/ceph/mds/ceph-`hostname -s`/keyring

chown -R ceph.ceph /var/lib/ceph/mds/`hostname -s`
systemctl start ceph-mds@`hostname -s`
systemctl enable ceph-mds@`hostname -s`
systemctl status ceph-mds@`hostname -s`



A questo punto un "ceph versions" dovrebbe fare vedere gli MDS. Credo sia normale che non si vedano con un "ceph status" (quelli si vedono solo dopo che ho creato il file system



Creazione di un file system ceph-fs


Credo i pool per dati e metadati:


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:
   

ceph fs new cephfs cephfs_metadata cephfs_data


Dovrei ora vedere un MDS active e uno in standby:


[root@c-mds-02 almalinux]# ceph mds stat
cephfs:1 {0=c-mds-01=up:active} 1 up:standby


Creo un client per questo filesystem:


[root@c-mon-1 almalinux]# ceph fs authorize cephfs client.cephfs / rw | tee /etc/ceph/ceph.client.cephfs.keyring
[client.cephfs]
    key = AQAM8YRniubJLRAA3HlOQ8SCgjAAq/HtNbHv3A==


Il file /etc/ceph/ceph.client.cephfs.keyring servira' poi nei client nodes (v. sotto)

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



  • No labels