Gluster distributed file system

Uit MediaServe Wiki

Ga naar: navigatie, zoeken

Als distributed file system gebruiken we Gluster.

We gaan uit van de situatie met de harde schijf indeling.

Mediaserve kvm cloud.png

Installatie op Debian Squeeze

We beginnen met de installatie van de GlusterFS-Server:

aptitude update
aptitude install glusterfs-server

Test of GlusterFS-Server correct is geïnstalleerd:

glusterfs --version

De originele configuratie gaan we back-uppen zodat we met een lege configuratie beginnen:

mv /etc/glusterfs/glusterfsd.vol /etc/glusterfs/glusterfsd.vol.backup

Nu gaan we /etc/glusterfs/glusterfsd.vol aanmaken met de volgende inhoud:

#####################################
###  GlusterFS Server Volume File  ##
#####################################

volume posix
  type storage/posix
  option directory /storage/local
end-volume

volume posix-locks
  type features/posix-locks
  subvolumes posix
end-volume

volume mandatory-locks
  type features/locks
  option mandatory-locks on
  subvolumes posix-locks
end-volume

volume iothreads
  type performance/io-threads
  option thread-count 16
  subvolumes mandatory-locks
end-volume

volume writebehind
  type performance/write-behind
  option cache-size 128MB
  option flush-behind off
  subvolumes iothreads
end-volume

volume brick
  type performance/io-cache
  option cache-size 64MB
  option cache-timeout 1
  subvolumes writebehind
end-volume

volume server
  type protocol/server
  option transport-type tcp
  option transport.socket.bind-address 85.12.50.254
  option transport.socket.listen-port 6996
  option auth.addr.brick.allow 85.12.50.*
  subvolumes brick
end-volume

De genoemde map /storage/local maken we aan en we starten GlusterFS op:

mkdir -p /storage/local
/etc/init.d/glusterfs-server start

Vervolgens gaan we de client instellen. We beginnen door de voorbeeld configuratie te verplaatsen en een nieuwe configuratie aan te maken:

mv /etc/glusterfs/glusterfs.vol /etc/glusterfs/glusterfs.vol.backup

Nu gaan we /etc/glusterfs/glusterfs.vol aanmaken met de volgende inhoud:

#####################################
###  GlusterFS Client Volume File  ##
#####################################

volume cobalt
  type protocol/client
  option transport-type tcp
  option remote-host 85.12.50.254
  option transport.socket.remote-port 6996
  option transport-timeout 30
  option remote-subvolume brick
end-volume

volume copper
  type protocol/client
  option transport-type tcp
  option remote-host 85.12.50.253
  option transport.socket.remote-port 6996
  option transport-timeout 30
  option remote-subvolume brick
end-volume

volume cluster
  type cluster/replicate
  option read-subvolume cobalt
  subvolumes cobalt copper
end-volume

volume readahead
  type performance/read-ahead
  option page-size 1MB
  option page-count 2
  subvolumes cluster
end-volume

volume iocache
  type performance/io-cache
  option page-size 1MB
  option page-count 2
  subvolumes readahead
end-volume

volume writeback
  type performance/write-behind
  option aggregate-size 1MB
  option window-size 2MB
  option flush-behind off
  subvolumes iocache
end-volume

We voegen de gegevens toe aan /etc/fstab en maken de map aan. Vervolgens kunnen we de cluster mounten en er gebruik van maken.

mkdir -p /storage/cluster
echo "/etc/glusterfs/glusterfs.vol /storage/cluster glusterfs defaults 0 0" >> /etc/fstab
mount -a
df -h

Persoonlijke instellingen
Naamruimten
Varianten
Handelingen
Navigatie
MediaServe
Algemeen