Distributed File System on Amazon Linux — XtreemFS

By , 2015年8月5日 2:02 下午

[Introduction]

This article provides a quick started guide on how to set up and configure XtreemFS on Amazon Linux. Two EC2 instance are being launched to accomplish this goal. On both EC2 instances, there is an instance-store volume serving as the shared storage.

Edit /etc/hosts on both EC2 instances with the following entries (assuming that the private IP addresses are 172.31.0.11 and 172.31.0.12).

172.31.0.11	node01
172.31.0.12	node02

Then run the following commands to install the xtreemfs-server and xtreemfs-client packages:

$ cd cd /etc/yum.repos.d/
$ sudo wget "http://download.opensuse.org/repositories/home:/xtreemfs/CentOS_6/home:xtreemfs.repo"
$ sudo yum install xtreemfs-server
$ sudo yum install xtreemfs-client

[Configuration]

On both EC2 instances, create file system on the instance-store volume and mount it to /xtreemfs.

$ sudo mkdir -p /xtreemfs
$ sudo mkfs.ext4 /dev/xvdb
$ sudo mount /dev/xvdb /xtreemfs
$ sudo mkdir -p /xtreemfs/mrc/database
$ sudo mkdir -p /xtreemfs/mrc/db-log
$ sudo mkdir -p /xtreemfs/objs
$ sudo chown -R xtreemfs /xtreemfs

On both EC2 instances, modify /etc/xos/xtreemfs/mrcconfig.properties using the following values:

dir_service.host = node01
babudb.baseDir = /xtreemfs/database
babudb.logDir = /xtreemfs/db-log

On both EC2 instances, modify /etc/xos/xtreemfs/osdconfig.properties using the following values:

dir_service.host = node01 
object_dir = /xtreemfs/objs

On node01, start all DIR, MRC and OSD services:

$ sudo service xtreemfs-dir start
$ sudo service xtreemfs-mrc start
$ sudo service xtreemfs-osd start

On node02, start MRC and OSD services:

$ sudo service xtreemfs-mrc start
$ sudo service xtreemfs-osd start

On one of the nodes, create a new volume:

mkfs.xtreemfs localhost/myvolume

On both nodes, mount the volume:

$ sudo mkdir /data
$ sudo chown -R ec2-user:ec2-user /data
$ mount.xtreemfs node01/myvolume /data

Now the shared file system has been set up, and you can create a text file under /data and observe that the file created appears on both EC2 instances.

If you create an AMI for large-scale deployment, please note that in /etc/xos/xtreemfs/mrcconfig.properties and /etc/xos/xtreemfs/osdconfig.properties there are UUID at the end of each file. On each node, the UUID should be different otherwise you will end up very messy. There is a generate_uuid script in the same folder. It is suggest that you do the following to make sure that your AMI works:

(1) Before creating the AMI, remove the UUID lines from the above-mentioned configuration files.

(2) When you launch the instance, use the user-data section to run a bash script to generate the UUID, as below:

#!/bin/bash
cd /etc/xos/xtreemfs
./generate_uuid mrcconfig.properties
./generate_uuid osdconfig.properties

Please bear in mind that this is only a quick start guide, and you should not use this configuration directly in a production system without further tunings.

Leave a Reply

Panorama Theme by Themocracy