HOWTO:Glusterfs
Da Helpedia.
Indice |
Setup di 2 server in Cloud conf
la directory di base è
/storage
la partizione completa è
/cloud
cat /etc/glusterfs/nufa.vol
volume posix type storage/posix option directory /storage end-volume volume locks type features/locks subvolumes posix end-volume volume brick type performance/io-threads subvolumes locks end-volume volume server type protocol/server option transport-type tcp option auth.addr.brick.allow * subvolumes brick end-volume volume host01 type protocol/client option transport-type tcp option remote-host 10.21.0.198 option remote-subvolume brick end-volume volume host02 type protocol/client option transport-type tcp option remote-host 10.21.0.196 option remote-subvolume brick end-volume volume nufa type cluster/nufa option local-volume-name `hostname` # note the backquote, so 'hostname' output will be used as the option. subvolumes host01 host02 end-volume volume writebehind type performance/write-behind option page-size 128KB option cache-size 1MB subvolumes nufa end-volume volume cache type performance/io-cache option cache-size 512MB subvolumes writebehind end-volume
Caricare con:
mount -t glusterfs /etc/glusterfs/nufa.vol /cloud
alcuni test sulle prestazioni:
Scrittura su 1 server
host01:/cloud# dd if=/dev/zero of=/cloud/small bs=64k count=100 100+0 records in 100+0 records out 6553600 bytes (6.6 MB) copied, 0.0393443 seconds, 167 MB/s
host01:/cloud# dd if=/dev/zero of=/cloud/large bs=64k count=10k 10240+0 records in 10240+0 records out 671088640 bytes (671 MB) copied, 5.85558 seconds, 115 MB/s
Lettura sullo stesso server
host01:/cloud# dd of=/dev/null if=/cloud/small bs=64k count=100 100+0 records in 100+0 records out 6553600 bytes (6.6 MB) copied, 0.0141956 seconds, 462 MB/s
host01:/cloud# dd of=/dev/null if=/cloud/large bs=64k count=10k 10240+0 records in 10240+0 records out 671088640 bytes (671 MB) copied, 1.6136 seconds, 416 MB/s
Lettura su 2' server
host02:/cloud# dd of=/dev/null if=/cloud/small bs=64k count=100 100+0 records in 100+0 records out 6553600 bytes (6.6 MB) copied, 0.0814718 seconds, 80.4 MB/s
host02:/cloud# dd of=/dev/null if=/cloud/large bs=64k count=10k 10240+0 records in 10240+0 records out 671088640 bytes (671 MB) copied, 9.50479 seconds, 70.6 MB/s
Setup di 2 server in configurazione replicata
server
Ogni server ha una configurazione custom sulla base degli IP
cat /etc/glusterfs/server-replica.vol
volume gfs-ds type storage/posix option directory /storage end-volume # posix locks volume gfs-ds-locks type features/posix-locks subvolumes gfs-ds end-volume # dataspace on storage2 volume gfs-storage2-ds type protocol/client option transport-type tcp/client option remote-host 10.21.0.196 # storage network option remote-subvolume gfs-ds-locks option transport-timeout 10 # value in seconds; it should be set rel atively low end-volume # automatic file replication translator for dataspace volume gfs-ds-afr type cluster/afr subvolumes gfs-ds-locks gfs-storage2-ds # local and remote dataspaces end-volume # the actual exported volume volume gfs type performance/io-threads option thread-count 8 option cache-size 64MB subvolumes gfs-ds-afr end-volume # finally, the server declaration volume server type protocol/server option transport-type tcp/server subvolumes gfs # storage network access only option auth.ip.gfs-ds-locks.allow 10.21.0.*,127.0.0.1 option auth.ip.gfs.allow 10.21.0.*,127.0.0.1 end-volume
Il server parte con il seguente comando
glusterfs -f /etc/glusterfs/server-replica.vol
Client
Tutti i client hanno la stessa configurazione. Quello che segue è il client che gira sul server
cat /etc/glusterfs/client-replica.vol
# the exported volume to mount # required! volume cluster type protocol/client option transport-type tcp/client option remote-host 127.0.0.1 # RRDNS option remote-subvolume gfs # exported volume option transport-timeout 10 # value in seconds, should be relatively low end-volume # performance block for cluster # optional! volume writeback type performance/write-behind option aggregate-size 131072 subvolumes cluster end-volume # performance block for cluster # optional! volume readahead type performance/read-ahead option page-size 65536 option page-count 16 subvolumes writeback end-volume
Il disco si monta con il solito
mount -t glusterfs /etc/glusterfs/client-replica.vol /cloud