SlideShare une entreprise Scribd logo
1  sur  8
Télécharger pour lire hors ligne
Installing and Running GridGain-1.5.1



1.0 GridGain Definition

GridGain is a grid computing platform for Java. It is developed in Java for Java developers and is
a natural extension of the latest Java development methodologies.

2.0   Description of Experiment and Defining Requirements
The goal of the experiment is to setup GridGain and run a gridded application on the platform.

Hardware Architecture: Dell Dimension 8200
Software Configuration:

Processor – Intel Pentium 4 1.8GHz

RAM – 512mb

Operating System – Fedora Core 6

Installed Software:

      1) GridGain – 1.5.1 – obtained free from http://www.gridgain.com
      2) Java 1.6 – obtained free from http://java.sun.com/javase/6/
      3) Eclipse – obtained free from http://www.eclipse.org

3 Setting up software and hardware
This section details how we set up Java 1.6, Eclipse, and GridGain

3.1 Setting up Java 1.6
Installation of Java 1.6 was straightforward. After obtaining the installation (bin) files, we ran
the program and Java was installed

 However, this new installation did not replace the java file in /usr/bin, which is the default
command run whenever the java command is issued. Thus, the system continued to use the old
java installation. We created a symbolic link in the /usr/bin folder called java that pointed to the
location of the newly installed java file. The syntax is sudo ln –s <location of new java file>
java. This operation would fail if there already is a file called java in /usr/bin. It is wise to
rename the current java file before creating the link. The syntax to rename the file would be
mv java <new name for java file>. The version of Java installation can be checked by running
the command java –version.

3.2 Setting up GridGain 1.5
We encountered one problem when we tried to install GridGain. GridGain requires that a
JAVA_HOME environment variable be set. This environment variable points to the location of
the java installation that GridGain would use. This Java installation has to be version 1.5 or later.
To set this environment variable, we added the line export JAVA_HOME=<location of java
installation> to the /etc/profile file. After the variable was set, the GridGain installation run
smoothly.

Running a node of GridGain presented us with new problems. GridGain requires that a
GRIDGAIN_HOME environment variable be set. This environment variable points to the
installation folder of GridGain. The environment variable is set in the same way as the
JAVA_HOME environment variable. The line export GRIDGAI _HOME=<location of
GridGain installation> is added to /etc/profile file.

In order to give GridGain access to other computers on the network, multicast should be enabled
on the local computer. However, multicast is turned off by default. To turn it on, we run the
command route –add –net 224.0.0.0 netmask 240.0.0.0 dev eth0

This however did not fully solve the problem. The local firewall was blocking GridGain’s
attempts to contact other computers. To turn the firewall off, we run the command sudo
/sbin/service iptables stop

After these steps, the node started up.

3.3 Setting up Eclipse
Eclipse runs without a problem after downloading and extracting it. It should be noted that
Eclipse 3 requires Java 1.6.

4.0 Experiment Setup and Code
We decided to implement a gridded merge sort application. The merge sort algorithm splits the
input to sort the items. This makes it an easy algorithm to distribute over several nodes.

4.1 How Merge Sort works
The algorithm recursively splits the input array into smaller arrays until each array has a size of
one. It then puts the array back together, sorting the items before putting them in the array.

How the Gridded Merge Sort works. It recursively splits the input array until the constituent
arrays are below a specified size. The arrays are then sent to remote nodes for execution. Each
node runs the merge sort algorithm and returns a sorted version of the array it received. These
sorted arrays are then merged to form the whole sorted array.

4.2 Programming in GridGain
The documentation and API for GridGain can be found at
http://www.gridgain.com/javadoc/org/gridgain/grid/package-summary.html.

4.3 Experiment Setup
I used a modified form of the merge sort algorithm implementation found on the site …

To set up the experiment, we first started up the Eclipse IDE. We created a new Java project.
After this, we added the GridGain libraries to the build path of the project.

4.4 Code
The merge sort class extends the GridTaskSplitAdapter class. The GridTaskSplitAdapter adapter
can be used when jobs can be randomly assigned to available grid nodes. This adapter is
sufficient in most homogenous environments where all nodes are equally suitable for executing
grid job. Therefore, this is perfect for our needs. The code that does the sorting is readily
available on the internet and is omitted from this report.



The abstract method split() must controls how the task is split up into jobs. This implementation
of the split method recursively splits the array until it reaches a specified size.
public Collection<? extends GridJob> split(int gridSize, int[] A) throws
GridException {

                 List<GridJob> jobs = new ArrayList<GridJob>(array.size());

              if (A.length<=10)//add array to list of jobs if it meets the
size requirement
              {
                    jobnum++;
                    array.add(A);
                    System.out.println("Job "+ jobnum + (" added"));
              }

                 else //recursively split arrays if size is greater than 10
                 {

                         int mid   = A.length/2;
                         int k =   mid;
                         int[] B   = new int[mid];
                         int[] C   = new int[(A.length-mid)];

                         for (int i = 0; i<mid; i++)
{
                                B[i]=A[i];

                         }

                         for (int i = 0; i<(A.length-mid); i++)
                         {
                               C[i]=A[k];
                               k++;
                         }

                         split(gridSize, B);//recursively split arrays
                         split(gridSize, C); //recursively split arrays

                     }
                 //assign each task to a job

              for (final int [] arra : array)
              {
                    jobs.add(new GridJobAdapter<int[]>(arra)//create jobs
from items in the job list
                    {

                                public Serializable execute()//code for each job to
execute
                                {
                                        System.out.println("Sorting... Be patient");
                                        MergeSort.sort(arra);
                                        nodecount++;
                                        System.out.println("Node "+ nodecount + "
results ...");
                                        for (int i = 0; i<arra.length; i++)
                                              System.out.println(arra[i]+ " ");
                                        System.out.println("");
                                        return arra;
                                }
                         });

                      }
                      return jobs;
                                                            }



When the task is split, each individual task is assigned to a job (GridJobAdapter). Each job
executes the code found in the execute method of the GridJobAdapter. This implementation of
the execute method calls the sort method of the class. When the job is complete, the results are
put in a collection and returned.

The reduce method aggregates the job results received from the split method. This
implementation of the split method merges the sorted arrays into one sorted array. It uses a
helper method called collapse.
public Serializable reduce(List<GridJobResult> results) throws GridException
//aggregates results from grids
        {
              int[] sorted = new int[5];

                     Vector<int[]> store = new Vector<int[]>();

                 for (GridJobResult res : results)//get data from successful grid
jobs
                 {
                          store.add((int[]) res.getData());
                 }

                 while (store.size()>2)//merge individual arrays received from
grids
                          collapse(store);

           if (store.size()<= 2)
           {
             if (store.size()==2)
             {
                  sorted = new
int[(store.elementAt(0).length+store.elementAt(1).length)];
                   merge(store.elementAt(0), store.elementAt(1), sorted);
             }
             if (store.size()==1)
             {
                   sorted = new int[store.elementAt(0).length];
                   sorted = store.elementAt(0);
             }
           }


                return sorted;
           }
 }

private void collapse(Vector<int[]> store)
        {
              int size = store.size();
              if (size==2)
                    return;
              else
              {
                    int[] temp = new
int[(store.lastElement().length+store.elementAt(size-2).length)];
                    merge(store.lastElement(), store.elementAt(size-2),
temp);
                    store.add(size-2, temp);
                    store.setSize(size-1);
                    return ;
              }
        }

The gridded merge sort application is complete. All that is required now is the driver. The driver contains
the main method. It starts the grid, and tells the grid what to execute. Here is the code for my driver.
import java.util.Random;

import org.gridgain.grid.Grid;
import org.gridgain.grid.GridException;
import org.gridgain.grid.GridFactory;


public class MergeSortExample{

         /**
          * @param args
          */
         public static void main(String[] args) throws GridException{
               GridFactory.start();//starts the grid

               try {
                       Grid grid = GridFactory.getGrid();//creates an instance of
a grid
                     int[] test = new int[1000];
                   Random jon = new Random();

                         for (int i=0; i<1000; i++)
                         {
                               test[i] = jon.nextInt(1000);
                         }

                         for (int i = 0; i<test.length; i++)
                               System.out.print(test[i] + " ");


                          test =(int[])grid.execute(MergeSort.class.getName(),
test).get();

                         System.out.println("The gridded sort result is ...");
                         for (int i = 0; i<test.length; i++)
                         {
                               System.out.print(test[i] + " ");
                         }

                         System.out.println("");

               }

               finally {
                     GridFactory.stop(true);//stops the grid
               }

         }

}
5.0 Results of Experiment

To test the setup, I run three GridGain nodes on the host computer. One node run from the
Eclipse IDE and the others were standalone nodes. I also run three additional nodes on a
Windows machine. I did this to see if GridGain could really distribute across different operating
systems. Below are screen shots of the nodes from both machines. The first screenshot is from
the host machine.




The top two visible windows are the standalone GridGain nodes. The window at the bottom is
the node from Eclipse IDE and it displays part of the results of the final sorted array

The next screenshot shows the nodes run on the Windows box.
The three GridGain nodes and the results of their computation can be seen here.


6.0 Conclusion
We were able to achieve the goals we set for ourselves for the experiment. We installed
GridGain and successfully run an application on it. GridGain provides a great API for quick
development of gridded applications. Anyone who can program in Java can quickly catch on to
the GridGain API and be writing applications in no time. As demonstrated by the experiment, the
underlying architecture of the remote nodes does not matter to GridGain. It can distribute jobs to
remote computers that run different operating systems and have different hardware
implementations. This is one of the big advantages of grid computing, and GridGain implements
it very well.

Contenu connexe

Tendances

Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...Paul King
 
Jdbc oracle
Jdbc oracleJdbc oracle
Jdbc oracleyazidds2
 
XSpect, a lightweight library to make your code reusable and maintainable.
XSpect, a lightweight library to make your code reusable and maintainable.XSpect, a lightweight library to make your code reusable and maintainable.
XSpect, a lightweight library to make your code reusable and maintainable.岡諭 李
 
concurrency gpars
concurrency gparsconcurrency gpars
concurrency gparsPaul King
 
Java PRACTICAL file
Java PRACTICAL fileJava PRACTICAL file
Java PRACTICAL fileRACHIT_GUPTA
 
Mathemetics module
Mathemetics moduleMathemetics module
Mathemetics modulemanikanta361
 
The Ring programming language version 1.2 book - Part 78 of 84
The Ring programming language version 1.2 book - Part 78 of 84The Ring programming language version 1.2 book - Part 78 of 84
The Ring programming language version 1.2 book - Part 78 of 84Mahmoud Samir Fayed
 
Writing and using Hamcrest Matchers
Writing and using Hamcrest MatchersWriting and using Hamcrest Matchers
Writing and using Hamcrest MatchersShai Yallin
 
망고100 보드로 놀아보자 19
망고100 보드로 놀아보자 19망고100 보드로 놀아보자 19
망고100 보드로 놀아보자 19종인 전
 
Leveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyLeveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyDavid Gómez García
 
Uncommon Design Patterns
Uncommon Design PatternsUncommon Design Patterns
Uncommon Design PatternsStefano Fago
 
Autoboxing and unboxing
Autoboxing and unboxingAutoboxing and unboxing
Autoboxing and unboxingGeetha Manohar
 
Refactoring In Tdd The Missing Part
Refactoring In Tdd The Missing PartRefactoring In Tdd The Missing Part
Refactoring In Tdd The Missing PartGabriele Lana
 
Finagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at PinterestFinagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at PinterestPavan Chitumalla
 

Tendances (20)

Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
 
Jdbc oracle
Jdbc oracleJdbc oracle
Jdbc oracle
 
XSpect, a lightweight library to make your code reusable and maintainable.
XSpect, a lightweight library to make your code reusable and maintainable.XSpect, a lightweight library to make your code reusable and maintainable.
XSpect, a lightweight library to make your code reusable and maintainable.
 
concurrency gpars
concurrency gparsconcurrency gpars
concurrency gpars
 
Java PRACTICAL file
Java PRACTICAL fileJava PRACTICAL file
Java PRACTICAL file
 
Mathemetics module
Mathemetics moduleMathemetics module
Mathemetics module
 
The Ring programming language version 1.2 book - Part 78 of 84
The Ring programming language version 1.2 book - Part 78 of 84The Ring programming language version 1.2 book - Part 78 of 84
The Ring programming language version 1.2 book - Part 78 of 84
 
Writing and using Hamcrest Matchers
Writing and using Hamcrest MatchersWriting and using Hamcrest Matchers
Writing and using Hamcrest Matchers
 
망고100 보드로 놀아보자 19
망고100 보드로 놀아보자 19망고100 보드로 놀아보자 19
망고100 보드로 놀아보자 19
 
Leveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyLeveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results Asynchrhonously
 
Autoboxing And Unboxing In Java
Autoboxing And Unboxing In JavaAutoboxing And Unboxing In Java
Autoboxing And Unboxing In Java
 
Uncommon Design Patterns
Uncommon Design PatternsUncommon Design Patterns
Uncommon Design Patterns
 
Java Concurrency
Java ConcurrencyJava Concurrency
Java Concurrency
 
Autoboxing and unboxing
Autoboxing and unboxingAutoboxing and unboxing
Autoboxing and unboxing
 
Workflows ss
Workflows ssWorkflows ss
Workflows ss
 
Task and Data Parallelism
Task and Data ParallelismTask and Data Parallelism
Task and Data Parallelism
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
Refactoring In Tdd The Missing Part
Refactoring In Tdd The Missing PartRefactoring In Tdd The Missing Part
Refactoring In Tdd The Missing Part
 
Saving lives with rx java
Saving lives with rx javaSaving lives with rx java
Saving lives with rx java
 
Finagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at PinterestFinagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at Pinterest
 

Similaire à Grid gain paper

Flink Batch Processing and Iterations
Flink Batch Processing and IterationsFlink Batch Processing and Iterations
Flink Batch Processing and IterationsSameer Wadkar
 
Jdk 7 4-forkjoin
Jdk 7 4-forkjoinJdk 7 4-forkjoin
Jdk 7 4-forkjoinknight1128
 
Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesAnkit Rastogi
 
Part 1 - Written AnswersDownload the GridWriter.zip file and exami.pdf
Part 1 - Written AnswersDownload the GridWriter.zip file and exami.pdfPart 1 - Written AnswersDownload the GridWriter.zip file and exami.pdf
Part 1 - Written AnswersDownload the GridWriter.zip file and exami.pdfkamdinrossihoungma74
 
Basic java, java collection Framework and Date Time API
Basic java, java collection Framework and Date Time APIBasic java, java collection Framework and Date Time API
Basic java, java collection Framework and Date Time APIjagriti srivastava
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfinfo309708
 
Threads, Queues, and More: Async Programming in iOS
Threads, Queues, and More: Async Programming in iOSThreads, Queues, and More: Async Programming in iOS
Threads, Queues, and More: Async Programming in iOSTechWell
 
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMEREVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMERAndrey Karpov
 

Similaire à Grid gain paper (20)

Flink Batch Processing and Iterations
Flink Batch Processing and IterationsFlink Batch Processing and Iterations
Flink Batch Processing and Iterations
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
J2SE 5
J2SE 5J2SE 5
J2SE 5
 
Unit 3
Unit 3 Unit 3
Unit 3
 
Jdk 7 4-forkjoin
Jdk 7 4-forkjoinJdk 7 4-forkjoin
Jdk 7 4-forkjoin
 
Gephi Toolkit Tutorial
Gephi Toolkit TutorialGephi Toolkit Tutorial
Gephi Toolkit Tutorial
 
Celery with python
Celery with pythonCelery with python
Celery with python
 
Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practices
 
Part 1 - Written AnswersDownload the GridWriter.zip file and exami.pdf
Part 1 - Written AnswersDownload the GridWriter.zip file and exami.pdfPart 1 - Written AnswersDownload the GridWriter.zip file and exami.pdf
Part 1 - Written AnswersDownload the GridWriter.zip file and exami.pdf
 
Basic java, java collection Framework and Date Time API
Basic java, java collection Framework and Date Time APIBasic java, java collection Framework and Date Time API
Basic java, java collection Framework and Date Time API
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
 
Lambdas puzzler - Peter Lawrey
Lambdas puzzler - Peter LawreyLambdas puzzler - Peter Lawrey
Lambdas puzzler - Peter Lawrey
 
Threads, Queues, and More: Async Programming in iOS
Threads, Queues, and More: Async Programming in iOSThreads, Queues, and More: Async Programming in iOS
Threads, Queues, and More: Async Programming in iOS
 
Forgive me for i have allocated
Forgive me for i have allocatedForgive me for i have allocated
Forgive me for i have allocated
 
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMEREVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
 
Functional Programming
Functional ProgrammingFunctional Programming
Functional Programming
 
Cpp tutorial
Cpp tutorialCpp tutorial
Cpp tutorial
 
6_Array.pptx
6_Array.pptx6_Array.pptx
6_Array.pptx
 
java-programming.pdf
java-programming.pdfjava-programming.pdf
java-programming.pdf
 
Thread
ThreadThread
Thread
 

Dernier

ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdfMuhammad Subhan
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...FIDO Alliance
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideStefan Dietze
 

Dernier (20)

ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 

Grid gain paper

  • 1. Installing and Running GridGain-1.5.1 1.0 GridGain Definition GridGain is a grid computing platform for Java. It is developed in Java for Java developers and is a natural extension of the latest Java development methodologies. 2.0 Description of Experiment and Defining Requirements The goal of the experiment is to setup GridGain and run a gridded application on the platform. Hardware Architecture: Dell Dimension 8200 Software Configuration: Processor – Intel Pentium 4 1.8GHz RAM – 512mb Operating System – Fedora Core 6 Installed Software: 1) GridGain – 1.5.1 – obtained free from http://www.gridgain.com 2) Java 1.6 – obtained free from http://java.sun.com/javase/6/ 3) Eclipse – obtained free from http://www.eclipse.org 3 Setting up software and hardware This section details how we set up Java 1.6, Eclipse, and GridGain 3.1 Setting up Java 1.6 Installation of Java 1.6 was straightforward. After obtaining the installation (bin) files, we ran the program and Java was installed However, this new installation did not replace the java file in /usr/bin, which is the default command run whenever the java command is issued. Thus, the system continued to use the old java installation. We created a symbolic link in the /usr/bin folder called java that pointed to the location of the newly installed java file. The syntax is sudo ln –s <location of new java file> java. This operation would fail if there already is a file called java in /usr/bin. It is wise to rename the current java file before creating the link. The syntax to rename the file would be
  • 2. mv java <new name for java file>. The version of Java installation can be checked by running the command java –version. 3.2 Setting up GridGain 1.5 We encountered one problem when we tried to install GridGain. GridGain requires that a JAVA_HOME environment variable be set. This environment variable points to the location of the java installation that GridGain would use. This Java installation has to be version 1.5 or later. To set this environment variable, we added the line export JAVA_HOME=<location of java installation> to the /etc/profile file. After the variable was set, the GridGain installation run smoothly. Running a node of GridGain presented us with new problems. GridGain requires that a GRIDGAIN_HOME environment variable be set. This environment variable points to the installation folder of GridGain. The environment variable is set in the same way as the JAVA_HOME environment variable. The line export GRIDGAI _HOME=<location of GridGain installation> is added to /etc/profile file. In order to give GridGain access to other computers on the network, multicast should be enabled on the local computer. However, multicast is turned off by default. To turn it on, we run the command route –add –net 224.0.0.0 netmask 240.0.0.0 dev eth0 This however did not fully solve the problem. The local firewall was blocking GridGain’s attempts to contact other computers. To turn the firewall off, we run the command sudo /sbin/service iptables stop After these steps, the node started up. 3.3 Setting up Eclipse Eclipse runs without a problem after downloading and extracting it. It should be noted that Eclipse 3 requires Java 1.6. 4.0 Experiment Setup and Code We decided to implement a gridded merge sort application. The merge sort algorithm splits the input to sort the items. This makes it an easy algorithm to distribute over several nodes. 4.1 How Merge Sort works The algorithm recursively splits the input array into smaller arrays until each array has a size of one. It then puts the array back together, sorting the items before putting them in the array. How the Gridded Merge Sort works. It recursively splits the input array until the constituent arrays are below a specified size. The arrays are then sent to remote nodes for execution. Each
  • 3. node runs the merge sort algorithm and returns a sorted version of the array it received. These sorted arrays are then merged to form the whole sorted array. 4.2 Programming in GridGain The documentation and API for GridGain can be found at http://www.gridgain.com/javadoc/org/gridgain/grid/package-summary.html. 4.3 Experiment Setup I used a modified form of the merge sort algorithm implementation found on the site … To set up the experiment, we first started up the Eclipse IDE. We created a new Java project. After this, we added the GridGain libraries to the build path of the project. 4.4 Code The merge sort class extends the GridTaskSplitAdapter class. The GridTaskSplitAdapter adapter can be used when jobs can be randomly assigned to available grid nodes. This adapter is sufficient in most homogenous environments where all nodes are equally suitable for executing grid job. Therefore, this is perfect for our needs. The code that does the sorting is readily available on the internet and is omitted from this report. The abstract method split() must controls how the task is split up into jobs. This implementation of the split method recursively splits the array until it reaches a specified size. public Collection<? extends GridJob> split(int gridSize, int[] A) throws GridException { List<GridJob> jobs = new ArrayList<GridJob>(array.size()); if (A.length<=10)//add array to list of jobs if it meets the size requirement { jobnum++; array.add(A); System.out.println("Job "+ jobnum + (" added")); } else //recursively split arrays if size is greater than 10 { int mid = A.length/2; int k = mid; int[] B = new int[mid]; int[] C = new int[(A.length-mid)]; for (int i = 0; i<mid; i++)
  • 4. { B[i]=A[i]; } for (int i = 0; i<(A.length-mid); i++) { C[i]=A[k]; k++; } split(gridSize, B);//recursively split arrays split(gridSize, C); //recursively split arrays } //assign each task to a job for (final int [] arra : array) { jobs.add(new GridJobAdapter<int[]>(arra)//create jobs from items in the job list { public Serializable execute()//code for each job to execute { System.out.println("Sorting... Be patient"); MergeSort.sort(arra); nodecount++; System.out.println("Node "+ nodecount + " results ..."); for (int i = 0; i<arra.length; i++) System.out.println(arra[i]+ " "); System.out.println(""); return arra; } }); } return jobs; } When the task is split, each individual task is assigned to a job (GridJobAdapter). Each job executes the code found in the execute method of the GridJobAdapter. This implementation of the execute method calls the sort method of the class. When the job is complete, the results are put in a collection and returned. The reduce method aggregates the job results received from the split method. This implementation of the split method merges the sorted arrays into one sorted array. It uses a helper method called collapse.
  • 5. public Serializable reduce(List<GridJobResult> results) throws GridException //aggregates results from grids { int[] sorted = new int[5]; Vector<int[]> store = new Vector<int[]>(); for (GridJobResult res : results)//get data from successful grid jobs { store.add((int[]) res.getData()); } while (store.size()>2)//merge individual arrays received from grids collapse(store); if (store.size()<= 2) { if (store.size()==2) { sorted = new int[(store.elementAt(0).length+store.elementAt(1).length)]; merge(store.elementAt(0), store.elementAt(1), sorted); } if (store.size()==1) { sorted = new int[store.elementAt(0).length]; sorted = store.elementAt(0); } } return sorted; } } private void collapse(Vector<int[]> store) { int size = store.size(); if (size==2) return; else { int[] temp = new int[(store.lastElement().length+store.elementAt(size-2).length)]; merge(store.lastElement(), store.elementAt(size-2), temp); store.add(size-2, temp); store.setSize(size-1); return ; } } The gridded merge sort application is complete. All that is required now is the driver. The driver contains the main method. It starts the grid, and tells the grid what to execute. Here is the code for my driver.
  • 6. import java.util.Random; import org.gridgain.grid.Grid; import org.gridgain.grid.GridException; import org.gridgain.grid.GridFactory; public class MergeSortExample{ /** * @param args */ public static void main(String[] args) throws GridException{ GridFactory.start();//starts the grid try { Grid grid = GridFactory.getGrid();//creates an instance of a grid int[] test = new int[1000]; Random jon = new Random(); for (int i=0; i<1000; i++) { test[i] = jon.nextInt(1000); } for (int i = 0; i<test.length; i++) System.out.print(test[i] + " "); test =(int[])grid.execute(MergeSort.class.getName(), test).get(); System.out.println("The gridded sort result is ..."); for (int i = 0; i<test.length; i++) { System.out.print(test[i] + " "); } System.out.println(""); } finally { GridFactory.stop(true);//stops the grid } } }
  • 7. 5.0 Results of Experiment To test the setup, I run three GridGain nodes on the host computer. One node run from the Eclipse IDE and the others were standalone nodes. I also run three additional nodes on a Windows machine. I did this to see if GridGain could really distribute across different operating systems. Below are screen shots of the nodes from both machines. The first screenshot is from the host machine. The top two visible windows are the standalone GridGain nodes. The window at the bottom is the node from Eclipse IDE and it displays part of the results of the final sorted array The next screenshot shows the nodes run on the Windows box.
  • 8. The three GridGain nodes and the results of their computation can be seen here. 6.0 Conclusion We were able to achieve the goals we set for ourselves for the experiment. We installed GridGain and successfully run an application on it. GridGain provides a great API for quick development of gridded applications. Anyone who can program in Java can quickly catch on to the GridGain API and be writing applications in no time. As demonstrated by the experiment, the underlying architecture of the remote nodes does not matter to GridGain. It can distribute jobs to remote computers that run different operating systems and have different hardware implementations. This is one of the big advantages of grid computing, and GridGain implements it very well.