Installing Apache Incubator Giraph

We install Giraph, middleware for graph analysis on Hadoop, on CentOS 5.5.

Installing Maven

On the page below, follow the [Mirrors] link for the latest version of Maven in the [Binary tar.gz] row of the table, and copy the download link.

http://maven.apache.org/download.html

Download it with wget, specifying the link as follows.

wget http://ftp.kddilabs.jp/infosystems/apache//maven/binaries/apache-maven-3.0.3-bin.tar.gz

Next, extract and place it.

# tar xvzf apache-maven-3.0.3-bin.tar.gz

# mv apache-maven-3.0.3 /usr/share

# ln -s /usr/share/apache-maven-3.0.3 /usr/share/maven

Edit /etc/profile and add the following.

export M2_HOME=/usr/share/maven
export M2=$M2_HOME/bin
export PATH=$M2:$PATH

Installing Subversion and downloading Giraph

# yum install subversion

As the mapred user:

$ svn checkout https://svn.apache.org/repos/asf/incubator/giraph/trunk

$ cd trunk

$ mvn compile

The Giraph jar file is created in the ~/trunk/target folder.

Testing Giraph

$ hadoop jar target/giraph-0.70-jar-with-dependencies.jar org.apache.giraph.benchmark.PageRankBenchmark -e 1 -s 3 -v -V 500 -w 5

Compiling and running your own Giraph program

Write your own Java source code as a class in Giraph’s examples package.

package org.apache.giraph.examples;

Place the source code under

~/trunk/src/main/java/org/apache/giraph/examples.

In ~/trunk, build with

$ mvn compile

Run it as follows.

$ hadoop jar target/giraph-0.70-jar-with-dependencies.jar org.apache.giraph.examples.[class name] options

By the way, when editing Hadoop + Giraph code with Windows + Eclipse, it is convenient to add

giraph-0.70-jar-with-dependencies.jar
hadoop-0.20.2-cdh3u2-core.jar

to the referenced libraries in your local Eclipse.