4. Eucalyptus and Twister on FutureGrid

SALSA Group PTI?Indiana University

4.1. I. Introduction

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

4.2. 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.

4.3. 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. Pleasecdownload the tool in the attachment below.

4.4. 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]

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


  • -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: image1

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).

4.5. V. Terminate Twister Environment

To terminate a Twister environment, execute the following command:


$ python fg_euca_terminate_twister.py

4.6. VI. Run Twister-Kmeans

4.6.1. 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

4.6.2. 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

4.6.3. 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.6.4. 4. Generate Twister-Kmeans


4.6.5. ?

4.6.6. 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:


Attachment Size
fgeucatwister.zip 4.38 KB