Archive - Cloud computing RSS Feed

Distributed filesystem with GlusterFS

This setup contains two GlusterFS-servers and one client, named s01, s02 and c01 in the examples below. Data stored in the mount point on c01 will be destributed to s01 and s02.

The Ubuntu APT repository doesn’t have the latest GlusterFS version, which we want. So we’ll have to build it ourself. Do this on all 3 nodes.

Install packages required to buld GlusterFS.

# aptitude install build-essential flex bison

Download and install GlusterFS. As of date, 3.0.2 is the latest version.

# wget http://ftp.gluster.com/pub/gluster/glusterfs/3.0/LATEST/glusterfs-3.0.2.tar.gz
# tar zxf glusterfs-3.0.2.tar.gz
# cd glusterfs-3.0.2
# ./configure
# make
# make install
# ldconfig

Make sure /export/sda2 exists on both servers, this folder will contain the data stored on the volume.

On s01, do this.

# mkdir /etc/glusterfs
# cd /etc/glusterfs
# glusterfs-volgen --name storage01 s01:/export/sda2 s02:/export/sda2
# ln -s s01-storage01-export.vol glusterfsd.vol
# /etc/init.d/glusterfsd start

On s02, do this.

# mkdir /etc/glusterfs
# cd /etc/glusterfs
# glusterfs-volgen --name storage01 s01:/export/sda2 s02:/export/sda2
# ln -s s02-storage01-export.vol glusterfsd.vol
# /etc/init.d/glusterfsd start

On c01, do this.

# mkdir /etc/glusterfs
# cd /etc/glusterfs
# glusterfs-volgen --name storage01 s01:/export/sda2 s02:/export/sda2

Edit /etc/fstab on c01 and add the following line.

/etc/glusterfs/storage01-tcp.vol        /storage        glusterfs defaults,_netdev      0       0

The share can now be mounted on the client.

# mount /storage
# mount
...
/etc/glusterfs/storage01-tcp.vol on /storage type fuse.glusterfs (rw,allow_other,default_permissions,max_read=131072)

That’s it, for more failsafe setup, consider using –raid for the glusterfs-volgen command.

Rackspace Cloud vs. Amazon EC2

Rackspace Cloud, or Amazon EC2, which is best? This is just a quick performance comparison using SysBench. The following products where tested.

Product CPU Memory Disk Price
EC2 Small Instance 1 virtual core 1,7GB 160GB $0.085 per hour
Rackspace 256MB 4 virtual cores 256MB 10GB $0.015 per hour
Rackspace 1024MB 4 virtual cores 1GB 40GB $0.065 per hour

Servers where running Ubuntu 9.10 i386, tests where performed on two different occasions, average scores where used. Here’s the results, less is good.

Product SysBench CPU Sysbench Memory Sysbench File I/O
EC2 Small Instance 29.7s 491.3s 28.6s
Rackspace 256MB 5.6s 219.1s 26.4s
Rackspace 1024MB 4.1s 196.1s 17.8s

The following commands where used to do the benching, interesting values was the total time to run the test.

sysbench --num-threads=4 --test=cpu run
sysbench --num-threads=4 --test=memory run
sysbench --num-threads=4 --test=fileio --file-test-mode=rndrw prepare
sysbench --num-threads=4 --test=fileio --file-test-mode=rndrw run

Conclusion

According to SysBench, Rackspace Cloud is much faster then EC2 in general, and cheaper as well. EC2 however comes with more memory and disk.

Page 2 of 2«12