August 28, 2008, Thursday, 240

Starfish QuickStart Tutorial

From DBWiki

Jump to: navigation, search

Contents

System Requirements

If you want to run a Starfish storage peer, you must have the following packages installed:

  • Python 2.5
  • SQLite3 3.4.2
  • Python SQLite3 bindings

If you are running Debian or Ubuntu, you can run the following command to retrieve all of these packages:

apt-get install python2.5 python2.5-pysqlite2

If you want to mount a Starfish storage network, you must have the following packages installed:

  • Linux Kernel 2.6.14 (or greater) with FUSE support
  • Python 2.5
  • Fuse 2.7.1 (or greater)
  • Fuse Utilities 2.7.1 (or greater)
  • Python Fuse 1:0.2-pre3-4.1

If you are running Debian or Ubuntu, you can run the following command to retrieve all of these packages:

apt-get install python fuse-utils python-fuse

Configuring FUSE

You should not run the Starfish Storage Client or the Starfish Storage Peer software under the administrator account. Therefore, you will have to modify the default configuration for FUSE to be able to run Starfish under a safe user account.

After you have installed the fuse-utils package, you will have to make sure that the user that you want to mount the FUSE file system has access to the fusermount program. To do so, run the following commands as root:

useradd -G fuse USERNAME
chown root:fuse /usr/bin/fusermount
chmod 4754 /usr/bin/fusermount

You will have to log out and log back in as the user to be able to mount a FUSE file system as USERNAME.

Installing the Packages

On the storage peer, install the following packages:

On the storage client, install the following packages:

Using Starfish

Starfish is intended to be as simple as possible to use. You can have a storage network up and running with a few simple commands. The following tutorial assumes two storage peers and one storage network client.

Initializing the Storage Peers

To initialize a storage peer, you must create a directory for the storage peer and use the storage peer software to initialize the directory. You must give the storage peer a unique name to use on the network and a directory to initialize.

For our example, let us initialize two storage peers.

user@server1$ mkdir sp1-storage
user@server1$ starfishd -i -v -n sp1 -k mega-storage sp1-storage/
user@server2$ mkdir sp2-storage
user@server2$ starfishd -i -v -n sp2 -k mega-storage sp2-storage/

Let us examine what we did:

  1. We created a storage directory for the starfishd program to place its files into.
  2. We ran the starfishd program, which did the following
    1. -i tells starfishd to perform an initialization on the given directory.
    2. -v tells starfishd to be verbose in reporting what it is doing.
    3. -n gives a unique name to the storage peer.
    4. -k specifies the storage network that the storage peer should join.
    5. The last argument specifies the location in which to operate.

Starting the Storage Peers

Starting the storage peers is easy, just run the following commands on each respective machine. The second storage peer will join the first automatically.

user@server1$ starfishd -v sp1-storage/
user@server2$ starfishd -v sp2-storage/

Let us examine what we did:

  1. We started the starfishd program in verbose (-v) mode on the given directory.

Mounting the Starfish Filesystem

To mount the Starfish filesystem, you must specify the storage network to join as well as a unique storage network client name, the default user ID and group ID of the file system, and the mountpoint location:

user@client3$ mkdir sf-mountpoint
user@client3$ mount.starfish -f -v -n snc1 -k mega-storage \
              -o default_permissions,uid=`id -u`,gid=`id -g` sf-mountpoint/

Let us examine what we did:

  1. We started the Starfish client used to mount a POSIX-compatible filesystem under Linux.
    1. -f instructs the client to run in the foreground.
    2. -v instructs the client to be verbose in its logging.
    3. -n specifies a unique name for the Starfish client.
    4. -k specifies which storage network the Starfish client should join.
    5. -o specifies the options to use when mounting the file system. default_permissions tells the operating system to check permissions before executing certain commands. uid and gid specify the user ID and group ID to use when mounting and accessing the file system.
    6. The last option specifies which directory should be used for the mount point.

Compatability

The Starfish Filesystem is a POSIX-compatible filesystem, thus you should be able to use a very large number of programs with Starfish.

Starfish is also compatible with many programming languages, for example: PHP, Python, Java, Ruby, Perl, C, C++, C#, Fortran.