Eucalyptus and Twister on FutureGrid

The FutureGrid Twister Tutorial

SALSA Group
PTI Indiana University

 

I. Introduction

This tutorial will show you how to use Twister under Eucalyptus on India, FutureGrid.
 

II. Prerequisite

Follow tutorial Using Eucalyptus on FutureGrid to learn how to install and use the Eucalyptus client tool to access resources on India, FutureGrid.
 

III. Download FutureGrid Eucalyptus Twister Tool 

This tool is a set of python scripts. They can provide a pre-configured Twister environment, and also can terminate the environment. Please 
download the tool in the attachment below.


IV. Start Twister Environment

To start a Twister environment, execute the following program: 

$ python fg_euca_start_twister.py [-k user key] [-i public key file path] [-n number of instances][-t instance type]

e.g.
$ python fg_euca_start_twister.py -k userkey -i userkey.pem -n 3 -t c1.medium


Here,

  • -k is the user key name generated by the euca-add-keypair step in the Eucalyptus tutorial.
  • -i  is the private key .pem file path. It is also generated in the euca-add-keypair step in the Eucalyptus tutorial.
  • -n is the number of instances for starting.
  • -t  is the type of image.

The following is an execution example:


Once the script is executed, the user can get a prepared Twister environment.
Then, the user can follow the instructions provided by fg_euca_start_twister.py to start ActiveMQ on the assigned node,
and also start the Twister environment (could be on any node just applied).
 

V. Terminate Twister Environment

To terminate a Twister environment, execute the following command:

$ python fg_euca_terminate_twister.py

 

VI. Run Twister-Kmeans

1. Ant and Deploy Twister-Kmeans

Log into the node assigned for ActiveMQ broker. 

$ cd /opt/Twister/samples/kmeans
$ ant
$ cd ../../lib
$ mv Twister-Kmeans-0.9.jar ../apps/
$ cd ../bin/
$ chmod a+x twister.sh
$ ./twister.sh cpj ../apps/Twister-Kmeans-0.9.jar

2. Start Twister and ActiveMQ

Open two terminals and log into the node mentioned above. One is for starting ActiveMQ; the other is for starting Twister.

In Terminal 1:

$ cd /opt/apache-activemq-5.4.2/bin/
$ activemq console
In Terminal 2: 
$ cd /opt/Twister/bin
$ ./start_twister.sh  
 

3. Create Twister-Kmeans Data Folder

Open another terminal, and create a folder for operating kmeans data:
$ cd /opt/Twister/bin
$ ./twishter.sh mkdir kmeans 

4. Generate Twister-Kmeans

 

 

Data

Open a new terminal:
$ cd /opt/Twister/samples/kmeans/bin/
$./gen_data.sh init_clusters.txt 2 3 /kmeans km_data 3 30000
In the terminal used in Step 3, do the following:
$ ./create_partition_file.sh kmeans km ../samples/kmeans/bin/p.pf
Back in the terminal used in Step 4, do the following:
$ ./run_kmeans.sh init_clusters.txt 3 p.pf
 

The output is as follows:

AttachmentSize
fgeucatwister.zip4.38 KB