Glusterfs kasutamine Gentooga

Allikas: Kuutõrvaja
Redaktsioon seisuga 27. august 2007, kell 11:07 kasutajalt Jj (arutelu | kaastöö) (New page: ===sissejuhatus=== ===probleem=== 1. On olemas veebiserver mis peaks olema töökorras 99% ajast. Et välistada erinevaid softi-raua vigu peaks hoidma üleval kahte. 2. Ühest veebiserv...)
(erin) ←Vanem redaktsioon | Viimane redaktsiooni (erin) | Uuem redaktsioon→ (erin)

sissejuhatus

probleem

1. On olemas veebiserver mis peaks olema töökorras 99% ajast. Et välistada erinevaid softi-raua vigu peaks hoidma üleval kahte.

2. Ühest veebiserverist jääb väheks klientide teenindamisel. Oleks vaja koormust jaotada. Samas veebiserveri sisu muutub pidevalt ja vaja on erinevate serverite infot hoida sünkroonis.


On olemas kaks veebiserverit.

Esimese ip 192.168.1.10 Teise ip 192.168.1.11

Installime mõlemale glusterfs'i

saab seda aadressilt http://ftp.zresearch.com/pub/gluster/glusterfs/

tar -xf glusterfs-1.3.0.tar.gz ./configure --prefix=/usr --disable-ibverbs make make install


localhost gluster # cat /etc/glusterfs.vol

      1. Export volume "brick" with the contents of "/home/export" directory.

volume brick

type storage/posix                   # POSIX FS translator
option directory /home/export        # Export this directory

end-volume

      1. Export volume "brick-afr" with the contents of "/home/afr-export" directory.

volume brick-afr

type storage/posix                   # POSIX FS translator
option directory /home/afr-export    # Export this directory

end-volume

      1. Add network serving capability to above brick.

volume server

type protocol/server
subvolumes brick brick-afr
option transport-type tcp/server     # For TCP/IP transport
option auth.ip.brick.allow *         # access to "brick" volume
option auth.ip.brick-afr.allow *     # access to "brick" volume

end-volume localhost gluster # cat /etc/glusterfs_client.vol

      1. Add client feature and attach to remote subvolume of server1

volume brick1

type protocol/client
option transport-type tcp/client     # for TCP/IP transport
option remote-host 192.168.1.10      # IP address of the remote brick
option remote-subvolume brick        # name of the remote volume

end-volume

      1. Add client feature and attach to remote subvolume of brick2

volume brick2

type protocol/client
option transport-type tcp/client     # for TCP/IP transport
option remote-host 192.168.1.11      # IP address of the remote brick
option remote-subvolume brick        # name of the remote volume

end-volume


      1. Add AFR feature to brick1

volume afr

type cluster/afr
subvolumes brick1 brick2
#option replicate *.html:2,*.db:1,*:2     # Do not leave space before or after "," and ":"
option replicate *:2

end-volume

  1. volume ns
  2. type storage/posix
  3. option directory /home/GlusterFS-NS
  4. end-volume
      1. Add unify feature to cluster the servers. Associate an
      2. appropriate scheduler that matches your I/O demand.
  1. volume bricks
  2. option namespace ns
  3. type cluster/unify
  4. subvolumes afr
  5. option scheduler rr
  6. option rr.limits.min-free-disk 5%
  7. end-volume

localhost gluster # cat /etc/conf.d/local.start

  1. !/bin/bash
  2. /etc/conf.d/local.start

ifconfig eth0 192.168.1.11 netmask 255.255.255.0 route add default gw 192.168.1.1

glusterfsd -f /etc/glusterfs.vol glusterfs -f /etc/glusterfs_client.vol -l /var/log/glusterfs.log -L ERROR /mnt/gluster