File System Distribuito: GlusterFS
GlusterFS è un file system clusterizzato capace di gestire molti petabytes.
Segue un dettaglio della mia installazione su un sistema Ubuntu-like.
Il lato client di GlusterFS usa Fuse per il mount.
Scaricare l'ultima versione di GlusterFS da [http://europe.gluster.org/glusterfs/1.3/].
E' consigliabile installare anche una versione patchata di Fuse, fatta su misura per GlusterFS (migliori performance IO ed altro). Si può scaricare da [http://europe.gluster.org/glusterfs/fuse/].
$ cd /opt/source $ mkdir glusterFS $ wget http://europe.gluster.org/glusterfs/1.3/glusterfs-1.3.8pre6.tar.gz $ wget http://europe.gluster.org/glusterfs/fuse/fuse-2.7.2glfs9.tar.gz $ tar xvzf glusterfs-1.3.8pre6.tar.gz $ tar xvzf fuse-2.7.2glfs9.tar.gz
Cominciamo con Fuse (ricordarsi di backappare il modulo originale di fuse, se è già installato).
$ sudo mv /lib/modules/2.6.22-14/kernel/fs/fuse/fuse.ko /lib/modules/2.6.22-14/kernel/fs/fuse/fuse.ko.orig $ cd fuse-2.7.2glfs9/ $ ./configure --prefix=/opt/fuse --enable-kernel-module $ make $ sudo make install $ sudo ldconfig $ sudo rmmod fuse $ sudo modprobe fuse
Adesso GlusterFS
$ cd glusterfs-1.3.8pre6/ $ LDFLAGS='-L/opt/fuse/lib' CPPFLAGS='-I/opt/fuse/include' ./configure --prefix=/opt/glusterfs $ make $ sudo make install
In questa installazione uso 2 server e 1 client. Prima creo su entrambi i server (remote1, remote2) la directory condivisa:
sudo mkdir -p /data/export
Su entrambe le macchine server (remote1, remote2) scrivo in /opt/glusterfs/etc/glusterfs/glusterfs-server.vol:
# file: /opt/glusterfs/etc/glusterfs/glusterfs-server.vol volume brick type storage/posix option directory /data/export end-volume volume server type protocol/server option transport-type tcp/server option auth.ip.brick.allow * subvolumes brick end-volume
e sulla macchina client scrivo in /opt/glusterfs/etc/glusterfs/glusterfs-client.vol:
# file: /opt/glusterfs/etc/glusterfs/glusterfs-client.vol volume remote1 type protocol/client option transport-type tcp/client option remote-host ''remote1.indirizzo.ip'' option remote-subvolume brick end-volume volume remote2 type protocol/client option transport-type tcp/client option remote-host ''remote2.indirizzo.ip'' option remote-subvolume brick end-volume volume mirror0 type cluster/afr subvolumes remote1 remote2 end-volume
Infine sulle macchine server avvio il demone:
$ sudo /opt/glusterfs/sbin/glusterfsd -f /opt/glusterfs/etc/glusterfs/glusterfs-server.vol
e sul client monto la direcotry remota
$ sudo /opt/glusterfs/sbin/glusterfs -f /opt/glusterfs/etc/glusterfs/glusterfs-client.vol /mnt/glusterfs $ # oppure $ sudo /opt/glusterfs/sbin/glusterfs -s remote1.indirizzo.ip /mnt/glusterfs
Possiamo montare la directory anche con il comando mount
$ sudo mount -t glusterfs remote1.indirizzo.ip /mnt/glusterfs
Per montare la direcotry in modo automatico all'avvio aggiungiamo una riga a /etc/fstab:
remote1.indirizzo.ip /mnt/glusterfs glusterfs defaults 0 0
oppure
/opt/glusterfs/etc/glusterfs/glusterfs-client.vol /mnt/glusterfs glusterfs defaults 0 0
ATTENZIONE: Non tentare mai di scrivere direttamente nella directory gestita da GlusterFS, ovvero nell'esempio /data/export !!
Ulteriori risorse
[http://www.gluster.org/docs/index.php/GlusterFS Wiki di GlusterFS]
[http://www.piemontewireless.net Il mio Wiki]
